Trying to create a .cpp file tells me my compiler is broken

已回答

I really like the IDE and wouldn't want to change. I'm just starting, and before it didn't give me any error until now. Please help.I can't run any code.



/Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -G "CodeBlocks - Unix Makefiles" /Users/Pablo/Desktop/ITC/Semestre_3/EstructuraDatos/prueba
-- The C compiler identification is Clang 4.0.1
-- The CXX compiler identification is AppleClang 11.0.3.11030032
-- Check for working C compiler: /Users/Pablo/opt/anaconda3/bin/x86_64-apple-darwin13.4.0-clang
-- Check for working C compiler: /Users/Pablo/opt/anaconda3/bin/x86_64-apple-darwin13.4.0-clang - broken
CMake Error at /Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.17/Modules/CMakeTestCCompiler.cmake:60 (message):
The C compiler

"/Users/Pablo/opt/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/Pablo/Desktop/ITC/Semestre_3/EstructuraDatos/prueba/cmake-build-debug/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make cmTC_3e6e4/fast && /Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_3e6e4.dir/build.make CMakeFiles/cmTC_3e6e4.dir/build
Building C object CMakeFiles/cmTC_3e6e4.dir/testCCompiler.c.o
/Users/Pablo/opt/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_3e6e4.dir/testCCompiler.c.o -c /Users/Pablo/Desktop/ITC/Semestre_3/EstructuraDatos/prueba/cmake-build-debug/CMakeFiles/CMakeTmp/testCCompiler.c
Linking C executable cmTC_3e6e4
/Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake -E cmake_link_script CMakeFiles/cmTC_3e6e4.dir/link.txt --verbose=1
/Users/Pablo/opt/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_3e6e4.dir/testCCompiler.c.o -o cmTC_3e6e4
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_3e6e4] Error 1
make: *** [cmTC_3e6e4/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/Pablo/Desktop/ITC/Semestre_3/EstructuraDatos/prueba/cmake-build-debug/CMakeFiles/CMakeOutput.log".
See also "/Users/Pablo/Desktop/ITC/Semestre_3/EstructuraDatos/prueba/cmake-build-debug/CMakeFiles/CMakeError.log".

[Failed to reload]
0

Hello!

You need to install Xcode command line developer tools - https://www.jetbrains.com/help/clion/quick-tutorial-on-configuring-clion-on-macos.html#reqtools.

Then open Preferences | Build, Execution, Deployment | Toolchains and specify /usr/bin/make in the Make field, /Library/Developer/CommandLineTools/usr/bin/cc in the C compiler field, /Library/Developer/CommandLineTools/usr/bin/c++ in the C++ compiler field.

0

请先登录再写评论。