# Tutorial step1 Error with project()

**URL:** https://discourse.cmake.org/t/tutorial-step1-error-with-project/11520
**Category:** Usage
**Created:** [August 24, 2024, 10:22am UTC](https://discourse.cmake.org/t/tutorial-step1-error-with-project/11520 "2024-08-24T10:22:54Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![vichebar](https://discourse.cmake.org/user_avatar/discourse.cmake.org/vichebar/32/4878_2.png) [@vichebar](https://discourse.cmake.org/u/vichebar)
#### Post date: [August 24, 2024, 10:22am UTC](https://discourse.cmake.org/t/tutorial-step1-error-with-project/11520/1 "2024-08-24T10:22:55Z")

</div>

I was following the [tutorial](https://cmake.org/cmake/help/latest/guide/tutorial/A%20Basic%20Starting%20Point.html) and in the first step

> Exercise 1 - Building a Basic Project

the instructions ask to run in the console  
`cmake ../Step1`  
And as the output I got

```auto
CMake Error at CMakeLists.txt:5 (project):
  Running

   'nmake' '-?'

  failed with:

   no such file or directory

CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!

```

And this is what I have in the CMakeList.txt:

```auto
# TODO 1: Set the minimum required version of CMake to be 3.10
cmake_minimum_required(VERSION 3.10)

# TODO 2: Create a project named Tutorial
project(Tutorial)

# TODO 7: Set the project version number as 1.0 in the above project command

# TODO 6: Set the variable CMAKE_CXX_STANDARD to 11
# and the variable CMAKE_CXX_STANDARD_REQUIRED to True

# TODO 8: Use configure_file to configure and copy TutorialConfig.h.in to
# TutorialConfig.h

# TODO 3: Add an executable called Tutorial to the project
# Hint: Be sure to specify the source file as tutorial.cxx
add_executable(Tutorial tutorial.cxx)

# TODO 9: Use target_include_directories to include ${PROJECT_BINARY_DIR}

```

Hope you can help me, i’m kind new at cmake

---

<div class="post-metadata">

### Author: ![foamypop](https://discourse.cmake.org/user_avatar/discourse.cmake.org/foamypop/32/5203_2.png) [@foamypop](https://discourse.cmake.org/u/foamypop)
#### Post date: [December 18, 2024, 8:03am UTC](https://discourse.cmake.org/t/tutorial-step1-error-with-project/11520/2 "2024-12-18T08:03:43Z")

</div>

im having the same problem…

---

<div class="post-metadata">

### Author: ![Angew](https://discourse.cmake.org/user_avatar/discourse.cmake.org/angew/32/229_2.png) [@Angew](https://discourse.cmake.org/u/Angew)
#### Post date: [December 18, 2024, 8:14am UTC](https://discourse.cmake.org/t/tutorial-step1-error-with-project/11520/3 "2024-12-18T08:14:58Z")

</div>

CMake requires the environment to be correctly set up for development when it is run. That is, when you run `cmake ../Step1`, the environment of your command-line must have all the necessary build tools in `PATH` etc. Is that the case?

Using the Visual Studio generator is an exception to this rule (CMake can locate VS itself), but as the error you’re getting references `nmake`, you’re probably not generating for VS and so the exception doesn’t apply.

---

<div class="post-metadata">

### Author: ![BeardC](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/76d3ee/32.png) [@BeardC](https://discourse.cmake.org/u/BeardC)
#### Post date: [January 22, 2025, 6:50am UTC](https://discourse.cmake.org/t/tutorial-step1-error-with-project/11520/4 "2025-01-22T06:50:53Z")

</div>

I have the same problem as well. It is a pity that tutorial does not state required environment for the tutorial ☹

---

<div class="post-metadata">

### Author: ![ClausKlein](https://discourse.cmake.org/user_avatar/discourse.cmake.org/clausklein/32/352_2.png) [@ClausKlein](https://discourse.cmake.org/u/ClausKlein)
#### Post date: [January 22, 2025, 8:29pm UTC](https://discourse.cmake.org/t/tutorial-step1-error-with-project/11520/5 "2025-01-22T20:29:58Z")

</div>

On `Linux` or [Windows Subsystem for Linux (WSL)](https://learn.microsoft.com/en-us/windows/wsl/install)with development tools installed, it would be easy.

You may also use [setup-cpp](https://github.com/aminya/setup-cpp?tab=readme-ov-file#with-executable) to install a toolchain on your **OS** (Windows too).

```bash
bash-5.2$ cmake -S Step2 -B build
-- The C compiler identification is Clang 19.1.7
-- The CXX compiler identification is Clang 19.1.7
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/local/opt/llvm/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/local/opt/llvm/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done (11.1s)
-- Generating done (0.0s)
-- Build files have been written to: /Users/clausklein/cmake/tutorial/build

bash-5.2$ cmake --build build
[2/2] Linking CXX executable Tutorial
bash-5.2$ 
``
```
