views:

3095

answers:

1
+10  A: 

On linux CMake figures itself that boost_filesystem is linked against boost_system. Obviously you have to tell it explicitly on Mac:

find_package(Boost COMPONENTS system filesystem REQUIRED)
#...
target_link_libraries(mytarget 
  ${Boost_FILESYSTEM_LIBRARY}
  ${Boost_SYSTEM_LIBRARY}
)
Maik Beckmann
This is bizarre. On Linux, boost.filesystem dynamic library refers to boost.system library, so no explicit linking to boost.system is necessary. Any idea why this is not happening here?
Vladimir Prus
You are rigth, ldd libboost_filesystem.so lists libboost_system.so (0x00007fcd31e67000). AFAIK on Mac "otool -L" is the equivalent to ldd, but I have no Mac around. Should we bring up this at the boost ML?
Maik Beckmann