After updating to Big Sur, I am unable to compile anything with cmake. I re-installed the command line tools (
xcode-select --install) and updated cmake (
brew upgrade cmake). When running
cmake -S ./ -B ./bin -G "Unix Makefiles" i get the output:
-- The C compiler identification is AppleClang 22.214.171.12400032 -- The CXX compiler identification is AppleClang 126.96.36.19900032 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - failed -- Check for working C compiler: /usr/bin/clang -- Check for working C compiler: /usr/bin/clang - broken CMake Error at /usr/local/Cellar/cmake/3.19.3/share/cmake/Modules/CMakeTestCCompiler.cmake:66 (message): The C compiler "/usr/bin/clang" is not able to compile a simple test program. It fails with the following output: /usr/bin/clang -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk -o CMakeFiles/cmTC_b5a37.dir/testCCompiler.c.o -c /Users/harniver/Git/aggregate/fcpp/fcpp/bin/CMakeFiles/CMakeTmp/testCCompiler.c /usr/bin/clang -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names -static CMakeFiles/cmTC_b5a37.dir/testCCompiler.c.o -o cmTC_b5a37 ld: library not found for -lcrt0.o clang: error: linker command failed with exit code 1 (use -v to see invocation)
In other projects I get similar error except that the missing library is something else (
-lSystem, for example). Any ideas on what may be going wrong?