Closed johnwhitington closed 5 years ago
What kind of build system do you use? The file names and naming conventions doesn't differ between unix and mingw64.
If it's a handwritten script/Makefile, why not just pass $(ocamlc -where)/unix.a
instead of -L$(ocamlc -where) -lunix
?
Yes, it's a handwritten script. Thanks for the suggestion -- i'll give it a go.
This part of the script doesn't get tested on unix (we only build static binaries there).
This script did, however, work on some previous OCaml-on-Windows solution. But I can't remember which one -- maybe Protz'?
I got this working now, thanks, and have shipped both 32bit and 64bit DLLs to the customer.
However, I noticed one difference between the 32 bit and 64 bit distributions. In the 64 bit case, we have to add -cclib "-link -static-libgcc"
to ensure the DLL is standalone. But on 32 bit, it seems to happen by default.
Is this difference intentional?
Yes, you have to pass "-static-libgcc" manually now since https://github.com/ocaml/ocaml/blob/4.07.0/Changes#L199 Most of the time only 32-bit builds are affected, but it presumedly depends on the specific C code and how gcc compiles it.
Thanks!
I am building some libraries of mixed C/OCaml code, and trying to update my script for this new OCaml on Windows distribution. I hacked it to work by renaming some files, so I can send it to the customer, but it doesn't work out of the box.
The Library Unix, for example, is installed at
ocaml/unix.a.
But when we add
-L<path> -lunix
to the command line of the system linkerx86_64-w64-mingw32-ld
, it looks instead forlibunix.a
, and fails.The same happens with flexlink:
Is this intentional, and is there a non-hacky way around it?