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
Static linking
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-11-09 (17:28)
From: Basile STARYNKEVITCH <basile@s...>
Subject: Re: [Caml-list] Static linking

Hello All,

Le Wed, Nov 09, 2005 at 06:14:00PM +0100, Maurizio Colucci écrivait/wrote:
> I gave an executable, compiled with ocamlopt, to a friend of mine, and
> his system complained about a missing library (
> This library is not available for his linux distribution. How can I
> compile the program by embedding the library in the executable? 

If your system has a static version of libgtkgl (eg on Debian/Sid the
libgtkgl2.0-dev package provides /usr/lib/libgtkgl-2.0.a) you could
pass the "-cclib /usr/lib/libgtkgl-2.0.a" option (without the quotes)
to ocamlopt.

But for this particular library, I believe things are much less simple
in practice, because I think that gtkgl depends upon many other shared

You might also consider passing the "-ccopt -static" option to
ocamlopt linking.

Again, GTKGL is not supposed (as GTK) to be statically linked...

Maybe the simplest solution is to find the suitable (rpm or other)
package of libgtkgl for your user!


email: basile(at)starynkevitch(dot)net 
8, rue de la Faïencerie, 92340 Bourg La Reine, France