Mail Archives: djgpp/2000/02/23/19:43:35
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
:)
- Raw text -