Custom linking for MinGW gives unwanted dependency on cygwin1.dll

Mike Spivey <[email protected]>
Newsgroups gmane.comp.lang.ocaml.lib.gtk
Message-ID <[email protected]>
I'm using the MinGW port of OCaml under Cygwin and trying to build a
self-contained native windows application that uses lablgtk2.  What I
find is that linking with 'ocamlc -custom' results in an executable that
depends on cygwin1.dll.  Further investigation reveals that cygwin1.dll
is being used for some math functions, and that adding '-ccopt
-L/lib/mingw' solves the problem.

For example, in the /examples directory of lablgtk2, try

	ocamlc -custom -o about.exe -I ../src lablgtk2.cma about.ml
	cygcheck ./about.exe

and see the dependency on cygwin1.dll.  Then try

	ocamlc -custom -o about.exe -I ../src lablgtk2.cma about.ml \
 		-ccopt -L/lib/mingw
	cygcheck ./about.exe

and the dependency is gone.  It must have something to do with the way
flexdll searches for libraries; other OCaml programs that don't use GTK
find the MinGW math library without problem.

I don't call this a bug, but it is something that it is useful to know
about.

Best wishes for 2009,

-- Mike
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.