[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: linking against c++ shared library built using autoconf (and libtool

From: Ludovic Courtès
Subject: Re: linking against c++ shared library built using autoconf (and libtool)
Date: Thu, 15 Jul 2004 09:34:44 +0200
User-agent: Mutt/1.5.4i [Guile enabled]


Yesterday, 14 hours, 14 minutes, 58 seconds ago, Wil Turner wrote:
> Looking over the output when the library is built, I notice that all of 
> the link steps are done using gcc instead of g++, but I'm not sure 
> where to change this in; g++ *is* used for the .cc -> .o 
> steps. Is there a variable that can be set to change the compiler used 
> for these steps, or am I doing something else wrong? The documentation 
> doesn't seem to mention this problem at all.

I personally use the following trick in the `' that actually
links against a C++ library:

  CC = $(CXX)

AFAIK, this is the only portable way to link, eg. a C program against a
C++ library (using `cc -lstdc++' works with GNU C++ but other C++
environments do not necessarily have `libstdc++').  In order to link
against a C++ library without having a C++ compiler, one needs to have
`libstdc++' (or equivalent) statically linked into the C++ library.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]