undefined reference to a static library
hello, I'm having a lot of trouble with this one: (ros fuerte, ubuntu 12.04 LTS)
I'm working on a C++ package that uses a C library libccv.a. When linking, I am getting this error:
undefined reference to 'ccv_enable_default_cache()'
and more undefined references to the stuff from the library
libccv.a comes with a header file ccv.h and it depends on libjpeg and libpng.
here is the relevant part of the CMakeLists.txt
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
rosbuild_add_executable(${PROJECT_NAME} src/TDetector.cpp src/TRecognizer.cpp src/${PROJECT_NAME}.cpp)
FIND_LIBRARY(ccv libccv.a PATHS ${LIBRARY_OUTPUT_PATH}))
include_directories(${PROJECT_SOURCE_DIR}/src)
FIND_LIBRARY(jpeg libjpeg.a PATHS usr/lib)
FIND_LIBRARY(png libpng.a PATHS usr/lib)
target_link_libraries(${PROJECT_NAME} ${ccv} ${jpeg} ${png})
the library is in /lib folder of my project. everything else (source and headers) is in /src. I also tried the link_directories
way instead of find_library, without success. I believe the linker finds the library because there is no cannot find
message
I read some resources on rosbuild but I can't make it work. What am I doing wrong?
Any help is greatly appreciated, thanks!