Re: automake



On Fri, 2005-01-21 at 13:01 +0100, Antonio Coralles wrote:
> Andreas Pokorny wrote:
> 
> > On Fri, Jan 21, 2005 at 02:22:21AM +0100, Antonio Coralles 
> > <noche suapie reflex at <mailto:>> wrote:
> >> I know that this question doesn't really belong to this mailing list,
> >> but i don't know where to ask instead....
> >> Can somebody tell me whats wrong with this Makefile.am:
> >>
> >> LDADD = -lboost_date_time -lsqlite
> > That wont work properly, you should let configure figure out the proper
> > linker flags for boost and sqlite. For boost you could use that m4
> > macro:
> > http://aspn.activestate.com/ASPN/Mail/Message/2266862
> 
> Thanks, I'll try that when the moment the rest is working.
> 
> > Also have a look at Murrays autotools tutorials
> > http://www.openismus.com/documents/linux/automake/automake.shtml
> 
> Yes, I read that tutorials which are great. But the problem is that I 
> used simple makefiles in my project till now [I started last august], so 
> the directory structure is not really optimal for automake because the 
> directories depend on each other. At first I tried to make static 
> archives in every subdirectory - like Murray suggests in his tutorial. 
> But this resulted in undefined referneces from the linker which partly 
> vanished when I changed the order in which the libs are linked into an 
> executable. This lead me to the assumption [which is propably wrong] 
> that static archives should not contain undefined references. Maybe I 
> should eaven reorganize my code into independent peaces which can be put 
> into a tempory library without problems - but that would be some work, 
> as all the include statements have to be changed than ...

Order of library linkage does matter.  If libA depends on code from
libB, then libA comes before libB in the link line.  If you have mutual
dependences (not good, but it does happen), then you do something like
libA libB libA

This is not anything special, just normal linker rules.




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