automake
[Top][All Lists]
Advanced

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

Re: Linking in C++ mode


From: Earnie Boyd
Subject: Re: Linking in C++ mode
Date: Sun, 10 Nov 2002 18:50:47 -0500
User-agent: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.1) Gecko/20020826

John Levon wrote:
On Sun, Nov 10, 2002 at 01:01:08PM +0100, Ralf Corsepius wrote:


You could always just add -lstdc++ to the oprofiled_LDADD variable.

This would be a fault, IMO.


Why?


I do not think getting gcc to link -lstdc++ is a good idea either, but
it doesn't have much more hack value than the solution you propose below
IMHO.


It's the hack that using g++ performs.


The problem is trying to link a c-program against a c++-library. This
doesn't work in general, esp. not with g++, unless such a c++ library is
specially designed for such purposes.


Well, g++ does the same extension filtering that gcc does. It will compile .c as C and .C, .cc, .cxx, .cpp as C++. If either finds source in the form of the other then the compilation type is changed.

-8<-

This seems IMHO to be a terrible hack. I've found automake to be quite
flexible so far; am I hitting one of its limitations ?


Another solution would be to use a BUILD_CC variable. Set BUILD_CC to the value of $(CC) for C and the value of $(CXX) for C++ and use $(BUILD_CC) in the rules.

Earnie.





reply via email to

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