tsdl
tsdl copied to clipboard
Using tsdl in toplevel on Windows
(I'll submit a PR)
Using dune utop
in an opam switch that has tsdl
on Windows results in:
Fatal error: exception Dl.DL_error("dlsym: no such symbol: \"SDL_GetError\"")
That is because <opamswitch>\lib\tsdl\tsdl.cma
has:
Extra C object files:
Extra C options: -L<opamswitch>/bin/../lib
Extra dynamically-loaded libraries: -ltsdl
It should be something like:
Extra C object files: SDL2.lib
Extra C options: -L<opamswitch>/bin/../lib
Extra dynamically-loaded libraries: dlltsdl.dll
More context:
msys64\usr\bin\bash -lc 'PATH="$PWD/.ci/sd4/opamrun:$PATH"; opamrun exec -- pkg-config --libs sdl2'
Running: opam exec -- pkg-config --libs sdl2
-LY:/source/dksdk-coder/.ci/o/dkml/bin/../lib SDL2.lib
but myocamlbuild.ml
only queries for:
-
libs-only-l
-
libs-only-L
which misses SDL2.lib
Since 116ab1febf489 tsdl
has now a proper stubs library on every platform, on macOS this looks like that:
> ocamlobjinfo tsdl.cma | grep 'Extra'
Extra C object files: -lSDL2
Extra C options: -L/opt/homebrew/lib
Extra dynamically-loaded libraries: -ltsdl_stubs
in ec9ddc9a15772c108ca980 I adapted the myocambuild.ml
with what I think is needed from #98.
Could you perhaps test this ?
Could you perhaps test this ?
Give me some time to get re-acquainted and a few other things, but yes I'll test this.