MantisBT - CMake
View Issue Details
0014986CMakeModulespublic2014-06-23 10:542016-06-10 14:31
mband 
Kitware Robot 
normalmajoralways
closedmoved 
x86_64Ubuntu14.04
CMake 3.0 
 
0014986: FindBoost with component thread does not properly link with boost_system
When just finding the thread component of Boost it appears that one also has to link with boost_system. From the Boost documentation it looks like this change was introduced with version 1.52 (see http://www.boost.org/doc/libs/1_52_0/doc/html/thread/build.html [^]).
FIND_PACKAGE(Boost COMPONENTS thread)
target_link_libraries(my_target ${Boost_LIBRARIES})

Resulting in a linker error like the following:
/usr/bin/ld: CMakeFiles/<something>.dir/<something>.o: undefined reference to symbol '_ZN5boost6system15system_categoryEv'
//usr/lib/x86_64-linux-gnu/libboost_system.so.1.54.0: error adding symbols: DSO missing from command line

Linking with boost_system (i.e. -lboost_system or target_link_libraries(my_target boost_system)) solves the issue, but it should be done automatically when finding the thread component of Boost.
No tags attached.
Issue History
2014-06-23 10:54mbandNew Issue
2014-06-23 11:28Brad KingNote Added: 0036234
2014-06-23 11:28Brad KingStatusnew => backlog
2014-06-23 11:28Brad KingProduct VersionCMake 2.8.12.2 => CMake 3.0
2016-06-10 14:29Kitware RobotNote Added: 0042570
2016-06-10 14:29Kitware RobotStatusbacklog => resolved
2016-06-10 14:29Kitware RobotResolutionopen => moved
2016-06-10 14:29Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0036234)
Brad King   
2014-06-23 11:28   
AFAICT, FindBoost does not encode any of the Boost library dependencies nor does the documentation claim so.
(0042570)
Kitware Robot   
2016-06-10 14:29   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.