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

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

 



Hi,

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 configure.ac; 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 `Makefile.am' 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.

Ludovic.


_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf

[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux