From: "John M. Aldrich" Newsgroups: comp.os.msdos.djgpp Subject: Re: Standard libraries question Date: Sat, 17 Jan 1998 14:02:08 -0500 Organization: Two pounds of chaos and a pinch of salt. Lines: 49 Message-ID: <34C10030.154B@cs.com> References: <1117ce$1382a DOT 4e AT news DOT alberni DOT net> NNTP-Posting-Host: ppp245.cs.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk wolfman AT cedar DOT alberni DOT net wrote: > > Hello, I use DJGPP 2.01 (with the 2.8.1 bin utils, but I don't think that > matters.) with rhide 1.4. I compile for C++ which means that the command line > used is: > > gcc -x c++ [options] [files] > > Anywho, my question is what are the standard libraries that are linked when > doing this. It seems that libiostr.a is linked because I have no trouble > using cout and cin, but is libgpp.a linked. I ask this because of the lisence > restrictions on it. I don't recommend using the "-x " option unless you are unable to get your programs to compile properly without it. The 'readme.1st' file tells you how to link the C++ libraries when compiling C++ programs; the command line you posted should _not_ work because you aren't linking any libraries. If you want to allow gcc to link the libraries for you, simply use 'gxx' instead of 'gcc' to compile. If you want to control them yourself, you can use 'gcc', but add any or all of the following: "-liostr", "-lgpp", "-lstdcx". If you want to avoid the LGPL'd libgpp.a, simply omit it and use the other two, and if you still get any unresolved symbols, you'll have to either use libgpp.a, or code the symbols yourself. > Also, I am wondering what lib 'new' and 'delete' are in. I'm not sure. If it's not defined when you link libiostream.a and libstdcxx.a, then it's in libgpp.a. :-) > And one more thing... if libgpp.a is linked, how can I stop it from being > linked? Invoke gcc and tell it specifically what libs to link. If you use RHIDE, you can control which C++ libraries get linked automatically, I think. > Thanks for any help. hth -- --------------------------------------------------------------------- | John M. Aldrich | "Democracy is based on the assumption| | aka Fighteer I | that a million men are wiser than one| | mailto:fighteer AT cs DOT com | man. How's that again? I missed | | http://www.cs.com/fighteer | something." - Lazarus Long | ---------------------------------------------------------------------