Problems linking c++ class libraries

Mark L. Wise mark@alpha2.com
Sun Aug 24 19:17:00 GMT 2003


Hello all!

I am relatively new to c++ and I have a question regarding linking class
libraries.

I have a "main line" program that calls a class out of a library (A) that I
built.  This class library also calls classes out of another library (B).
When I try to link I get an unresolved call to <the class name> class
(library B) that I call in library "A".

HOWEVER, If I include a "dummy" call in my "mainline" program to the class
in library "B", then the link from library "A" completes to library "B" and
the program runs.

Why do I have to include a reference call to the class in library "B" in my
mainline program to get it the linker to resolve the link?

Thanks in advance for any advice!!

Mark



More information about the Gcc-help mailing list