Skip to content

Linker errors on OSX with clang++-22 #191

@ClausKlein

Description

@ClausKlein
bash-5.3$ pwd
/Users/clausklein/Workspace/cpp/beman-project/utf_view
bash-5.3$ cmake --preset llvm-release --log-level=VERBOSE --fresh 
Preset CMake variables:

  CMAKE_BUILD_TYPE="RelWithDebInfo"
  CMAKE_CXX_STANDARD="23"
  CMAKE_EXPORT_COMPILE_COMMANDS="ON"
  CMAKE_PROJECT_TOP_LEVEL_INCLUDES="./infra/cmake/use-fetch-content.cmake"
  CMAKE_TOOLCHAIN_FILE="infra/cmake/llvm-toolchain.cmake"

-- The CXX compiler identification is Clang 22.1.1
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/local/Cellar/llvm/22.1.1/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
Examples to be built: readme_examples;null_term_argv_environ
-- Configuring done (7.2s)
-- Generating done (0.1s)
-- Build files have been written to: /Users/clausklein/Workspace/cpp/beman-project/utf_view/build/llvm-release

bash-5.3$ cmake --build --preset llvm-release 
[1/3] Linking CXX executable examples/beman.utf_view.examples.null_term_argv_environ
FAILED: [code=1] examples/beman.utf_view.examples.null_term_argv_environ 
: && /usr/local/Cellar/llvm/22.1.1/bin/clang++ -O3  -O2 -g -DNDEBUG -Wl,-search_paths_first -Wl,-headerpad_max_install_names examples/CMakeFiles/beman.utf_view.examples.null_term_argv_environ.dir/null_term_argv_environ.cpp.o -o examples/beman.utf_view.examples.null_term_argv_environ  src/beman/utf_view/libbeman.utf_view.a  _deps/transform_view-build/src/beman/transform_view/libbeman.transform_view.a && :
ld: archive member '/' not a mach-o file in '/Users/clausklein/Workspace/cpp/beman-project/utf_view/build/llvm-release/src/beman/utf_view/libbeman.utf_view.a'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
[2/3] Linking CXX executable examples/beman.utf_view.examples.readme_examples
FAILED: [code=1] examples/beman.utf_view.examples.readme_examples 
: && /usr/local/Cellar/llvm/22.1.1/bin/clang++ -O3  -O2 -g -DNDEBUG -Wl,-search_paths_first -Wl,-headerpad_max_install_names examples/CMakeFiles/beman.utf_view.examples.readme_examples.dir/readme_examples.cpp.o -o examples/beman.utf_view.examples.readme_examples  src/beman/utf_view/libbeman.utf_view.a  _deps/transform_view-build/src/beman/transform_view/libbeman.transform_view.a && :
ld: archive member '/' not a mach-o file in '/Users/clausklein/Workspace/cpp/beman-project/utf_view/build/llvm-release/src/beman/utf_view/libbeman.utf_view.a'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
[3/3] Linking CXX executable tests/beman/utf_view/beman_utf_view_test
FAILED: [code=1] tests/beman/utf_view/beman_utf_view_test 
: && /usr/local/Cellar/llvm/22.1.1/bin/clang++ -O3  -O2 -g -DNDEBUG -Wl,-search_paths_first -Wl,-headerpad_max_install_names tests/beman/utf_view/CMakeFiles/beman_utf_view_test.dir/main.t.cpp.o -o tests/beman/utf_view/beman_utf_view_test  -Xlinker -force_load -Xlinker tests/beman/utf_view/libbeman_utf_view_test_lib.a  src/beman/utf_view/libbeman.utf_view.a  _deps/transform_view-build/src/beman/transform_view/libbeman.transform_view.a && :
ld: archive member '/' not a mach-o file in '/Users/clausklein/Workspace/cpp/beman-project/utf_view/build/llvm-release/src/beman/utf_view/libbeman.utf_view.a'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
bash-5.3$ gvim CMakePresets.json 
bash-5.3$ 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions