<div dir="ltr">hello,<br><br>I'm working on a C++ package for ROS (robot operating system) that uses a C library libccv.a. ROS uses CMake which is why I am asking here. Asking at ROS <font style="background-color:rgb(255,192,203)">answers</font> did not help and I am totally stuck.<div style>
<br></div><div style>
here is the relevant part of my CMakeLists.txt:</div><div style><br></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div style><div style>set(SOURCES src/${PROJECT_NAME}.cpp src/RosDispatcher.cpp src/Text2D.cpp src/TDetector.cpp src/TRecognizer.cpp)</div>
<div style>set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")</div><div style><br></div><div style>find_package(CCV REQUIRED)</div><div style>include_directories(${CCV_INCLUDE_DIR})</div>
<div style>set(LIBS ${LIBS} ${CCV_LIBRARY})</div><div style><br></div><div style>find_package(JPEG REQUIRED)</div><div style>include_directories(${JPEG_INCLUDE_DIR})</div><div style>set(LIBS ${LIBS} ${JPEG_LIBRARY})</div>
<div style><br></div><div style>find_package(PNG REQUIRED)</div><div style>include_directories(${PNG_INCLUDE_DIR})</div><div style>set(LIBS ${LIBS} ${PNG_LIBRARY})</div><div style><br></div><div style>message(STATUS "linked libs: ${LIBS}")</div>
<div style><br></div><div style>rosbuild_add_executable(${PROJECT_NAME} ${SOURCES})</div><div style>target_link_libraries(${PROJECT_NAME} ${LIBS})</div></div><div style><div style>
</div></div></blockquote><div style><br></div><div style>I am getting this error:<br><div style><br></div></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">undefined reference to `ccv_read_impl(...)'<br>
and more undefined references to the stuff from the library<br></blockquote><br><div style><div style>libccv.a comes with a header file ccv.h and it depends on libjpeg and libpng.<br></div><div style><br></div>I wrote my own FindCCV.cmake to find the library and put it into ${CMAKE_SOURCE_DIR}/cmake/Modules/, together with finders for jpeg and png. As far as I know, all three are found successfully (the REQUIRED keyword doesn't stop compilation and there are correct address entries in CMakeCache). The libraries are in correct order ccv, jpeg, png (ccv depends on them).</div>
<div style><br></div><div style><a href="http://pastebin.com/iye7iuqX">here</a> [pastebin] is output of the compilation</div><div style><a href="http://pastebin.com/f6WK1A1x">here</a> is my FindCCV.cmake</div><div style>
<br>
</div><div style>Please, what am I doing wrong?</div>
<div style><br>Any help is very greatly appreciated, thanks!</div></div>