# Tutorial for setting up toolchain environment

**URL:** https://discourse.cmake.org/t/tutorial-for-setting-up-toolchain-environment/3178
**Category:** Development
**Created:** [April 20, 2021, 7:26pm UTC](https://discourse.cmake.org/t/tutorial-for-setting-up-toolchain-environment/3178 "2021-04-20T19:26:46Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![YMba9g8j9CJp0wLoQf5y](https://discourse.cmake.org/user_avatar/discourse.cmake.org/ymba9g8j9cjp0wloqf5y/32/1244_2.png) [@YMba9g8j9CJp0wLoQf5y](https://discourse.cmake.org/u/YMba9g8j9CJp0wLoQf5y)
#### Post date: [April 20, 2021, 7:26pm UTC](https://discourse.cmake.org/t/tutorial-for-setting-up-toolchain-environment/3178/1 "2021-04-20T19:26:46Z")

</div>

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](https://discourse.cmake.org/t/the-c-compiler-is-not-able-to-compile-a-simple-test-program/3177/5)
- [A very simple question](https://discourse.cmake.org/t/a-very-simple-question/2961)
- [Unable to Compile a Simple Test Program – IDEs Support (IntelliJ Platform) | JetBrains](https://intellij-support.jetbrains.com/hc/en-us/community/posts/360000656739-Unable-to-Compile-a-Simple-Test-Program)
- ["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](https://github.com/OpenFAST/openfast/issues/108)
- [Solved: Build using cmake failed “is not able to compile a simple test program.” - Intel Community](https://community.intel.com/t5/Intel-Fortran-Compiler/Build-using-cmake-failed-is-not-able-to-compile-a-simple-test/td-p/1203174) (\<- 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](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.

---

<div class="post-metadata">

### Author: ![cristi](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/c/e95f7d/32.png) [@cristi](https://discourse.cmake.org/u/cristi)
#### Post date: [April 24, 2021, 6:22pm UTC](https://discourse.cmake.org/t/tutorial-for-setting-up-toolchain-environment/3178/2 "2021-04-24T18:22:21Z")

</div>

Maybe there could even be a command for bootstrapping a project? There are already GitHub projects with templates (like [this](https://github.com/TheLartians/ModernCppStarter) for example). It doesn’t have to be something as expansive (or opinionated) as those templates, but something like `cargo new` with some simple configuration options could be nice.
