You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: getting-started/cpp-stuff.md
+17-6Lines changed: 17 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,19 +13,30 @@ To be able to use the Geode SDK, you **will** need at least the following:
13
13
## Compiler
14
14
15
15
To use the Geode SDK, and in turn make Geometry Dash mods, you will need either:
16
-
*[Visual Studio 2022+](#windows) on Windows
16
+
*[Clang](#windows-clang) (recommended) or [Visual Studio 2022+](#windows-visual-studio) on Windows
17
17
*[Clang](#macos) on MacOS
18
18
*[A secret third thing](#linux) on Linux
19
19
20
-
### Windows
20
+
### Windows (Clang)
21
21
22
-
Download Visual Studio from [its website](https://visualstudio.microsoft.com/downloads/). If you want **just** the compiler and not the code editor, look for *Build Tools for Visual Studio* further down in the page.
22
+
First, install [LLVM](https://github.com/llvm/llvm-project) and [Ninja](https://github.com/ninja-build/ninja). The easiest way is using Scoop:
23
+
```
24
+
scoop install llvm ninja
25
+
```
23
26
24
-
After launching the installer, select **Desktop development with C++**. You may choose other features, but you **will** need at least ***MSVC*** and ***Windows SDK*** installed.
27
+
LLVM itself does not come with Windows SDK and CRT libraries, so you will need a minimal Visual Studio install for these, which is described in the next section.
25
28
26
-
Once Visual Studio is installed, you should now have a working C++ compiler that is suited for GD mod development.
29
+
### Windows (Visual Studio)
30
+
31
+
Please note that Visual Studio **2022** or higher is required. If you have an older version already installed, you should upgrade to the latest available.
27
32
28
-
Please note that Visual Studio **2022** or higher is required. 2019 or lower will not work, as they don't support C++20 properly.
33
+
Unless you want to install Visual Studio (the editor) itself, we recommend installing just the build tools. Open the VS [download page](https://visualstudio.microsoft.com/downloads), scroll to the bottom, and under "Tools for Visual Studio" download **Build Tools for Visual Studio**.
34
+
35
+
After launching the installer, select **Desktop development with C++** and optionally deselect all features except for **MSVC Build Tools** and **Windows SDK**, like on the screenshot below. Click Install and wait for it to finish.
36
+
37
+

38
+
39
+
Once Visual Studio is installed, you should now have a working C++ compiler that is suited for GD mod development.
*[`Geode`](https://marketplace.visualstudio.com/items?itemName=GeodeSDK.geode) - Not required, but will provide some nice features.
26
25
26
+
As well as one of:
27
+
*[`clangd`](https://marketplace.visualstudio.com/items?itemName=llvm-vs-code-extensions.vscode-clangd) - **if using Clang as compiler**
28
+
*[`C/C++`](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools) - **if using MSVC / Visual Studio as compiler**
29
+
27
30
There are a few steps you should follow to get proper intellisense and code completion (you should only need to do these once per project, ideally):
28
31
29
-
1. With VS Code open on your project, press F1 and run `CMake: Select a Kit`. This will bring up a list of installed compilers on your machine.
32
+
1. With VS Code open on your project, press F1 and run `CMake: Select a Kit`. This will bring up a list of installed compilers on your machine. This will also open automatically whenever opening a new project.
30
33
31
34

32
35
33
-
You should pick a **Visual Studio 2022+**compiler (specifically the `amd64` version), or Clang, but nothing else!
34
-
35
-
> :warning: Please pay attention to this
36
+
Depending on which compiler you want to use, pick either:
37
+
***Clang** (not `Clang-cl`) - recommended
38
+
***Visual Studio 20xx Release - amd64** (not `amd64_x86` or any other ones)
36
39
37
-
2. Now to select the build variant, press F1 and run `CMake: Select Variant`. We recommend **RelWithDebInfo** for easier debugging, as Debug may sometimes cause obscure crashes.
40
+
2. Now to select the build variant, press F1 and run `CMake: Select Variant`. We recommend **RelWithDebInfo** for easier debugging, as **Debug** may sometimes cause obscure crashes.
38
41
39
42

40
43
41
-
3. Register CMake as the **Configuration Provider** for the C++ extension by pressing F1 and running `C/C++: Edit Configurations (UI)`. Scroll down to **Advanced** options, and set the Configuration Provider as `ms-vscode.cmake-tools`.
44
+
3. If using **Clang** with the **clangd** extension, press F1 and run `CMake: Edit User-Local CMake Kits`. This will open a file, in there find the chosen kit (one with Clang in the name) and add these keys to it:
45
+
```json
46
+
"cmakeSettings": {
47
+
"CMAKE_EXPORT_COMPILE_COMMANDS": 1
48
+
},
49
+
"preferredGenerator": {
50
+
"name": "Ninja"
51
+
}
52
+
```
53
+
54
+
4. If instead of Clang you chose the **C/C++ extension**, you need to register CMake as the **Configuration Provider** for the C++ extension by pressing F1 and running `C/C++: Edit Configurations (UI)`. Scroll down to **Advanced** options, and set the Configuration Provider as `ms-vscode.cmake-tools`.
42
55
43
56

0 commit comments