fccm / OCamlSDL2

OCaml interface to SDL 2.0 (for Linux, Windows, MacOS, and ChromeBook)
Other
51 stars 10 forks source link

Win10+Msys2 - flexlink: unknown option '-Wall'. #13

Open darkoverlordofdata opened 5 years ago

darkoverlordofdata commented 5 years ago

Hi - I'm new to ocaml - I've been using f#, but want to use a native solution.

So, I'm using ocaml version 4.04.0, because that is what comes with MSys2. I've gotten your bindings to compile, but when I try the examples folder, I get this error:

make test ocamlopt -g -I ../src sdl2.cmxa \ ex_version.ml -o "ex_version.exe" flexlink: unknown option '-Wall'. FlexDLL version 0.34

fccm commented 5 years ago

Try to have a look at the Makefile in src/, there is these three vars:

CFLAGS = $(shell sdl2-config --cflags)
LIBS_ = $(shell sdl2-config --static-libs)
LIBS = $(shell ocaml prm.ml $(LIBS_))

The difficulty there is that sdl2-config is made to compile C not OCaml, so try to run the commands sdl2-config --cflags and sdl2-config --static-libs (or maybe sdl2-config --libs) and see what is returned. The small script prm.ml tries to remove parameters that should not be passed to ocaml (but I tested it only on my computer so I don't know for others). Try to set these variables by yourself (you can edit the Makefile or run make LIBS=<libs-params> CFLAGS=<cflags-params> replace libs-params and cflags-params with different attempts, maybe the same without the -Wall that is reported in your error message)

Please tell me back if you encounter success or failure with this.