1 click let cmake detect
View error message:
/Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - Unix Makefiles" /Users/apple/CLionProjects/untitled16
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc - broken
CMake Error at /Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.17/Modules/CMakeTestCCompiler.cmake:60 (message):
The C compiler
"/usr/bin/cc"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: /Users/apple/CLionProjects/untitled16/cmake-build-debug/CMakeFiles/CMakeTmp
Run Build Command(s):xxxx(can not find /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/numpy/core/include:)
2 view environment variables
cd ~
vim .bash_profile
It is found that the error path is cflags (I wonder why I set cflags to be a python library?) Solution: comment out this line of code. Result: Although there is no error message in red in this interface, the program still cannot be compiled
Replace c compiler [key to solving the problem]
View all gcc compiler paths
brew list gcc
/usr/local/Cellar/gcc/11.2.0/bin/c++-11
/usr/local/Cellar/gcc/11.2.0/bin/cpp-11
/usr/local/Cellar/gcc/11.2.0/bin/g++-11
/usr/local/Cellar/gcc/11.2.0/bin/gcc-11
/usr/local/Cellar/gcc/11.2.0/bin/gcc-ar-11
/usr/local/Cellar/gcc/11.2.0/bin/gcc-nm-11
/usr/local/Cellar/gcc/11.2.0/bin/gcc-ranlib-11
/usr/local/Cellar/gcc/11.2.0/bin/gcov-11
/usr/local/Cellar/gcc/11.2.0/bin/gcov-dump-11
/usr/local/Cellar/gcc/11.2.0/bin/gcov-tool-11
/usr/local/Cellar/gcc/11.2.0/bin/gdc
/usr/local/Cellar/gcc/11.2.0/bin/gdc-11
/usr/local/Cellar/gcc/11.2.0/bin/gfortran
/usr/local/Cellar/gcc/11.2.0/bin/gfortran-11
/usr/local/Cellar/gcc/11.2.0/bin/lto-dump-11
/usr/local/Cellar/gcc/11.2.0/bin/x86_64-apple-darwin20-c++-11
/usr/local/Cellar/gcc/11.2.0/bin/x86_64-apple-darwin20-g++-11
/usr/local/Cellar/gcc/11.2.0/bin/x86_64-apple-darwin20-gcc-11
/usr/local/Cellar/gcc/11.2.0/bin/x86_64-apple-darwin20-gcc-11.2.0
/usr/local/Cellar/gcc/11.2.0/bin/x86_64-apple-darwin20-gcc-ar-11
/usr/local/Cellar/gcc/11.2.0/bin/x86_64-apple-darwin20-gcc-nm-11
/usr/local/Cellar/gcc/11.2.0/bin/x86_64-apple-darwin20-gcc-ranlib-11
/usr/local/Cellar/gcc/11.2.0/bin/x86_64-apple-darwin20-gdc-11
/usr/local/Cellar/gcc/11.2.0/bin/x86_64-apple-darwin20-gfortran-11
/usr/local/Cellar/gcc/11.2.0/include/c++/ (796 files)
/usr/local/Cellar/gcc/11.2.0/lib/gcc/ (1304 files)
/usr/local/Cellar/gcc/11.2.0/libexec/gcc/ (15 files)
/usr/local/Cellar/gcc/11.2.0/share/gcc-11.2.0/ (4 files)
/usr/local/Cellar/gcc/11.2.0/share/man/ (12 files)
C compiler and C + + compiler use respectively:
/usr/local/Cellar/gcc/11.2.0/bin/gcc-11
/usr/local/Cellar/gcc/11.2.0/bin/g++-11
After selection, Clion automatically compiles and succeeds.
Read More:
- [Solved] Execute ./configure Error: [error]configure: error: You need a C++ compiler for C++ support.
- [Solved] configure: error: no acceptable C compiler found in $PATH
- [Solved] configure:error:no acceptable C compiler found in $PATH
- [Solved] Centos7 Error: gcc: configure: error: in build‘: configure: error: no acceptable C compiler found in $PATH
- error: C compiler cannot create executables [How to Solve]
- Sublime text 3 compiles and executes C/C++ programs directly
- Linux Error: CMake Error in CMakeLists.txt: No CMAKE_CXX_COMPILER could be found.
- [Solved] Ubuntu Eclipse C/C++ Error: launch failed.binary not found
- [Solved] Linux C++ warning: ISO C++ forbids converting a string constant to ‘char*‘ [-Wwrite-strings]
- [Solved] Jetson Nano catkin_make Error: internal compiler error
- [Solved] SSH WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!
- linux C called object ‘maze’ is not a function or function pointer printf(“%d\t“, maze(i, j))
- [Solved] Linux error: SSH_exchange_identification: read: Connection reset by peer
- [Solved] SSH connect Error: “WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED“
- [SSH error] ssh_exchange_identification: read: Connection reset by peer
- C# WPF Framework: How to Build Caliburn.Micro Quickly
- Vector series in actual C + +_ To_ fit()
- C++ Compile Error: ld returned 1 exit status [How to Solve]
- [Solved] C++: fatal error: Killed signal terminated program cc1plus
- Enter passphrase for key ‘/c/Users/**/.ssh/id_rsa‘ [How to Solve]