automake
[Top][All Lists]
Advanced

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

libraries within libraries


From: Marco Correia
Subject: libraries within libraries
Date: Tue, 29 Apr 2003 20:10:01 +0000
User-agent: KMail/1.5

I have a library project stored like this:
-src
   |- dir1
   |- dir2 -- subdir21
             |- subdir22        
   |- dir3 

and I have noinst libraries for each dir and subdir. I want to build a static 
library libsrc.a in \src (the root) containing all the object files in the 
tree structure, so in the makefile.am of src I wrote:

libsrc_a_LIBADD = $(top_builddir)/dir1/libdir1.a 
$(top_builddir)/dir1/libdir2.a $(top_builddir)/dir2/subdir21/libsub21.a ... 
etc.

Everything compiled and linked fine and when I do an "ar -t libsrc.a" I get

some_objects_stored_in_src_dir.o
libdir1.a
libdir2.a
libsubdir21.a
... etc

Now the problem is whenever I try to link libsrc.a with an example source that 
uses the library 

g++ -g -O2 -o example1 example1.o ../library/libsrc.a

I get lots of undefined references to classes in the library in the link 
phase. 

But if I build libsrc as a shared library I have no problems of any sort.

What could be the cause of this?

thanks
Marco

Marco Correia <address@hidden>





reply via email to

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