This is the mail archive of the cygwin-apps@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: ocaml-3.08.1-2


On Thu, 23 Sep 2004, Gerrit P. Haase wrote:

> Hello Igor,
>
> > The packaging hasn't changed, but it would be nice if someone who uses
> > ocaml (Max? Gerrit?) gave it a look-over before it's uploaded.
>
> > The files are available at the following URLs:
>
> > <http://cs.nyu.edu/~pechtcha/cygwin/ocaml/setup.hint>
> > <http://cs.nyu.edu/~pechtcha/cygwin/ocaml/ocaml-3.08.1-2.tar.bz2>
> > <http://cs.nyu.edu/~pechtcha/cygwin/ocaml/ocaml-3.08.1-2-src.tar.bz2>
>
> I cannot get lablgtk-2.4.0 compiled (works before):

Hi, Gerrit,

First off, thanks for testing.  Andrew Schulman reported similar problems,
but I see you got further by adding the "-lcamlrun" to the ocamlmklib
line (which will be required to build under Cygwin, I'm afraid, so I'll
have to put that in the README).

> ocamlmklib -verbose -o lablglade2 ml_glade.o -lglade-2.0 -lgtk-x11-2.0 -lxml2 -lpthread -lz -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangoxft-1.0 -lpangox-1.0 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lintl -liconv -L/usr/lib/ocaml -lcamlrun
> + gcc -shared -o ./dlllablglade2.so ml_glade.o -L/usr/lib/ocaml  -Wl,-rpath,/usr/lib/ocaml -lglade-2.0 -lgtk-x11-2.0 -lxml2 -lpthread -lz -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangoxft-1.0 -lpangox-1.0 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lintl -liconv -lcamlrun
>
> S.th. weird is going on there.
> 1. I would like OCaml to produce .dll files, not .so files.

Does it matter?  It didn't for me on WinXP, but may on other systems.

> 2. The name seems to be wrong, shouldn't it be cyglablglade2.so or
> cyglablglade2.dll instead of dlllablglade2.so?

Umm, yes, right now ocamlmklib will not do any name or path munging on the
DLLs...  I don't know if it's needed.  The above is the name O'Caml uses
on Linux, so...

> 3. would not hurt that much if the link would succeed:
> ocamlmklib -verbose -o lablglade2 ml_glade.o -lglade-2.0 -lgtk-x11-2.0 -lxml2 -lpthread -lz -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangoxft-1.0 -lpangox-1.0 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lintl -liconv -L/usr/lib/ocaml -lcamlrun
> + gcc -shared -o ./dlllablglade2.so ml_glade.o -L/usr/lib/ocaml  -Wl,-rpath,/usr/lib/ocaml -lglade-2.0 -lgtk-x11-2.0 -lxml2 -lpthread -lz -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangoxft-1.0 -lpangox-1.0 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lintl -liconv -lcamlrun
> ml_glade.o(.text+0xb1):ml_glade.c: undefined reference to `_Val_GObject_new'
> ml_glade.o(.text+0x110):ml_glade.c: undefined reference to `_copy_string_check'
> ml_glade.o(.text+0x12a):ml_glade.c: undefined reference to `_Val_GObject'
> ml_glade.o(.text+0x147):ml_glade.c: undefined reference to `_copy_string_check'
> ml_glade.o(.text+0x16a):ml_glade.c: undefined reference to `_Val_GObject'
> ml_glade.o(.text+0x172):ml_glade.c: undefined reference to `_ml_some'
> ml_glade.o(.text+0x1d6):ml_glade.c: undefined reference to `_ml_global_root_new'
> ml_glade.o(.text+0x20a):ml_glade.c: undefined reference to `_ml_global_root_new'
> ml_glade.o(.text+0x257):ml_glade.c: undefined reference to `_Val_GObject'
> ml_glade.o(.text+0x277):ml_glade.c: undefined reference to `_copy_string_check'
> ml_glade.o(.text+0x297):ml_glade.c: undefined reference to `_Val_GObject'
> Info: resolving _caml_local_roots by linking to __imp__caml_local_roots (auto-import)
> collect2: ld returned 1 exit status
> make[1]: *** [liblablglade2.a] Error 2

The way I worked around this in the regular O'Caml build was by producing
an import library for the .so files (using the
"-Wl,--out-implib=lib<libname>.dll.a" flag), and then linking with
"-l<libname>", which you seem to need under Cygwin but not under Linux.

> Not sure what I'm missing here.
>
> I'm sure that it works before without changing too much of the
> original lablgtk2 Makefile contents, now it seems I cannot find a
> solution in less than ten minutes;)

Before ocamlmklib probably produced a static library version...

> I've updated my version:
> http://194.95.224.180/cygwin/lablgtk/
>
> get the patch and the script and  fetch the source from
> http://wwwfun.kurims.kyoto-u.ac.jp/soft/olabl/lablgtk.html if you not
> have it already and try to build it, maybe useful to debug the
> problems (I believe that it is OCaml internal).
>
> Gerrit

One solution is to munge the lablgtk build scripts for now (I had to do it
with labltk, see the patch in the source package).  Eventually I'll need
to fix ocamlmklib to "do the right thing"(tm), but until then it'll have
to be done on a package-by-package basis. :-(
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"Happiness lies in being privileged to work hard for long hours in doing
whatever you think is worth doing."  -- Dr. Jubal Harshaw


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]