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


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

template instantiations in archive files?


Hi - 


I have a project that is setup somewhat like this:

~/src/proj:

        App/
                App.h
                App.cpp

        Blib/
                B1.h
                B1.cpp
                B2.h
                B2.cpp

        Clib/
                C1.h
                C1.cpp
                C2.h
                C2.cpp

All of the .cpp files use templates.

What I want to do is compile and generate libraries for each of the lib
directories, and then link them into the main app:

        B1.o B2.o --> libB.a; C1.o C2.o --> libC.a;
        App.o -lB -lC --> app

I have been developing this project for a while under IRIX and Solaris
using their native compilers and linkers, and after playing with some CC
options, was able to get this to work (mainly by telling the linker to 
load all the defs from the archive files all at once). I now have a great 
Linux machine, so I need to figure out how to get egcs to recognize where 
to find the template instantiations for the .a files so everything can 
link correctly.


I think that compiling with -frepo can help, but since I don't think I
can link the rpo files into the libraries, I am not sure how to proceed.

I suppose I could just give up the directory structure and libs, and
just have all the source in one directory, but I was hoping for
something nicer than this.


Dan






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