One of the biggest sources of confusion for new CMake/C++ developers is setting up the environment for their toolchain. Unlike other languages, in C++ the build system + toolchain aren’t intrinsically linked.
Examples of confusion:
- The C compiler is not able to compile a simple test program - #4 by Abdo_Ameen
- A very simple question
- Unable to Compile a Simple Test Program – IDEs Support (IntelliJ Platform) | JetBrains
- "The C++ compiler "/usr/bin/c++.exe" is not able to compile a simple test program" on Windows 10 with Cygwin 64 · Issue #108 · OpenFAST/openfast · GitHub
- Solved: Build using cmake failed “is not able to compile a simple test program.” - Intel Community (<- this one is Fortran actually)
- I could provide more links if I needed to. But when I was just on stackoverflow this was a common issue.
The Meson build system covers this topic well enough:
https://mesonbuild.com/SimpleStart.html
CMake should have a similar tutorial for setting up compiler environment. And honestly the tutorial wouldn’t be that different for CMake, since Meson/CMake both rely on the same types of environments.