Date: Thu, 24 Feb 2000 06:00:59 +0600 (LKT) From: Kalum Somaratna aka Grendel X-Sender: root AT darkstar DOT grendel DOT net To: djgpp AT delorie DOT com cc: Jan Hader Subject: Re: Q: What am I doing wrong ? In-Reply-To: <38B42032.DB19F1BD@post.rwth-aachen.de> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com Errors-To: dj-admin AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Wed, 23 Feb 2000, Jan Hader wrote: > Hello there... > > I downloaded DJGPP and unzipped everything on d:\djgpp. > Now I am able to write little programs, but references to e-g iostream > do ot work, it says something about "undefined reference". > Now what should I do ? > (I have tried to copy the file iostream.h to nearly every directory of > DJGPP but it does not work) This is because you have to instruct the linker to link in the c++ library if you are using gcc to compile, otherwise the linker can't find the c++ library and you will get undefined references. You should add the -lstdcx option if you use gcc. A example compile would go like "gcc name.cc -o name.exe -lm -lstdcx" withought the quotes. Or you can use gpp.exe which will automatically link in the c++ library. > > > P.S.: I start to compile with gcc name.cc -o name.exe -lm , perhaps it > is wrong? Yes, you have to add the -lstdcx to the compile line if you use gcc... Or use gpp like "gpp name.cc -o name.exe -lm" . > P.P.S.: Dont laugh ! I started 2 days ago... No way! Good luck and I hope you enjoy DJGPP! Grendel Hi, I'm a signature virus. plz set me as your signature and help me spread :)