From: "Andrew Crabtree" Newsgroups: comp.os.msdos.djgpp Subject: Re: code under Allegro 3.0 and PG++ 1.01 Date: Thu, 12 Feb 1998 11:44:47 -0800 Organization: Hewlett Packard Lines: 35 Message-ID: <6bvjfo$677$1@rosenews.rose.hp.com> References: <199802120239 DOT SAA17009 AT adit DOT ap DOT net> <34E26B10 DOT 311692E1 AT primenet DOT com> NNTP-Posting-Host: ros51675cra.rose.hp.com Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Note - Its best to CC me on messages that might concern PGCC/PG++. I can miss ones in the newsgroup. >I get undefined reference to terminate(void) OK >and a bunch of >errors that scroll too fast for me to see. This is where NT-Emacs comes in really handy. >> What could be wrong with the >> >following 2 functions? This isn't enough for me to go off of. I need self contained samples that I can just copy to foo.cc and then work with. >I link all my .o files with -lstdcx not -lstdcxx is this ok? I am using >a makefile generated by RHIDE 1.4 I don't know if this is rhide related or not. I think it could just be the way the the libraries are getting linked in. terminate should be defined in libgcc.a. You can verify this by doing a "nm libgcc.a | grep terminate" and seeing the presence of a line with "T _terminate__Fv" in it. Now, what I guess is happening is that the c++ libs come later on the command line than libgcc.a, these c++ libs reference terminate, and that the object file that includes the definition of terminate is never getting linked in because it wasn't needed at the time that the linker looked at it. Typically it is linked like "-lgcc -lc -lgcc". Ideally the c++ libs would go inside a -lgcc pair as well. If they came later then this could explain the trouble. Try adding an additional -lgcc at the end of your link line and see if that fixes the problem. Or better perhaps post the compile and link line that rhide is using. Andy