I have been having problems with going through cmake tutorials as I always get failures when invoking
Cmake build
Or
Cmake –system-information
– Building for: Visual Studio 17 2022
CMake Error at CMakeLists.txt:6 (project):
No CMAKE_C_COMPILER could be found.
CMake Error at CMakeLists.txt:6 (project):
No CMAKE_CXX_COMPILER could be found.
Error: --system-information failed on internal CMake!
I am invoking the commands through a bash shell within Visual Code running on Windows 11. I have tried setting the ENV variables shown and CC , CXX.
To add to the consternation is if I run CMake Tools extension by using Quick Start everything works with the compiler referenced in the CMakeCache.txt in build.
This is kind of hard to debug since both methods are opaque to me at this point. It would be nice if you could set a cmake debug flag and it would just print.
I suspect there is something between the bash environment and the set of actions used by CMake: Quick tools in Visual Code.
I would like to continue with the tutorials but they all fail in a similar way. Getting in the way of Vulkan programming.
I actually tried that and fixed the paths within Visual Studio x64 environment. Didn’t help.
There is just something in the Cmake Tools vs cmake cli. I think that cmake cli is looking to qualify a compiler and it is failing. I am trying to use the x64 cl compiler installed with Visual Studio Community.
I am also trying to figure out how to debug/watch the cmake cli process but I have not yet figured out a logging mechanism
Thanks,
Frank
I am trying to use --preset but am unsure how to use it. I found a json file at
C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMakeSettingsTemplates\CMakePresets.Windows.json
and the contents seem to indicate what I want. I have made some progress however it counter-intutive that I need this file in the project root directory.
CMake Tools in Visual Code sets it up correctly by referring to kits and setting to amd64 in my case. Works but not helpful when trying to work through a command line tutorial
Thanks,
Frank
Well for education purposes of learning how it works.
30+ years ago I was a build engineer and got flown around alot(including months in Paris). After that point in my life I got dragged into more and more marketing and sales events where my brain died. . There have been a lot of improvements in the mean time.
Probably should take your advice as my goal really is learning the Vulkan graphics platform. Since most of the tutorials in c++. I want to take what I learn and put it to create libraries for the Rust platform. All means to and end.
I’m working now on a different problem where the linker is not picking up system32 libraries in the x64-debug preset.
More later
LOL you are probably right about OS. My experience with Linux is about 6 years setting up marketing servers and fortifying them. And Raspberry Pi.
I got everything going well now. I ran the exercises in a X64 Dev prompt on windows and they worked. Then I got rid of a hacked path in a .bashrc that gets invoked in the shell env with VScode.
Learn though mistakes. Now onward.
Thanks for your help
Hi Frank,
Have you tried running cmake from cmd.exe or PowerShell instead of a bash shell? Depending on where the bash shell comes from (e.g., Cygwin), it might have its own cmake which doesn’t know where to find the Visual Studio compiler.
I don’t remember having to do anything special to get cmake to find the compiler, although it did have a tendency to prefer mingw over Visual Studio.