futureneer / openni2-tracker

A ROS Wrapper for the OpenNI2 and NiTE2 Skeleton Tracker
13 stars 35 forks source link

undefined reference to symbol '_ZN5boost6system15system_categoryEv' #7

Closed whitecoffee closed 6 years ago

whitecoffee commented 6 years ago

When I run rosmake I got

[ 88%] Linking CXX executable ../bin/tracker
  /usr/bin/ld: CMakeFiles/tracker.dir/src/tracker.cpp.o: undefined reference to symbol '_ZN5boost6system15system_categoryEv'
  /usr/lib/x86_64-linux-gnu/libboost_system.so: error adding symbols: DSO missing from command line

I realize the FALG -lboost_system must be added in CMakeList. But I don't know where to add in this case...

whitecoffee commented 6 years ago

I fix it when I add following code `set(Boost_USE_STATIC_LIBS OFF) set(Boost_USE_MULTITHREADED ON) set(Boost_USE_STATIC_RUNTIME OFF) find_package(Boost 1.45.0 COMPONENTS filesystem regex)

rosbuild_add_executable(tracker src/tracker.cpp) target_link_libraries(tracker OpenNI2 NiTE2 Boost::filesystem Boost::regex)`