hi everyone !
plz help me out on this simple program i m trying to run. actually its my first compilation on my newly installed kde 4.1 and i havent explored linux much !
editor :- KWrite
program :-
#include<iostream>
using std::cout;
using std::endl;
int main()
{
cout<<"Hello, world!"<<endl;
}
when i compile it , i get this errors :-
jayant@linux-ana9:~/Documents> gcc -o hello_world hello_world.cpp
/tmp/cc9zBrFd.o: In function `main':
hello_world.cpp:(.text+0x1c): undefined reference to `std::cout'
hello_world.cpp:(.text+0x21): 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*)'
hello_world.cpp:(.text+0x29): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&)'
hello_world.cpp:(.text+0x31): undefined reference to `std::basic_ostream<char, std::char_traits<char> >::operator<<(std::basic_ostream<char, std::char_traits<char> >& (*)(std::basic_ostream<char, std::char_traits<char> >&))'
/tmp/cc9zBrFd.o: In function `__static_initialization_and_destruction_0(int, int)':
hello_world.cpp:(.text+0x60): undefined reference to `std::ios_base::Init::Init()'
hello_world.cpp:(.text+0x65): undefined reference to `std::ios_base::Init::~Init()'
/tmp/cc9zBrFd.o:(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status
well…i m not sure abt the compiling command i m giving but i m pretty much sure abt the program that its right !
so plz tell the mistake guys !
thankyou !