File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,45 @@ On Windows you can install SDL with `pacman` under [MSYS2](https://msys2.github.
42
42
> ghc-options: -optl-mconsole
43
43
> ```
44
44
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
+
49
+ You have two options to mitigate this:
50
+ 1. Flip a package flag named `recent-ish` in your **project** configuration file.
51
+ * `cabal.project.local`:
52
+ ```yaml
53
+ package sdl2
54
+ flags: -recent-ish
55
+ ```
56
+ * `stack.yaml`:
57
+ ```yaml
58
+ flags:
59
+ sdl2:
60
+ recent-ish: false
61
+ ```
62
+ 2. Build SDL2 from source and use `extra-include-dirs` / `extra-lib-dirs` options, while disabling the pkgconfig-provided dependency:
63
+ * `cabal.project.local`:
64
+ ```yaml
65
+ extra-include-dirs: /path/to/sdl2/include
66
+ extra-lib-dirs: /path/to/sdl2/lib
67
+ package sdl2:
68
+ flags: -pkgconfig
69
+ ```
70
+ * `stack.yaml`:
71
+ ```yaml
72
+ extra-include-dirs:
73
+ - /path/to/sdl2/include
74
+ extra-lib-dirs:
75
+ - /path/to/sdl2/lib
76
+ flags:
77
+ sdl2:
78
+ pkgconfig: false
79
+ ```
80
+
81
+ The flag enables some features from SDL2 past 2.0.8 and assumes a host system has at least version 2.0.20 installed.
82
+ If you have libsdl2 version older than that, but need some features past 2.0.8, you'd have to use the `extra-*-dirs` way.
83
+
45
84
# Get Started
46
85
47
86
Take a look at the [getting started guide](https://hackage.haskell.org/package/sdl2/docs/SDL.html).
You can’t perform that action at this time.
0 commit comments