automake
[Top][All Lists]
Advanced

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

Re: Linking in C++ mode


From: Alexandre Duret-Lutz
Subject: Re: Linking in C++ mode
Date: Thu, 14 Nov 2002 12:40:29 +0100
User-agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/20.7 (i386-debian-linux-gnu)

>>> "Ralf" == Ralf Corsepius <address@hidden> writes:

[...]

 Ralf> 2. Finding a way to convince automake to using "g++" to link a you
 Ralf> program. 

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

 Ralf> One way to work around this problem is renaming your "main" a c++ file
 Ralf> name. Another way is to dive into automake internals and to override the
 Ralf> linker (CXXLINK and CXXLD vs CCLINK and CCLD).

You can override the LINK command on a per-program basis:

bin_PROGRAMS = foo
foo_SOURCES = foo.c
foo_LINK = $(CXX) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@

-- 
Alexandre Duret-Lutz





reply via email to

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