Hi,

> More generally speaking, given the way Windows DLLs work, I
> don't think it is possible at all to put Caml-C stub code in
> a DLL and pass that DLL to ocamlopt.  Static linking is your
> friend here.

This solves my problem. The correct compile.sh is attached.

Thank you all for the answers!
Christoph Bauer


#!/bin/sh -v
gcc -mno-cygwin -c -O  -mms-bitfields -UCAML_DLL -I c:/ocamlmgw/lib test.c -g
ar rcs libtest.a test.o
ocamlopt -o test_it.exe test_it.ml -cclib "-L. -ltest"