2
votes

I instaled CLion as well as the Xcode command line tool but I still can't compile the simple "Hello, World!" code. How can I fix this? This is the error I'm getting:

/Applications/CLion.app/Contents/bin/cmake/bin/cmake -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - Unix Makefiles" /Users/JoshGarza/CLionProjects/untitled -- 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.7/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/JoshGarza/CLionProjects/untitled/cmake-build-debug/CMakeFiles/CMakeTmp

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

xcode-select: note: no developer tools were found at '/Applications/Xcode.app', requesting install. Choose an option in the dialog to download the command line developer tools.

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

[Previous CMake output restored: 4/2/17, 6:42 PM]

1
Even though you think you installed command line tools, you didn't. As evidenced by the line: "xcode-select: note: no developer tools were found at '/Applications/Xcode.app', requesting install. Choose an option in the dialog to download the command line developer tools."NonCreature0714

1 Answers

3
votes

xcode-select: note: no developer tools were found at '/Applications/Xcode.app', requesting install. Choose an option in the dialog to download the command line developer tools.

This error means that you have not installed the command line tools that are necessary to run code on CLion.

If you are using OS X 10.11 El Capitan, OS X 10.10 Yosemite, and OS X 10.9 and newer, then follow these steps to get the command line tools (CDT) without re-installing XCode again:

  • Open a Terminal window.
  • Type xcode-select --install
  • A dialog will appear telling you that it requires the command line developer tools, and asks if you would like to install them. Click on the "Install" button.

Source: How to Install CDT (Without Xcode)

If you have an older than the mentioned versions, then vist this site: