Jay Gischer (gischer++at++puget.engr.sgi.com)
Mon, 20 Apr 1998 10:52:54 -0700 (PDT)
Olivier,
Linking against a .a has different semantics than linking against a
.so. When you link against a .so, you automatically get everything
in the .so whether or not there is a current reference to it.
When you link against a .a, you only load those object files for which
there is an outstanding reference. What this means is that one of the
objects which appears *before* lptk++ must contain a reference to your
class in order for it to be loaded. Life can be even more complicated
if the routines for your class are defined in more than one object
file, in which case there would probably need to be a reference to the
particular method in question in one of the objects before "-lptk++"
to trigger loading of that method.
The solution is to either
1. Turn your .a into a dso (it isn't that hard, try "man dso") or,
2. Rearrange the order of your libraries, or
3. Use the linker flags "-all" and "-none"
"-all" will force the loading of every object file from any archives
encountered after the "-all" flag. "-none" (poorly named IMHO) turns
off "-all", returning to the normal archive semantics described above.
------------------------------------------------------------------------
Jay L Gischer + "I see great things in baseball. It's our game.
Advanced Graphics + It will repair our losses and be a blessing to
Software + us."
Silicon Graphics + -Walt Whitman
(415) 390-4277 +
gischer++at++sgi.com + "A life has no meaning except in the impact it
+ has on other lives"
+ -Jackie Robinson
=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
Submissions: info-performer++at++sgi.com
Admin. requests: info-performer-request++at++sgi.com
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:57:16 PDT