# FW: Cmake Tutorial Step 1 Error

**URL:** https://discourse.cmake.org/t/fw-cmake-tutorial-step-1-error/7273
**Category:** Usage
**Created:** [January 18, 2023, 1:19pm UTC](https://discourse.cmake.org/t/fw-cmake-tutorial-step-1-error/7273 "2023-01-18T13:19:40Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![MaxFun](https://discourse.cmake.org/user_avatar/discourse.cmake.org/maxfun/32/3090_2.png) [@MaxFun](https://discourse.cmake.org/u/MaxFun)
#### Post date: [January 18, 2023, 1:19pm UTC](https://discourse.cmake.org/t/fw-cmake-tutorial-step-1-error/7273/1 "2023-01-18T13:19:40Z")

</div>

Removed embedded media items

 ![image001.png](https://discourse.cmake.org/uploads/default/original/2X/e/e50d86b7832dcc6d71f6b5f0fa9694df05a79e87.png)

---

<div class="post-metadata">

### Author: ![bill.hoffman](https://discourse.cmake.org/user_avatar/discourse.cmake.org/bill.hoffman/32/13_2.png) [@bill.hoffman](https://discourse.cmake.org/u/bill.hoffman)
#### Post date: [January 19, 2023, 4:43pm UTC](https://discourse.cmake.org/t/fw-cmake-tutorial-step-1-error/7273/2 "2023-01-19T16:43:08Z")

</div>

Should be cmake … not cmake …/Step1 unless you put Step1\_build at the same directory level as Step1.

---

<div class="post-metadata">

### Author: ![MaxFun](https://discourse.cmake.org/user_avatar/discourse.cmake.org/maxfun/32/3090_2.png) [@MaxFun](https://discourse.cmake.org/u/MaxFun)
#### Post date: [January 20, 2023, 3:52pm UTC](https://discourse.cmake.org/t/fw-cmake-tutorial-step-1-error/7273/3 "2023-01-20T15:52:01Z")

</div>

In the first post, the attached image shows that the Step1\_build is a sub-folder of Step1  
Also from what I can find, cmake …( 3 dots) is not a valid command, 2 dots are.

I tried “cmake …/Step1\_build” but it returned an error

“mike@DESKTOP-A13TGH3:/mnt/c/CmakeTutorial/Step1/Step1\_build$ cmake …/Step1\_build  
CMake Error: The source directory “/mnt/c/CmakeTutorial/Step1/Step1\_build” does not appear to contain CMakeLists.txt.  
Specify --help for usage, or press the help button on the CMake GUI.  
mike@DESKTOP-A13TGH3:/mnt/c/CmakeTutorial/Step1/Step1\_build$”

Got the same error with windows ubuntu and mingw-w64

There appear to be an error in the tutorial or I am doing something wrong.  
If there is something wrong with the tutorial, I hope someone can correct the website.  
I am hopping someone can help.

---

<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: [January 20, 2023, 4:01pm UTC](https://discourse.cmake.org/t/fw-cmake-tutorial-step-1-error/7273/4 "2023-01-20T16:01:56Z")

</div>

> [@MaxFun](#):
>
> In the first post, the attached image shows that the Step1\_build is a sub-folder of Step1

True, but it shouldn’t be. Quoting the [CMake tutorial](https://cmake.org/cmake/help/latest/guide/tutorial/A%20Basic%20Starting%20Point.html#build-and-run):

> For example, from the command line we could navigate to the `Help/guide/tutorial` directory of the CMake source code tree and create a build directory:
> 
> ```auto
> mkdir Step1_build
> 
> ```

Notice there’s no `Step1` in the “navigate to” directory. The idea is to create `Step1_build` as a sibling to `Step1`.

---

<div class="post-metadata">

### Author: ![MaxFun](https://discourse.cmake.org/user_avatar/discourse.cmake.org/maxfun/32/3090_2.png) [@MaxFun](https://discourse.cmake.org/u/MaxFun)
#### Post date: [January 20, 2023, 4:45pm UTC](https://discourse.cmake.org/t/fw-cmake-tutorial-step-1-error/7273/5 "2023-01-20T16:45:55Z")

</div>

> [@Angew](#):
>
> CMake source

I don’t understand. How do I nagvigate to the `Help/guide/tutorial` directory of the CMake source code tree, did not find it on my computer.  
I did on 1/17/23 download cmake-3.25.1-tutorial-source.zip, unzipped to my C drive and that where I navigated too.

---

<div class="post-metadata">

### Author: ![jtxa](https://discourse.cmake.org/user_avatar/discourse.cmake.org/jtxa/32/1535_2.png) [@jtxa](https://discourse.cmake.org/u/jtxa)
#### Post date: [January 20, 2023, 11:52pm UTC](https://discourse.cmake.org/t/fw-cmake-tutorial-step-1-error/7273/6 "2023-01-20T23:52:35Z")

</div>

The tutorial needs an update:  
The path described is inside the CMake source tree, where it’s maintained.  
If you use the separate ZIP, which only contains the tutorial, it’s the toplevel directory that has the `README` and where you can see all the StepX subdirectories.

---

<div class="post-metadata">

### Author: ![MaxFun](https://discourse.cmake.org/user_avatar/discourse.cmake.org/maxfun/32/3090_2.png) [@MaxFun](https://discourse.cmake.org/u/MaxFun)
#### Post date: [January 21, 2023, 11:29am UTC](https://discourse.cmake.org/t/fw-cmake-tutorial-step-1-error/7273/7 "2023-01-21T11:29:34Z")

</div>

If I understand what you wrote, the tutorial is unusable.  
Thanks for sharing.

---

<div class="post-metadata">

### Author: ![jtxa](https://discourse.cmake.org/user_avatar/discourse.cmake.org/jtxa/32/1535_2.png) [@jtxa](https://discourse.cmake.org/u/jtxa)
#### Post date: [January 21, 2023, 1:52pm UTC](https://discourse.cmake.org/t/fw-cmake-tutorial-step-1-error/7273/8 "2023-01-21T13:52:21Z")

</div>

Not unusable:  
The tutorial sources were (and still are) part of the CMake source tree.  
It was only recently that the tutorial sources were extracted as separate ZIP file for convenience. And that single sentence was not improved to explain that there are now 2 different possibilities.

In general the tutorial is working fine.

---

<div class="post-metadata">

### Author: ![MaxFun](https://discourse.cmake.org/user_avatar/discourse.cmake.org/maxfun/32/3090_2.png) [@MaxFun](https://discourse.cmake.org/u/MaxFun)
#### Post date: [January 21, 2023, 5:40pm UTC](https://discourse.cmake.org/t/fw-cmake-tutorial-step-1-error/7273/9 "2023-01-21T17:40:48Z")

</div>

Great, how do I get to the working tutorial?  
Where do I find the “CMake source tree”, " `Help/guide/tutorial`" is not on my computer from the install of cmake.  
“And that single sentence was not improved to explain that there are now 2 different possibilities.”  
What are the two possibilities and how can I use them, get to them.

To demonstrate how broken CMake Tutorial is, the following are errors in the tutorial

1. Starting page of tutorial, [https://cmake.org/cmake/help/latest/guide/tutorial/index.html](https://cmake.org/cmake/help/latest/guide/tutorial/index.html)

“The tutorial source code examples are available in “this archive”. Each step”,  
the link is broken and the link open a tab/window with “Not Found”

1. [Step 1: A Basic Starting Point]

2a) “Each file in the Files to Edit section”, where is the “Files to Edit section”

2b) “The source code for tutorial.cxx is provided in the Help/guide/tutorial/Step1”, where is “Help/guide/tutorial”

2c) “Once TODO 1 through TODO 3 have been completed, we are ready to build and run our project!”, the CMakeLists.tx has 9 TODO in it. Do you do only TODO1 → TODO3? The tutorial only show answers for TODO1 → TODO3

2d) “create a build directory:” using “mkdir Step1\_build”

2e) “Next, navigate to that build directory and run cmake to configure the project and generate a native build system:”

cd Step1\_build switch to folder Step1\_build

cmake …/Step1 causes a error, should be cmake …/Step1\_build

2f) The “cmake …/Step1\_build” will run without errors if a copy of the CMakeLists.txt is put in the Step1\_build folder and the only TOD1 =\>TODO2 are included. DOTO3 will cause an error.

I hope this give you an idea of how badly the tutorial is broken

---

<div class="post-metadata">

### Author: ![jtxa](https://discourse.cmake.org/user_avatar/discourse.cmake.org/jtxa/32/1535_2.png) [@jtxa](https://discourse.cmake.org/u/jtxa)
#### Post date: [January 21, 2023, 11:51pm UTC](https://discourse.cmake.org/t/fw-cmake-tutorial-step-1-error/7273/10 "2023-01-21T23:51:24Z")

</div>

If you either download the source zip or clone the git repo of CMake, you will have the source tree of CMake, If you installed CMake, you only have a compiled binary.

1. Please try again, the download is working.
2. 

2a) Please see wikipedia for the definition of the word [section](https://en.wikipedia.org/wiki/Section_(typography)). That’s a common word for books and documentation, just like chapter. Please look at the headlines of the Exercises and you will see “Files to Edit”  
2b) As explained `Help/guide/tutorial` is inside the original CMake source tree. If you downloaded the standalone tutorial, that directory corresponds to `cmake-3.25.2-tutorial-source` (depending on the version) in the zip. Or `/mnt/c/CmakeTutorial` of your first screen shot.  
2c) The tutorial for Step 1 explains all TODOs. You have read just the first Exercise which starts with the first 3 TODOs.  
2d) I guess you had no problem with that, just stated what you did next  
2e) The tutorial is correct, you mistyped your call: there must be 2 dots, not 3  
2f) It works. I used the commands as documented in the solution of Exercise 1 and they’re fine.
