View Full Version : [SOLVED] having trouble with gcc

March 4th, 2008, 06:15 PM
here is a piece of code i tried to execute but it wont
vikasmk@vikasmk:~$ gcc vikas.cpp
/tmp/ccTd1Wsq.o: In function `__static_initialization_and_destruction_0(int, int)':
vikas.cpp:(.text+0x23): undefined reference to `std::ios_base::Init::Init()'
/tmp/ccTd1Wsq.o: In function `__tcf_0':
vikas.cpp:(.text+0x6c): undefined reference to `std::ios_base::Init::~Init()'
/tmp/ccTd1Wsq.o: In function `main':
vikas.cpp:(.text+0x8e): undefined reference to `std::cout'
vikas.cpp:(.text+0x93): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
/tmp/ccTd1Wsq.o:(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status[CODE]

heres the c++ code
using namespace std;
int main()
{ cout<<"printing stuff";

can any one tell me whats wrong

March 4th, 2008, 06:31 PM
Just use g++ direct for compiling C++ apps instead of the gcc-wrapper and everything works fine.


March 4th, 2008, 06:44 PM
ok it worked , geez i'm feelin really stupid:)