ошибка после команды "cmake -DCMAKE_BUILD_TYPE = Release .." - PullRequest
0 голосов
/ 05 апреля 2020

Раньше это работало, но теперь возникает ошибка:

MacBook-Pro-Ars:task1_src ars$ cd build
(base) MacBook-Pro-Ars:build ars$ cmake -DCMAKE_BUILD_TYPE=Release ..
-- The C compiler identification is Clang 4.0.1
-- The CXX compiler identification is Clang 4.0.1
-- Check for working C compiler: /Users/ars/anaconda3/bin/x86_64-apple-darwin13.4.0-clang
-- Check for working C compiler: /Users/ars/anaconda3/bin/x86_64-apple-darwin13.4.0-clang -- broken
CMake Error at /usr/local/Cellar/cmake/3.16.1/share/cmake/Modules/CMakeTestCCompiler.cmake:60 (message):
  The C compiler

    "/Users/ars/anaconda3/bin/x86_64-apple-darwin13.4.0-clang"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /Users/ars/Downloads/помощь/task1_src/build/CMakeFiles/CMakeTmp

    Run Build Command(s):/usr/bin/make cmTC_fee8b/fast && /Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_fee8b.dir/build.make CMakeFiles/cmTC_fee8b.dir/build
    Building C object CMakeFiles/cmTC_fee8b.dir/testCCompiler.c.o
    /Users/ars/anaconda3/bin/x86_64-apple-darwin13.4.0-clang   -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe  -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk   -o CMakeFiles/cmTC_fee8b.dir/testCCompiler.c.o   -c /Users/ars/Downloads/помощь/task1_src/build/CMakeFiles/CMakeTmp/testCCompiler.c
    Linking C executable cmTC_fee8b
    /usr/local/Cellar/cmake/3.16.1/bin/cmake -E cmake_link_script CMakeFiles/cmTC_fee8b.dir/link.txt --verbose=1
    /Users/ars/anaconda3/bin/x86_64-apple-darwin13.4.0-clang -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe  -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names -Wl,-pie -Wl,-headerpad_max_install_names -Wl,-dead_strip_dylibs  CMakeFiles/cmTC_fee8b.dir/testCCompiler.c.o  -o cmTC_fee8b 
    ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd, file was built for unsupported file format ( 0x2D 0x2D 0x2D 0x20 0x21 0x74 0x61 0x70 0x69 0x2D 0x74 0x62 0x64 0x2D 0x76 0x33 ) which is not the architecture being linked (x86_64): /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd
    ld: dynamic main executables must link with libSystem.dylib for architecture x86_64
    clang-4.0: error: linker command failed with exit code 1 (use -v to see invocation)
    make[1]: *** [cmTC_fee8b] Error 1
    make: *** [cmTC_fee8b/fast] Error 2





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:2 (project)


-- Configuring incomplete, errors occurred!
See also "/Users/ars/Downloads/помощь/task1_src/build/CMakeFiles/CMakeOutput.log".
See also "/Users/ars/Downloads/помощь/task1_src/build/CMakeFiles/CMakeError.log".

Возможно, раньше был другой компилятор C. Я проверил старый CMakeCache.txt и нашел эту строку:

CMAKE_CXX_COMPILER:FILEPATH=/Library/Developer/CommandLineTools/usr/bin/c++

Но в новом CMakeCache все иначе:

CMAKE_CXX_COMPILER:FILEPATH=/Users/ars/anaconda3/bin/x86_64-apple-darwin13.4.0-clang++

Помогите, пожалуйста

...