failed complie for the 1st C++ program

Ajay Bansal Ajay_Bansal@infosys.com
Wed Feb 5 07:44:00 GMT 2003


Try compiling with g++.

-----Original Message-----
From: etc waju [mailto:etcwaju@yahoo.com] 
Sent: Wednesday, February 05, 2003 12:17 PM
To: gcc-help@gcc.gnu.org
Subject: failed complie for the 1st C++ program


Hi
I am new to GCC, and I installed it on a Sun Workstation which was
successful. But when I tried to compile my very first C++ program, I got
some not-understood errors.

Any help is much appreciated.

My program is really simple:

#include <iostream>
using namespace std;
int main()
{ cout << "Good morning.";
  return 0;
}

while I got quite some errors:

Undefined                       first referenced
 symbol                             in file
std::ios_base::Init::~Init [in-charge]()/var/tmp//ccK4GUO5.o
std::ios_base::Init::Init[in-charge]()/var/tmp//ccK4GUO5.o
std::cout                           /var/tmp//ccK4GUO5.o
std::basic_ostream<char, std::char_traits<char> >& std::operator<<
<std::char_traits<char>
>(std::basic_ostream<char, std::char_traits<char> >&, char 
>const*)/var/tmp//ccK4GUO5.o
__gxx_personality_v0                /var/tmp//ccK4GUO5.o
ld: fatal: Symbol referencing errors. No output written to a.out
collect2: ld returned 1 exit status


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com



More information about the Gcc-help mailing list