# Tutorial Step 5 does not work as presented

**URL:** <https://discourse.cmake.org/t/tutorial-step-5-does-not-work-as-presented/507>\
**Category:** Code\
**Tags:** os:linux\
**Created:** [January 15, 2020, 6:53pm UTC](https://discourse.cmake.org/t/tutorial-step-5-does-not-work-as-presented/507 "2020-01-15T18:53:03Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrichter](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/m/858c86/32.png) [@mrichter](https://discourse.cmake.org/u/mrichter)\
**Post date:** [January 15, 2020, 6:53pm UTC](https://discourse.cmake.org/t/tutorial-step-5-does-not-work-as-presented/507/1 "2020-01-15T18:53:03Z")

</div>

I’m really new to CMake, and I’ve been following the tutorial at [https://cmake.org/cmake/help/latest/guide/tutorial/index.html#adding-system-introspection-step-5](https://cmake.org/cmake/help/latest/guide/tutorial/index.html#adding-system-introspection-step-5).

The instructions for running step 5 do not work. For one thing, the line "#include " is required in the mysqrt.cxx source, but this is never mentioned in the tutorial.

Also, in the first part of this step, there are instructions for how to get mysqrt.cxx to include the TutorialConfig.h file, but the changes described do not work. I get syntax errors when I try to build.

I found this out by comparing my source to the Step 6 source.

I hope someone can verify this and correct it because this kind of misinformation is very confusing to new users.

Thank you.

---

<div class="post-metadata">

**Author:** ![brad.king](https://discourse.cmake.org/user_avatar/discourse.cmake.org/brad.king/32/11_2.png) [@brad.king](https://discourse.cmake.org/u/brad.king)\
**Post date:** [January 15, 2020, 7:18pm UTC](https://discourse.cmake.org/t/tutorial-step-5-does-not-work-as-presented/507/2 "2020-01-15T19:18:08Z")

</div>

@betsy.mcphail please take a look at these steps in the tutorial.

---

<div class="post-metadata">

**Author:** ![McMartin](https://discourse.cmake.org/user_avatar/discourse.cmake.org/mcmartin/32/150_2.png) [@McMartin](https://discourse.cmake.org/u/McMartin)\
**Post date:** [January 15, 2020, 7:50pm UTC](https://discourse.cmake.org/t/tutorial-step-5-does-not-work-as-presented/507/3 "2020-01-15T19:50:22Z")

</div>

> [@mrichter](#):
>
> For one thing, the line "#include " is required in the mysqrt.cxx source, but this is never mentioned in the tutorial.

For reference, the tutorial says

> Modify `mysqrt.cxx` to include cmath.

However, I’m not in the right position to judge whether it is clear enough.

> [@mrichter](#):
>
> I get syntax errors when I try to build.

What errors do you get exactly?

---

<div class="post-metadata">

**Author:** ![mrichter](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/m/858c86/32.png) [@mrichter](https://discourse.cmake.org/u/mrichter)\
**Post date:** [January 15, 2020, 7:59pm UTC](https://discourse.cmake.org/t/tutorial-step-5-does-not-work-as-presented/507/4 "2020-01-15T19:59:00Z")

</div>

I completely missed that.

The instructions for the TutorialConfig.h include I followed and double-checked. I couldn’t get that to work at all.

---

<div class="post-metadata">

**Author:** ![betsy.mcphail](https://discourse.cmake.org/user_avatar/discourse.cmake.org/betsy.mcphail/32/299_2.png) [@betsy.mcphail](https://discourse.cmake.org/u/betsy.mcphail)\
**Post date:** [January 15, 2020, 9:46pm UTC](https://discourse.cmake.org/t/tutorial-step-5-does-not-work-as-presented/507/5 "2020-01-15T21:46:37Z")

</div>

What syntax errors are you seeing? Is this the part of the instructions that are problematic?

> We will also need to update MathFunctions/CMakeLists.txt so mysqrt.cxx knows where this file is located:
> 
> target\_include\_directories(MathFunctions  
> INTERFACE ${CMAKE\_CURRENT\_SOURCE\_DIR}  
> PRIVATE ${CMAKE\_BINARY\_DIR}  
> )

---

<div class="post-metadata">

**Author:** ![mrichter](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/m/858c86/32.png) [@mrichter](https://discourse.cmake.org/u/mrichter)\
**Post date:** [January 15, 2020, 9:58pm UTC](https://discourse.cmake.org/t/tutorial-step-5-does-not-work-as-presented/507/6 "2020-01-15T21:58:23Z")

</div>

Ah, now I see - the only flaw was the missing "#include " line.

My apologies. Perhaps this could be called out as a separate paragraph to make it crystal clear to newbs like myself.

---

<div class="post-metadata">

**Author:** ![betsy.mcphail](https://discourse.cmake.org/user_avatar/discourse.cmake.org/betsy.mcphail/32/299_2.png) [@betsy.mcphail](https://discourse.cmake.org/u/betsy.mcphail)\
**Post date:** [January 16, 2020, 1:10am UTC](https://discourse.cmake.org/t/tutorial-step-5-does-not-work-as-presented/507/7 "2020-01-16T01:10:57Z")

</div>

No problem! I submitted a merge request to make that section more clear ([https://gitlab.kitware.com/cmake/cmake/merge\_requests/4231](https://gitlab.kitware.com/cmake/cmake/merge_requests/4231))

---

<div class="post-metadata">

**Author:** ![mrichter](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/m/858c86/32.png) [@mrichter](https://discourse.cmake.org/u/mrichter)\
**Post date:** [January 16, 2020, 1:11am UTC](https://discourse.cmake.org/t/tutorial-step-5-does-not-work-as-presented/507/8 "2020-01-16T01:11:50Z")

</div>

Great.
