[FATAL ERROR]The C compiler "/usr/bin/cc" is not able to compile a simple test program.

Answered

Hello, 

I just downloaded CLion for a school assignment, on boot I receive this error;

/Applications/CLion.app/Contents/bin/cmake/bin/cmake -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - Unix Makefiles" /Users/uses/CLionProjects/Lab11a
-- 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/share/cmake-3.8/Modules/CMakeTestCCompiler.cmake:51 (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/uses/CLionProjects/Lab11a/cmake-build-debug/CMakeFiles/CMakeTmp

 

Run Build Command:"/usr/bin/make" "cmTC_96ffa/fast"

xcrun: error: invalid active developer path
(/Library/Developer/CommandLineTools), missing xcrun at:
/Library/Developer/CommandLineTools/usr/bin/xcrun

 

 

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/uses/CLionProjects/Lab11a/cmake-build-debug/CMakeFiles/CMakeOutput.log".
See also "/Users/uses/CLionProjects/Lab11a/cmake-build-debug/CMakeFiles/CMakeError.log".

[Finished]"

That was the entire reading from the "CMake" section near the bottom of the screen. 

Any solutions or information would be appreciated 

0
7 comments
Avatar
Permanently deleted user

Inside of "/Users/uses/CLionProjects/Lab11a/cmake-build-debug/CMakeFiles/CMakeOutput.log";

Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: /usr/bin/cc
Build flags:
Id flags:

The output was:
1
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun


Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: /usr/bin/cc
Build flags:
Id flags: -c

The output was:
1
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun


Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: /usr/bin/cc
Build flags:
Id flags: -Aa

The output was:
1
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun


Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: /usr/bin/cc
Build flags:
Id flags: -D__CLASSIC_C__

The output was:
1
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun


Checking whether the C compiler is IAR using "" did not match "IAR .+ Compiler":
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: /usr/bin/c++
Build flags:
Id flags:

The output was:
1
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: /usr/bin/c++
Build flags:
Id flags: -c

The output was:
1
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun


Checking whether the CXX compiler is IAR using "" did not match "IAR .+ Compiler":
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
Determining if the C compiler works failed with the following output:
Change Dir: /Users/uses/CLionProjects/Lab11a/cmake-build-debug/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_96ffa/fast"
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun"

 

 

 

0
Avatar
Permanently deleted user

Inside of "/Users/uses/CLionProjects/Lab11a/cmake-build-debug/CMakeFiles/CMakeOutput.log";

Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: /usr/bin/cc
Build flags:
Id flags:

The output was:
1
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun


Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: /usr/bin/cc
Build flags:
Id flags: -c

The output was:
1
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun


Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: /usr/bin/cc
Build flags:
Id flags: -Aa

The output was:
1
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun


Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: /usr/bin/cc
Build flags:
Id flags: -D__CLASSIC_C__

The output was:
1
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun


Checking whether the C compiler is IAR using "" did not match "IAR .+ Compiler":
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: /usr/bin/c++
Build flags:
Id flags:

The output was:
1
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: /usr/bin/c++
Build flags:
Id flags: -c

The output was:
1
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun


Checking whether the CXX compiler is IAR using "" did not match "IAR .+ Compiler":
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
Determining if the C compiler works failed with the following output:
Change Dir: /Users/uses/CLionProjects/Lab11a/cmake-build-debug/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_96ffa/fast"
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun"

 

 

 

0

Hi! 

Do you have GCC/G++ or Clang installed on your machine? 

Please provide us with the screenshot of the Preferences | Build, Execution, Deployment | Toolchains.

0

Hi, Alex! Please try executing xcode-select --install in the terminal, it should help.

0
Avatar
Permanently deleted user

I get

-- 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.13/Modules/CMakeTestCCompiler.cmake:52 (message):
The C compiler

"/usr/bin/cc"

is not able to compile a simple test program.

It fails with the following output:

Change Dir: /private/var/folders/mf/dyrm716117x1fdks6tpvk3b00000gn/T/cmake_check_environment/_build6647719633719648259/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_cefc3/fast"
dyld: Symbol not found: _OBJC_IVAR_$_NSTextViewIvars.sharedData
Referenced from: /Applications/Xcode.app/Contents/SharedFrameworks/DVTDocumentation.framework/Versions/A/../../../../SharedFrameworks/DVTKit.framework/Versions/A/DVTKit
Expected in: /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
in /Applications/Xcode.app/Contents/SharedFrameworks/DVTDocumentation.framework/Versions/A/../../../../SharedFrameworks/DVTKit.framework/Versions/A/DVTKit
make: error: unable to locate xcodebuild, please make sure the path to the Xcode folder is set correctly!
make: error: You can set the path to the Xcode folder using /usr/bin/xcode-select -switch

 

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


-- Configuring incomplete, errors occurred!
See also "/private/var/folders/mf/dyrm716117x1fdks6tpvk3b00000gn/T/cmake_check_environment/_build6647719633719648259/CMakeFiles/CMakeOutput.log".
See also "/private/var/folders/mf/dyrm716117x1fdks6tpvk3b00000gn/T/cmake_check_environment/_build6647719633719648259/CMakeFiles/CMakeError.log".

Error code: 1

Installed developer tools ran xcode-select --install from the terminal. Any help is appreciated

0

The Travishorstman's question was resolved via email, but I paste the solution here too:

setting the path to the Xcode folder in the Terminal (sudo xcode-select -switch /Library/Developer/CommandLineTools/) helped.

0
Avatar
Permanently deleted user

/home/miranda/Descargas/clion-2019.2/bin/cmake/linux/bin/cmake -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - Unix Makefiles" /home/miranda/CLionProjects/untitled2
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:2 (project):
No CMAKE_C_COMPILER could be found.

Tell CMake where to find the compiler by setting either the environment
variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
the compiler, or to the compiler name if it is in the PATH.


CMake Error at CMakeLists.txt:2 (project):
No CMAKE_CXX_COMPILER could be found.

Tell CMake where to find the compiler by setting either the environment
variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
to the compiler, or to the compiler name if it is in the PATH.


-- Configuring incomplete, errors occurred!
See also "/home/miranda/CLionProjects/untitled2/cmake-build-debug/CMakeFiles/CMakeOutput.log".
See also "/home/miranda/CLionProjects/untitled2/cmake-build-debug/CMakeFiles/CMakeError.log".

[Failed to reload]

0

Please sign in to leave a comment.