Date: Fri, 20 May 1994 13:27:46 -0600 From: Mike Romberg To: djgpp AT sun DOT soe DOT clarkson DOT edu Subject: problems with ar / ld I am having a problem which involves g++ and Gnu versions of ar and ld. This problem does not seem to be specific to djgpp but I thought someone out there might be able to help me out. What I amd trying to do involves two libraries which are to be linked into a third bit of code. Some sample code ( which demonstrates my problem ) look like : ================lib1.a sources============================ ---file1.h------ class A { public: virtual void fn1( void ); protected: virtual void fn2( void ){} }; class B : public A { protected: void fn2( void ); }; ----file1.cc------ #include "file1.h" #include void A::fn1( void ){ cerr <<"A::fn1() calling fn2" <fn2(); } void B::fn2( void ){ cerr <<"B::fn2()" < main() { cerr <<"main() calling b.fn1()" < a.out main() calling b.fn1() A::fn1() calling fn2 Segmentation fault So I am wondering if I am making an error in the use of the library tools, or there is a bug in g++, ar, or ld. The program does run as expected if the object files are all linked directly ( ex g++ *.o ). Any help would be appreciated. Mike Romberg ( romberg AT spot DOT colorado DOT edu )