Fails to build with Boost 1.72
jbeich opened this issue · 3 comments
jbeich commented
Describe the Bug
Regressed by boostorg/filesystem@68ec5b1fb66b. From error log:
[100%] Linking CXX executable ../../bin/libcpp-hocon_test
ld: error: undefined symbol: typeinfo for boost::filesystem::filesystem_error
>>> referenced by parseable.cc
>>> ../CMakeFiles/libprojectsrc.dir/src/parseable.cc.o:(.data+0x0)
c++: error: linker command failed with exit code 1 (use -v to see invocation)
Expected Behavior
Builds fine
Steps to Reproduce
cmake .make
Environment
- Boost 1.72 snapshot (downstream)
- FreeBSD 12.1 amd64
Additional Context
Can be worked around by removing the following line
Line 94 in cdfa711
jbeich commented
@Lastique, do you have a clue?
$ nm -D --demangle boost-1.71.0/lib/libboost_filesystem.so | grep type.\*filesystem_error
00000000000190c8 V typeinfo for boost::filesystem::filesystem_error
00000000000073e0 V typeinfo name for boost::filesystem::filesystem_error
$ nm -D --demangle boost-1.72.alpha/lib/libboost_filesystem.so | grep type.\*filesystem_error
000000000001c0d0 D typeinfo for boost::filesystem::filesystem_error
0000000000007c44 R typeinfo name for boost::filesystem::filesystem_error
Lastique commented
No, not really. From nm output the necessary symbols are exported from libboost_filesystem.so. Maybe your libcpp-hocon_test executable doesn't link with it?
jbeich commented
Indeed. At first I've only tried passing libboost_filesystem.so manually which didn't help but after adding filesystem to find_package(Boost) line in CMakeLists.txt the error disappeared.