Undefined references with static libraries
There's a collection of classes I'm writing, and in the makefile for my project, I have it set up to create a static (.a) library. It builds and installs without any warnings or errors. There's also another project I'm working on that makes use of the library.
The problem I'm running into is that when I try to build the other project, the linker complains that there are undefined references to functions in 2 of the classes from the library.
I've checked my makefile for my library, and I have all the object files listed for the static library file:
ar rvu $(INSTALL_LIB) $(OBJS)
$(OBJS) contains the list of object files - and it does include the object files for the 2 classes about which the linker complains of undefined references (I'd rather not post all the filenames in my snippets due to copyright reasons, since this is a project for work). When I build the library file, it lists all the object files, including those 2.
Has anyone had a similar problem? Is there any reason why some object files might not be included in a library file? Or am I missing something?
Is there anything special that distinguishes these classes? Are they templates or abstract classes?
No, all of the classes are instantiable and usable. I have been able to use them in the test programs for the library, but those aren't compiled against the library file, just the object files. And all of the object files seem to be included in the library file when it's created.
|All times are GMT -5. The time now is 11:48 AM.|