Error with CLion on 10.14.5

已回答

I get this error when I create a new project or open an existing one:

 

/Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - Unix Makefiles" /Users/jackson/IQ/C++/first
CMake Error at /Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/CMakeCompilerIdDetection.cmake:111 (message):
No preprocessor test for "Bruce"
Call Stack (most recent call first):
/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/CMakeDetermineCompilerId.cmake:151 (compiler_id_detection)
/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/CMakeDetermineCompilerId.cmake:170 (CMAKE_DETERMINE_COMPILER_ID_WRITE)
/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/CMakeDetermineCompilerId.cmake:31 (CMAKE_DETERMINE_COMPILER_ID_BUILD)
/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/CMakeDetermineCCompiler.cmake:113 (CMAKE_DETERMINE_COMPILER_ID)
CMakeLists.txt:2 (project)


CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
See also "/Users/jackson/IQ/C++/first/cmake-build-debug/CMakeFiles/CMakeOutput.log".

[Finished]

 

I have tried reinstalling the command line tools, but I got the same results

0

Hi! Please provide a screenshot of Preferences | Build, Execution, Deployment | Toolchains.

0

Please close all projects (File | Close Project), then in Terminal do sudo xcode-select -switch /Library/Developer/CommandLineTools/, after that in CLion create a new project (on the Welcome screen choose New Project, choose C++ Executable, click Create). Does it work?

0

Unfortunately this did not work. I am still getting the same error

0

Please send a new screenshot of Preferences | Build, Execution, Deployment | Toolchains, CMakeOutput.log and CMakeError.log from /Users/jackson/IQ/C++/first/cmake-build-debug/CMakeFiles/, and the entire output from the CMake tool window to clion-support at jetbrains.com.

 

0

CMakeOutput.log:

 

The system is: Darwin - 18.6.0 - x86_64

 

There is no CMakeError.log, but this is the clion-log.txt:

/Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - Unix Makefiles" /Users/jackson/IQ/C++/first
CMake Error at /Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/CMakeCompilerIdDetection.cmake:111 (message):
No preprocessor test for "Bruce"
Call Stack (most recent call first):
/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/CMakeDetermineCompilerId.cmake:151 (compiler_id_detection)
/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/CMakeDetermineCompilerId.cmake:170 (CMAKE_DETERMINE_COMPILER_ID_WRITE)
/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/CMakeDetermineCompilerId.cmake:31 (CMAKE_DETERMINE_COMPILER_ID_BUILD)
/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/CMakeDetermineCCompiler.cmake:113 (CMAKE_DETERMINE_COMPILER_ID)
CMakeLists.txt:2 (project)


CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
See also "/Users/jackson/IQ/C++/first/cmake-build-debug/CMakeFiles/CMakeOutput.log".

 

0

This is the CMakeCache.txt:

 

# This is the CMakeCache file.
# For build in directory: /Users/jackson/IQ/C++/first/cmake-build-debug
# It was generated by CMake: /Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake
# You can edit this file to change values found and used by cmake.
# If you do not want to change any of the values, simply exit the editor.
# If you do want to change a value, simply edit, save, and exit the editor.
# The syntax for the file is as follows:
# KEY:TYPE=VALUE
# KEY is the name of a variable in the cache.
# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!.
# VALUE is the current value for the KEY.

########################
# EXTERNAL cache entries
########################

//No help, variable specified on the command line.
CMAKE_BUILD_TYPE:UNINITIALIZED=Debug

//C compiler
CMAKE_C_COMPILER:FILEPATH=/Library/Developer/CommandLineTools/usr/bin/cc

//Path to a program.
CMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/make

//Build architectures for OSX
CMAKE_OSX_ARCHITECTURES:STRING=

//Minimum OS X version to target for deployment (at runtime); newer
// APIs weak linked. Set to empty string for default value.
CMAKE_OSX_DEPLOYMENT_TARGET:STRING=

//The product will be built against the headers and libraries located
// inside the indicated SDK.
CMAKE_OSX_SYSROOT:PATH=/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk

//Value Computed by CMake
CMAKE_PROJECT_DESCRIPTION:STATIC=

//Value Computed by CMake
CMAKE_PROJECT_HOMEPAGE_URL:STATIC=

//Value Computed by CMake
CMAKE_PROJECT_NAME:STATIC=first

//Value Computed by CMake
first_BINARY_DIR:STATIC=/Users/jackson/IQ/C++/first/cmake-build-debug

//Value Computed by CMake
first_SOURCE_DIR:STATIC=/Users/jackson/IQ/C++/first

//Path to a file.
src_in:FILEPATH=/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/CMakeCCompilerId.c.in


########################
# INTERNAL cache entries
########################

//This is the directory where this CMakeCache.txt was created
CMAKE_CACHEFILE_DIR:INTERNAL=/Users/jackson/IQ/C++/first/cmake-build-debug
//Major version of cmake used to create the current loaded cache
CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3
//Minor version of cmake used to create the current loaded cache
CMAKE_CACHE_MINOR_VERSION:INTERNAL=14
//Patch version of cmake used to create the current loaded cache
CMAKE_CACHE_PATCH_VERSION:INTERNAL=5
//Path to CMake executable.
CMAKE_COMMAND:INTERNAL=/Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake
//Path to cpack program executable.
CMAKE_CPACK_COMMAND:INTERNAL=/Applications/CLion.app/Contents/bin/cmake/mac/bin/cpack
//Path to ctest program executable.
CMAKE_CTEST_COMMAND:INTERNAL=/Applications/CLion.app/Contents/bin/cmake/mac/bin/ctest
//ADVANCED property for variable: CMAKE_C_COMPILER
CMAKE_C_COMPILER-ADVANCED:INTERNAL=1
//Name of external makefile project generator.
CMAKE_EXTRA_GENERATOR:INTERNAL=CodeBlocks
//Name of generator.
CMAKE_GENERATOR:INTERNAL=Unix Makefiles
//Generator instance identifier.
CMAKE_GENERATOR_INSTANCE:INTERNAL=
//Name of generator platform.
CMAKE_GENERATOR_PLATFORM:INTERNAL=
//Name of generator toolset.
CMAKE_GENERATOR_TOOLSET:INTERNAL=
//Source directory with the top level CMakeLists.txt file for this
// project
CMAKE_HOME_DIRECTORY:INTERNAL=/Users/jackson/IQ/C++/first
//ADVANCED property for variable: CMAKE_MAKE_PROGRAM
CMAKE_MAKE_PROGRAM-ADVANCED:INTERNAL=1
//number of local generators
CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=1
//Platform information initialized
CMAKE_PLATFORM_INFO_INITIALIZED:INTERNAL=1
//Path to CMake installation.
CMAKE_ROOT:INTERNAL=/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14
//uname command
CMAKE_UNAME:INTERNAL=/usr/bin/uname

 

0

Do you have /Library/Developer/CommandLineTools/usr/bin/c++?

0

Yes the c++ is present. I check that a while back.

I was able to fix this problem by removing CLion from the Applications folder and then re-downloading it from the site and installing it. Something must have gotten messed up with one of the upgrades. It used to work and then one day it stopped, probably after one of the updates.

0

Thanks for letting us know.

0

请先登录再写评论。