Skip to content

Boost.Test build with CMake misses boost::unit_test::unit_test_main on MacOS #483

@o01eg

Description

@o01eg

I'm trying to switch Boost from B2 to CMake. But after switch I got error:

Ld /Users/o01eg/projects/freeorion/build/Release/fo_unittest_util normal (in target 'fo_unittest_util' from project 'FreeOrion')
    cd /Users/o01eg/projects/freeorion
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -Xlinker -reproducible -target arm64-apple-macos10.15 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.2.sdk -O3 -L/Users/o01eg/projects/freeorion/build/build/EagerLinkingTBDs/Release -L/Users/o01eg/projects/freeorion/build/Release -F/Users/o01eg/projects/freeorion/build/build/EagerLinkingTBDs/Release -F/Users/o01eg/projects/freeorion/build/Release -filelist /Users/o01eg/projects/freeorion/build/build/fo_unittest_util.build/Release/Objects-normal/arm64/fo_unittest_util.LinkFileList -Xlinker -rpath -Xlinker @loader_path/../SharedSupport -Xlinker -rpath -Xlinker @loader_path/../Frameworks -Xlinker -dependency_info -Xlinker /Users/o01eg/projects/freeorion/build/build/fo_unittest_util.build/Release/Objects-normal/arm64/fo_unittest_util_dependency_info.dat -Wl,-search_paths_first -Wl,-headerpad_max_install_names /Users/o01eg/projects/freeorion/build/dep/lib/libboost_unit_test_framework.a -Xlinker -no_adhoc_codesign -o /Users/o01eg/projects/freeorion/build/Release/fo_unittest_util
Undefined symbols for architecture arm64:
  "boost::unit_test::unit_test_main(bool (*)(), int, char**)", referenced from:
      _main in main.o
ld: symbol(s) not found for architecture arm64
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
% nm /Users/o01eg/projects/freeorion/build/dep/lib/libboost_unit_test_framework.a | grep main
                 U __ZTISt12domain_error
unit_test_main.cpp.o:
00000000000032f8 s __GLOBAL__sub_I_unit_test_main.cpp
0000000000000000 T __ZN5boost9unit_test14unit_test_mainEPFPNS0_10test_suiteEiPPcEiS4_
0000000000000704 T _main

Boost version is 1.88.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions