Mail Archives: djgpp/1998/03/13/20:23:29
At 10:41 3/13/1998 -0600, crazor AT mail DOT execpc DOT com wrote:
>Hi, I use gcc -o exe_file obj_file.o
>to link the object file, but I got error like this
>
>hello.o(.text+0x14):hello.cpp:undefined reference to 'endl(ostream&)'
>hello.o(.text+0x1e):hello.cpp:undefined reference to 'cout'
>hello.o(.text+0x23):hello.cpp:undefined reference to 'ostream::operator<<(char
>const *)'
Like README.1ST tells you, when linking C++, you should use the `gxx'
command instead of `gcc' so that the C++ libraries get linked.
>
>My c++ code is simple like this
>#include <iostream.h>
>
>void main(void) {
> cout << "hello...test" << endl;
>}
ANSI requires that `main' return `int'.
Nate Eldredge
eldredge AT ap DOT net
- Raw text -