No compiler detected configuring Visual Studio toolchain

I have installed Visual Studio 2019 Build Tools with C++ build tools as shown below:

  

But when I try to configure the CLion ToolChain, it can find "make", but it can not find the compilers. It says "Not found, please install this package" 

I have also installed Visual Studio 2019 Community Edition with C++ packages and  when I select it, CLion says the same:

Thank you very much for your help.

0
8 comments

Hello!

Please click "more..." near the "Test CMake run finished with errors" message and provide the entire text.

0

Hello Anna Falevskaya!!!

Thank you very much for your help. This is the error message:

CMake Error at C:/Program Files/JetBrains/CLion 2020.1.2/bin/cmake/win/share/cmake-3.17/Modules/CMakeDetermineCCompiler.cmake:49 (message):
Could not find compiler set in environment variable CC:

d:\Tools\C\MinGW\bin\mingw32-gcc.exe.
Call Stack (most recent call first):
CMakeLists.txt:1 (project)


CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
See also "C:/Users/Libernys/AppData/Local/Temp/cmake_check_environment/_build3197165650585776549/CMakeFiles/CMakeOutput.log".

Error code: 1

But with that error, MinGW works fine.

0

Finally, I have CLion working with Visual Studio 2019 build tools. Even when it is not capable to detect the compiler, I wrote "cl" that is the name of the compiler and it works. This is the configuration:

It is important to note that if I write the complete path to the compiler it does not work.  

0

The situation is very strange. Please remove your MSVC toolchain, create it once again (don't fill the C/C++ compiler fields), make it a default toolchain (put on the top of the toolchain list), apply changes and after that send the idea.log file (`Help | Show Log in ...`) to clion-support at jetbrains.com. Note that logs might contain private user's information (like file paths and names). 

Please also send CMakeOutput.log and CMakeError.log from the cmake-build-debug folder.

0

Thank you very much Anna Falevskaya for your concern to help me.

This is what I did, I delete my working configuration explained above writing just “cl” in the compilers edits.

When I add a new Visual Studio toolchain by default it detects the Environment at

C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools

And it detects Make at

C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.27.29110\bin\Hostx86\x86\nmake.exe

But it does not detect the compiler

If I set the compilers by hand at

C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.27.29110\bin\Hostx86\x86\cl.exe it works.

But if I set Make and compiler by hands in the x64 folder as shown below it does not work.

I understand that maybe it is because it selects Architecture x86 by default. Anyway, If I select the x64 Make and set “cl” as compiler it works.

0

>I understand that maybe it is because it selects Architecture x86 by default

Indeed it's because of that. If you want to use x64 compilers and x64 nmake, please select amd64 in the Architecture field.

If you want to investigate why the compilers are not detected by CLion, I kindly ask you to do exactly the following: 

Please remove your MSVC toolchain, create it once again (don't fill the C/C++ compiler fields), make it a default toolchain (put on the top of the toolchain list), click "OK", wait till the project is reloaded and after that send the idea.log file (`Help | Show Log in ...`) to clion-support at jetbrains.com. Note that logs might contain private user's information (like file paths and names). Please also send CMakeOutput.log and CMakeError.log from the cmake-build-debug folder.

Please don't set compilers or change anything in the toolchain settings before sending the requested materials. And please send the materials in an email to clion-support at jetbrains.com as I asked, because it's very hard to read logs as forum comments. 

0

I'm sorry, I will do it exactly as you are asking.

0

As you say if I set amd64 it detects the nmake of x64. Anyway, it does not detect the compiler automatically. I set the compiler manually and it works.

Thank you for your help.

0

Please sign in to leave a comment.