caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Linking with libstdc++.so
@ 2010-06-28 21:13 Guillaume Yziquel
  2010-06-28 21:50 ` Michael Ekstrand
  0 siblings, 1 reply; 3+ messages in thread
From: Guillaume Yziquel @ 2010-06-28 21:13 UTC (permalink / raw)
  To: caml-list

Hello.

I've been trying to compile a library with C++. With something like:

ocamlc -verbose -a -dllib dllmystuff_stubs.so -dllib libstdc++ -o myStuff.cma myStuff.cmo

However, on Debian systems, there is a libstdc++.so.5 and a libstdc++.so.6 file. No 
libstdc++.so file. So the -dllib libstdc++ option doesn't locate properly the library. How do you 
manage to have more control over the name of the library without resorting to using an ugly 
symlink in /usr/lib/ocaml/stublibs?

All the best,

Guillaume Yziquel.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Linking with libstdc++.so
  2010-06-28 21:13 Linking with libstdc++.so Guillaume Yziquel
@ 2010-06-28 21:50 ` Michael Ekstrand
  2010-06-29  6:19   ` [Caml-list] " Török Edwin
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Ekstrand @ 2010-06-28 21:50 UTC (permalink / raw)
  To: caml-list

On 06/28/2010 05:13 PM, Guillaume Yziquel wrote:
> Hello.
> 
> I've been trying to compile a library with C++. With something like:
> 
> ocamlc -verbose -a -dllib dllmystuff_stubs.so -dllib libstdc++ -o myStuff..cma myStuff.cmo
> 
> However, on Debian systems, there is a libstdc++.so.5 and a libstdc++.so.6 file. No 
> libstdc++.so file. So the -dllib libstdc++ option doesn't locate properly the library. How do you 
> manage to have more control over the name of the library without resorting to using an ugly 
> symlink in /usr/lib/ocaml/stublibs?
> 
> All the best,

I have been able to link against libstdc++ by using -lstdc++ (rather
than -dllib).  This is on an Ubuntu machine with the standard
development packages installed.  Also, I use ocamlmklib rather than
directly running ocamlc to build my cma file; I don't expect that this
makes a difference for this particular problem, but is something worth
considering (and IMO easier).

- Michael


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Caml-list] Re: Linking with libstdc++.so
  2010-06-28 21:50 ` Michael Ekstrand
@ 2010-06-29  6:19   ` Török Edwin
  0 siblings, 0 replies; 3+ messages in thread
From: Török Edwin @ 2010-06-29  6:19 UTC (permalink / raw)
  To: caml-list

On Mon, 28 Jun 2010 17:50:48 -0400
Michael Ekstrand <michael@elehack.net> wrote:

> On 06/28/2010 05:13 PM, Guillaume Yziquel wrote:
> > Hello.
> > 
> > I've been trying to compile a library with C++. With something like:
> > 
> > ocamlc -verbose -a -dllib dllmystuff_stubs.so -dllib libstdc++ -o
> > myStuff..cma myStuff.cmo
> > 
> > However, on Debian systems, there is a libstdc++.so.5 and a
> > libstdc++.so.6 file. No libstdc++.so file. So the -dllib libstdc++
> > option doesn't locate properly the library. How do you manage to
> > have more control over the name of the library without resorting to
> > using an ugly symlink in /usr/lib/ocaml/stublibs?
> > 
> > All the best,
> 
> I have been able to link against libstdc++ by using -lstdc++ (rather
> than -dllib).

Yes that works because there is a libstdc++.so symlink, just not
in /usr/lib:
/usr/lib/gcc/x86_64-linux-gnu/4.4.4/libstdc++.so
-> ../../../libstdc++.so.6

It is in a compiler-specific directory, so for your old compiler it'd
probably symlink to libstdc++.so.5, and for the current compiler it'd
symlink to libstdc++.so.6.

Best regards,
--Edwin


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-06-29  6:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-28 21:13 Linking with libstdc++.so Guillaume Yziquel
2010-06-28 21:50 ` Michael Ekstrand
2010-06-29  6:19   ` [Caml-list] " Török Edwin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).