Re: Dynlink with C++ source
Subject: Re: Dynlink with C++ source
Newsgroups: gmane.comp.lang.ocaml.beginners
Date: 2008-11-21 15:55:08 GMT
Hi,
Thanks for the reply. In the meantime I managed to track down
the problem. Remember that I was using ocamlmklib to automate
the generation of the libraries:
blahcaml.cma: blahtex_stubs.o blahcaml.cmo
ocamlmklib -verbose -o blahcaml -oc blahcaml -cclib -lstdc++ $+
These are the actions taken by ocamlmklib:
+ gcc -shared -o ./dllblahcaml.so blahtex_stubs.o -L/home/dario/.godi/lib -Wl,-rpath,/home/dario/.godi/lib
+ ar rc ./libblahcaml.a blahtex_stubs.o; ranlib ./libblahcaml.a
+ ocamlc -a -o blahcaml.cma blahcaml.cmo -dllib -lblahcaml -cclib -lblahcaml -ccopt -L/home/dario/.godi/lib -ccopt -Wl,-rpath,/home/dario/.godi/lib -cclib -lstdc++
The problem is that ocamlmklib does not pass the -cclib -lstdc++
parameters to the first invocation of gcc. When I do it manually
then everything works. I'm filing this as a bug.
On a side note: how is the path /home/dario/.godi/lib obtained?
Sure, I can run `ocamlc -where` and remove the last two directories,
but I'm guessing there's a cleaner way, right?
Cheers,
Dario
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch format to Traditional
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe
__,_._,___

RSS Feed