Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Shared library problem (newbi)
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jacques Garrigue <garrigue@k...>
Subject: Re: [Caml-list] Shared library problem (newbi)
From: Lionel Sacks <>

> Problem is this; I'm trying to install/run nab on my little iBookG4/Panther.
> It requires ocaml, gtk and lablgtk.
> I've used fink to install ocaml (3.07+2) and gtk (1.2.10)
> Lablgtk comes from
> Complied and installed my self (version 1.2.7)
> So far so good. Test/demo progs work. Labgtk and gtk are v.1 as required (I
> haven't installed the v.2 series)
> Nab compiles fine and the command line version works OK.
> However, when I try to run the graphical version (that uses the tcltc/labtk
> etc).

You got me confused here: you're using lablgtk, not labltk...

> lsacks$ ./bin/nabviz-top
> Fatal error: cannot load shared library dllstr
> Reason: dyld: ocamlrun multiple definitions of symbol _re_partial_match
> /sw/lib/ocaml/stublibs/ definition of _re_partial_match
> /sw/lib/ocaml/stublibs/ definition of _re_partial_match

Interesting problem. Looking at the Makefile the cause is clear:
str.cma is linked twice in nabviz-top. Apparently, OSX's dyld doesn't
like to open the same dll twice. Will have to do something about it.
By the way, the fink discussion is irrelevant here: ocaml will use the
same dynamic loading whether you use fink or not (or I hope so.)

I join a patch for nab's Makefile.

More generally, when you have problems with dynamic loading, the
fastest way to solve them is to add -custom in the linking step.
This also solves the problem in this case.


Jacques Garrigue 

--- Makefile	Wed Aug 18 11:37:35 2004
+++	Wed Aug 18 11:44:54 2004
@@ -103,8 +103,8 @@
 THREADS_LIB = $(LIB_DIR)/threads/threads$(CMA)
-GTK_LIBS = $(GTK_DIR)/lablgtk$(CMA) $(UNIX_LIB) $(STR_LIB)
+GTK_LIBS = $(GTK_DIR)/lablgtk$(CMA) $(UNIX_LIB)
 GTK_TH_OBJS =  $(GTK_DIR)/gtkThread$(CMO)  $(GTK_DIR)/gtkInit$(CMO) $(GTK_DIR)/gtkThInit$(CMO)

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: