Fix tutorial C++ instructions for starting the memory game on Windows

This commit is contained in:
Simon Hausmann 2022-03-09 11:02:25 +01:00
parent 727b3e30e2
commit ea0e02f468

View file

@ -49,16 +49,33 @@ What's still missing is the `main.cpp`:
To recap, we now have a directory with a `CMakeLists.txt`, `memory.slint` and `main.cpp`.
We can now compile and run this program:
We can now compile the program in a terminal:
```sh
cmake -GNinja .
cmake --build .
```
If you are on Linux or macOS, you can run the program:
```sh
./memory_game
```
and a window will appear with the green "Hello World" greeting.
If you are stepping through this tutorial on a Windows machine, you need to add the `bin` sub-directory into your `%PATH%`:
```sh
set PATH=%CD%\bin;%PATH%
```
so that Windows to can find the Slint run-time library. Then you can run it with
```sh
memory_game
```
![Screenshot of initial tutorial app showing Hello World](https://slint-ui.com/blog/memory-game-tutorial/getting-started.png "Hello World")
Feel free to use your favorite IDE for this purpose, or use out-of-tree build, or Ninja, ...