Mail Archives: djgpp/1998/12/18/19:13:32
> nilesh wrote:
>
> Hi,
> I compiled the following code (the first one in c++) to get a .o file
> but could not link it to make an EXE file. Pl. help.
>
>
> First.cpp:
>
> #include <iostream.h>
>
> main()
>
> {
>
> cout << "This is my first C++ program.";
>
> return 0;
>
> }
>
> Command Line :
> C:\>gcc -o first.exe first.o -L/djgpp/gcc281b/bin
As README.1ST tells you, use `gxx' to link C++ programs instead of
`gcc'.
And don't post in HTML.
> Error:
>
> first.o: In function `main':
> c:\first.cpp:1: undefined reference to `cout'
> c:\first.cpp(.text+0x2e): undefined reference to `ostream::operator<<
> (char const *)'
--
Nate Eldredge
nate AT cartsys DOT com
- Raw text -