catkin: build debendencies library of two other libraries
Dear Community,
i have some troubles with a Library which is dependend on two others. I have added them all to CMakeLists.txt of my Package, it compiles correct but linking doesn't work.
Here the relevant parts of my CMakeLists.txt:
link_directories(src/vPoint/ src/lsd/)
add_library(MSAC
src/vPoint/MSAC.h
src/vPoint/MSAC.cpp
src/vPoint/lmmin.h
src/vPoint/lmmin.c
src/vPoint/errorNIETO.h
src/vPoint/errorNIETO.cpp
)
add_library(LSDLIB
src/lsd/lsd.h
src/lsd/lsd.c
)
add_library(FEATURES
src/feature.cpp
src/featureConstants.cpp
include/open_cv_testing/feature.h
)
add_executable(lsdnode src/lsd_node.cpp)
target_link_libraries(FEATURES LSDLIB MSAC ${catkin_LIBRARIES})
target_link_libraries(lsdnode FEATURES ${catkin_LIBRARIES})
With the Features Library only dependent from MSAC everything worked, but now also with LSDLIB library. It says while Linking it undefined resource lsd(...) but it's well defined with lsd.h and lsd.c.
Any Help what I'm missing appreciated...
The acutall error output is:
/home/martin/catkin_ws/devel/lib/libFEATURES.so: undefined reference to `lsd(int*, double*, int, int)'
collect2: ld returned 1 exit status
make[2]: *** [/home/martin/catkin_ws/devel/lib/open_cv_testing/lsdnode] Error 1
make[1]: *** [open_cv_testing/CMakeFiles/lsdnode.dir/all] Error 2
make: *** [all] Error 2
I'm using ROS Groovy in Ubuntu 12.04 LTS
LSD Library from here: http://www.ipol.im/pub/art/2012/gjmr-... Invoking in my Features Source code as in their call example, which runs without troubles...
can you please post the actual error output? Furthermore: OS, ROS-Distro, ...
hi, thanks for your answer, hope i have added enough information now
Just found out that the problem, is not the Library which uses two Librarys. I made a test node, which uses the LSD Lib directly (without the FEATURES Lib) and there is the same problem with the undefined reference: target_link_libraries(lsdtest LSDLIB {catkin_LIBRARIES})