Skip to content

Commit ceaeb9e

Browse files
committed
Add a note about the build errors with old libsdl2
1 parent 5cd891d commit ceaeb9e

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,36 @@ On Windows you can install SDL with `pacman` under [MSYS2](https://msys2.github.
4242
> ghc-options: -optl-mconsole
4343
> ```
4444
45+
## Build errors
46+
47+
If you are getting build errors like `‘SDL_Vertex’ undeclared` then your installed libsdl2 version is missing some recent additions.
48+
You have two options to mitigate this:
49+
1. Flip a package flag named `recent-ish` in your **project** configuration file.
50+
* `cabal.project.local`:
51+
```yaml
52+
package sdl2
53+
flags: -recent-ish
54+
```
55+
* `stack.yaml`:
56+
```yaml
57+
flags:
58+
sdl2:
59+
recent-ish: false
60+
```
61+
2. Build SDL2 from source and use `extra-include-dirs` / `extra-lib-dirs` options:
62+
* `cabal.project.local`:
63+
```yaml
64+
extra-include-dirs: /path/to/sdl2/include
65+
extra-lib-dirs: /path/to/sdl2/lib
66+
```
67+
* `stack.yaml`:
68+
```yaml
69+
extra-include-dirs:
70+
- /path/to/sdl2/include
71+
extra-lib-dirs:
72+
- /path/to/sdl2/lib
73+
```
74+
4575
# Get Started
4676
4777
Take a look at the [getting started guide](https://hackage.haskell.org/package/sdl2/docs/SDL.html).

0 commit comments

Comments
 (0)