Mail Archives: djgpp/1998/01/22/06:18:05
Kim,Young-Jae wrote:
>
> Hi all...
> I'm a beginner of DJGPP...
> I've received some binary files in http://www.delorie.com/dgjpp
> and installed to the directory c:\djgpp, and done all things in the
> web page describing to install...
> And I typed some source file and command to compile it...
> c:\> gcc arraynew.cpp -o arraynew.exe
> but it reports various error message, which says it cannot load
> "iostream.h"...
> I've found that "iostream.h" is in the directory "c:\djgpp\lang\cxx"
> not in the directory "c:\djgpp\include"...
>
> The following is my source code...
>
> Plz, let me know whether djgpp can compile C++ code or not !!!
>
> #include <iostream.h>
> int main(void)
> {
> double *p3 = new double[3];
> p3[2] = 0.2;
> p3[1] = 0.5;
> p3[0] = 0.8;
>
> cout << "p3[1] is " << p3[1] << ".\n";
> p3 = p3+1;
> cout << "Now p3[0] is " << p3[0] << ".\n";
> cout << "p3[1] is " << p3[1] << ".\n";
> return 0;
> }
Hi!
You must compile with options -lgpp, like this:
c:\> gcc arraynew.cc -lgpp -o arraynew.exe
Miche
- Raw text -