This is the mail archive of the automake@gnu.org mailing list for the automake project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

libraries within libraries


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 <mvc@netcabo.pt>




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]