automake
[Top][All Lists]
Advanced

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

Re: object order from makefile.am


From: Ralf Wildenhues
Subject: Re: object order from makefile.am
Date: Mon, 19 Jul 2010 07:41:01 +0200
User-agent: Mutt/1.5.20 (2010-04-22)

Hello,

* D Haley wrote on Sun, Jul 18, 2010 at 11:11:45PM CEST:
> I have got autotools working for my project under windows and mac, no
> problem; however I am trying to use it under Msys on windows.
> 
> I have a problem where the following command wont work:
> 
> g++ -g -lfoo -lbar  -o myfoo.exe myfoo.o
> 
> this fails with undefined references; however
> 
> g++ -g myfoo.o -lfoo -lbar  -o myfoo.exe 
> 
> works just fine.
> 
> My "solution" is currently to edit the Makefile after ./configure; I modify 
> myfoo_LINK = $(CXXLD) $(myfoo_CXXFLAGS) $(CXXFLAGS) \
>       $(quick3D_LDFLAGS) $(LDFLAGS) -o $@
> to 
> myfoo_LINK = $(CXXLD) $(myfoo_OBJECTS) $(myfoo_CXXFLAGS) $(CXXFLAGS) \
>       $(quick3D_LDFLAGS) $(LDFLAGS) -o $@

The solution is to put -lfoo and -lbar in myfoo_LDADD or in LIBS, not in
*LDFLAGS.  The latter are valid only for other link flags.  See info
Automake Linking.

Cheers,
Ralf



reply via email to

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