Date: Fri, 13 Mar 1998 17:22:59 -0800 (PST) Message-Id: <199803140122.RAA06055@adit.ap.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" To: crazor AT mail DOT execpc DOT com, djgpp AT delorie DOT com From: Nate Eldredge Subject: Re: Link the object files Precedence: bulk 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 > >void main(void) { > cout << "hello...test" << endl; >} ANSI requires that `main' return `int'. Nate Eldredge eldredge AT ap DOT net