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 libraries [pcre-ocaml]
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Richard Nyberg <rnyberg@i...>
Subject: [Caml-list] shared libraries [pcre-ocaml]
Hello I've some problems with ocaml and shared libraries. I'm running
a recent FreeBSD-4-STABLE and have ocaml 3.04 installed from ports.

pcre-ocaml is built with shared libraries and is installed in

ocaml's ld.conf contains the following lines:


If I use ocamlopt to compile everything is fine but when I use ocamlc
the following error occurs.

# ocamlc -o myprog -I +site-lib/netstring -I +site-lib/pcre \
         unix.cma pcre.cma netstring.cma

Error on dynamically loaded library: Shared object "" not found

I ran truss to see the syscalls made by ocamlc (relevant bit below) and
to me it seems as if it finds but not on which depends. However if I run ldconfig to include pcre-ocaml's
installation directory everything works just fine.

So, should I have to use ldconfig or is there something wrong?

stat("/usr/local/lib/ocaml/site-lib/netstring/",0xbfbff524) ERR#2 'No 
such file or directory'
stat("/usr/local/lib/ocaml/site-lib/pcre/",0xbfbff524) = 0 (0x0)
sigprocmask(0x1,0x28072c80,0xbfbff4e4)           = 0 (0x0)
open("/usr/local/lib/ocaml/site-lib/pcre/",0x0,056) = 6 (0x6)
fstat(6,0xbfbff494)                              = 0 (0x0)
read(0x6,0xbfbfe464,0x1000)                      = 4096 (0x1000)
mmap(0x0,12288,0x5,0x2,6,0x0)                    = 672776192 (0x2819c000)
mmap(0x2819e000,4096,0x3,0x12,6,0x1000)          = 672784384 (0x2819e000)
close(6)                                         = 0 (0x0)
access("/usr/local/lib/ocaml/contrib/",0) ERR#2 'No such file or dir
access("/usr/lib/",0)                ERR#2 'No such file or director
access("/usr/lib/compat/",0)         ERR#2 'No such file or director
access("/usr/X11R6/lib/",0)          ERR#2 'No such file or director
access("/usr/local/lib/",0)          ERR#2 'No such file or director
access("/usr/lib/elf/",0)            ERR#2 'No such file or director
access("/usr/lib/",0)                ERR#2 'No such file or director

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