automake
[Top][All Lists]
Advanced

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

Re: Linking in C++ mode


From: John Levon
Subject: Re: Linking in C++ mode
Date: Mon, 11 Nov 2002 05:24:24 +0000
User-agent: Mutt/1.3.25i

On Mon, Nov 11, 2002 at 05:36:57AM +0100, Ralf Corsepius wrote:

> 1. Finding a way to compile your program (independently of automake). 
> 
> You are using a library written in c++, therefore a general solution is
> using "g++" to _link_ your program, even if your "main" is written in C.
> 
> Rule of thumb: If c++ is involved somewhere, invoke "g++" instead of
> "gcc" for linking.

Sure, this is exactly what we were doing, and  what we are doing now
with the dummy.cc hack.

> Automake guesses upon the linker by using file name extensions. Your
> "main" is called "*.c", so it tries to use "gcc" instead of "g++".

With no "supported" possibility of override ...

> name. Another way is to dive into automake internals and to override the
> linker (CXXLINK and CXXLD vs CCLINK and CCLD).

Seems super-fragile.

dummy.cc is working well, though I'm not going to buy it any beers if I
ever meet it ...

regards
john

-- 
"History is the slaughter-bench at which the happiness of peoples, the
 wisdom of states and the virtue of individuals have been sacrificed."
        - Hegel




reply via email to

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