Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to build on 15.04: DSO Missing from CLI #1

Open
mankoff opened this issue Dec 2, 2015 · 7 comments
Open

Fails to build on 15.04: DSO Missing from CLI #1

mankoff opened this issue Dec 2, 2015 · 7 comments

Comments

@mankoff
Copy link

mankoff commented Dec 2, 2015

Since I can't run ElasticFusion with my XTION Pro (non-Live), I was trying to us Logger1 with a Kinect, but cannot build it.

[100%] Building CXX object CMakeFiles/Logger.dir/OpenNI/openni_depth_image.cpp.o
Linking CXX executable Logger
/usr/bin/ld: CMakeFiles/Logger.dir/OpenNI/openni_driver.cpp.o: undefined reference to symbol 'libusb_get_device_descriptor'
/lib/x86_64-linux-gnu/libusb-1.0.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
CMakeFiles/Logger.dir/build.make:474: recipe for target 'Logger' failed
make[2]: *** [Logger] Error 1
CMakeFiles/Makefile2:60: recipe for target 'CMakeFiles/Logger.dir/all' failed
make[1]: *** [CMakeFiles/Logger.dir/all] Error 2
Makefile:76: recipe for target 'all' failed
make: *** [all] Error 2
@mp3guy
Copy link
Owner

mp3guy commented Dec 4, 2015

For this you need to add libusb-1.0 to target_link_libraries in CMakeLists.txt. Also make sure libusb-1.0-dev is installed.

@bugnix
Copy link

bugnix commented Dec 9, 2015

I had the same issue as mankoff, and your solution resolved the libusb linker errors.
But now there seems to be some problem with boost, although boost is installed on my system.
The error occurs on a fresh Ubuntu 15.04 with Kintinuous built only.

Linking CXX executable Logger
CMakeFiles/Logger.dir/main.cpp.o: In function MainWindow::getNextFilename()': main.cpp:(.text+0x5c5): undefined reference toboost::filesystem::detail::status(boost::filesystem::path const&, boost::system::error_code_)'
CMakeFiles/Logger.dir/main.cpp.o: In function MainWindow::MainWindow(Logger_)': main.cpp:(.text+0x2f91): undefined reference to boost::filesystem::detail::create_directory(boost::filesystem::path const&, boost::system::error_code*)'
CMakeFiles/Logger.dir/main.cpp.o: In functionboost::thread_exception::thread_exception(int, char const_)': main.cpp:(.text._ZN5boost16thread_exceptionC2EiPKc[_ZN5boost16thread_exceptionC5EiPKc]+0x24): undefined reference to boost::system::system_category()'
CMakeFiles/Logger.dir/main.cpp.o: In function_GLOBAL__sub_I_main': main.cpp:(.text.startup+0x23): undefined reference to boost::system::generic_category()'
main.cpp:(.text.startup+0x2f): undefined reference toboost::system::generic_category()' main.cpp:(.text.startup+0x3b): undefined reference to boost::system::system_category()'
CMakeFiles/Logger.dir/moc_main.cxx.o: In function_GLOBAL__sub_I__ZN10MainWindow18qt_static_metacallEP7QObjectN11QMetaObject4CallEiPPv': [...] openni_device_oni.cpp:(.text.startup+0x3b): undefined reference to boost::system::system_category()'
CMakeFiles/Logger.dir/OpenNI/openni_device_oni.cpp.o:(.rodata._ZTIN5boost6detail11thread_dataINS_3_bi6bind_tIvNS_4_mfi3mf0IvN14openni_wrapper9DeviceONIEEENS2_5list1INS2_5valueIPS7_EEEEEEEE[ZTIN5boost6detail11thread_dataINS_3_bi6bind_tIvNS_4_mfi3mf0IvN14openni_wrapper9DeviceONIEEENS2_5list1INS2_5valueIPS7_EEEEEEEE]+0x10): undefined reference to`typeinfo for boost::detail::thread_data_base'
collect2: error: ld returned 1 exit status
CMakeFiles/Logger.dir/build.make:472: recipe for target 'Logger' failed
make[2]: *
* [Logger] Error 1
CMakeFiles/Makefile2:60: recipe for target 'CMakeFiles/Logger.dir/all' failed
make[1]: *** [CMakeFiles/Logger.dir/all] Error 2
Makefile:76: recipe for target 'all' failed
make: *** [all] Error 2

@mp3guy
Copy link
Owner

mp3guy commented Dec 9, 2015

No idea why this is happening...

@mankoff
Copy link
Author

mankoff commented Dec 9, 2015

I followed the advice about libusb-1.0 but the error did not change at all.

@mp3guy
Copy link
Owner

mp3guy commented Dec 9, 2015

That is surprising, considering the error literally states I found those symbols in this library, try linking to it;

/lib/x86_64-linux-gnu/libusb-1.0.so.0: error adding symbols: DSO missing from command line

Have you definitely got libusb-1.0-dev installed?

@mankoff
Copy link
Author

mankoff commented Dec 9, 2015

Yes I was suprised too. Probably a stupid user error. I'm at a different computer and will report back in more detail later today or tomorrow.

@bugnix
Copy link

bugnix commented Dec 10, 2015

Ok, after a lot of trial and error I've got both errors fixed now.
Here is my changed CMakeLists.txt file, maybe it helps to resolve the issue.

cmake_minimum_required(VERSION 2.6.0)

find_package(ZLIB REQUIRED)
find_package(Qt4 REQUIRED)
find_package(OpenCV REQUIRED)
find_package(Boost COMPONENTS thread REQUIRED)
find_package(Boost COMPONENTS filesystem REQUIRED)
find_package(Boost COMPONENTS system REQUIRED)
find_package(Boost COMPONENTS date_time REQUIRED)
find_package(PkgConfig REQUIRED)
pkg_search_module(LIBUSB1 REQUIRED libusb-1.0)

include(FindOpenNI.cmake)

include(${QT_USE_FILE})

qt4_wrap_cpp(main_moc_SRCS
main.h)

IF (UNIX)
set(CMAKE_CXX_FLAGS "-O3 -msse2 -msse3")
ENDIF (UNIX)

include_directories(.
../OpenNI)

INCLUDE_DIRECTORIES(${LIBUSB1_INCLUDE_DIRS})
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR})
INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR})

set(Boost_USE_STATIC_LIBS OFF)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)
set(BOOST_ALL_DYN_LINK ON) # force dynamic linking for all libraries

add_executable(Logger
main.cpp
${main_moc_SRCS}
Logger.cpp
OpenNI/openni_driver.cpp
OpenNI/openni_device.cpp
OpenNI/openni_exception.cpp
OpenNI/openni_device_primesense.cpp
OpenNI/openni_device_kinect.cpp
OpenNI/openni_device_xtion.cpp
OpenNI/openni_device_oni.cpp
OpenNI/openni_image_yuv_422.cpp
OpenNI/openni_image_bayer_grbg.cpp
OpenNI/openni_image_rgb24.cpp
OpenNI/openni_ir_image.cpp
OpenNI/openni_depth_image.cpp
)

target_link_libraries(Logger
${ZLIB_LIBRARY}
${Boost_LIBRARIES}
${Boost_FILESYSTEM_LIBRARY}
${Boost_SYSTEM_LIBRARY}
${Boost_THREAD_LIBRARY}
${Boost_DATE_TIME_LIBRARY}
${OPENNI_LIBRARY}
${OpenCV_LIBS}
${LIBUSB1_LIBRARIES}
${QT_LIBRARIES})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants