freeindy |
02-11-2005 09:19 AM |
compiling simple c/c++ program but no good
Hi!
Now, i have looked all through this forum but i still canīt find solution. I'm using suse 9.1 with gcc ver 3.3.3
the code is:
Code:
#include <iostream>
using namespace std;
int main(void)
{
unsigned int sum = 0;
cout << "Summa:";
cin >> sum;
printf("sum::%d", sum);
return 0;
}
and the error i get when i give the command gcc:
Quote:
/tmp/ccXRUxTx.o(.text+0x20): In function `main':
: undefined reference to `std::cout'
/tmp/ccXRUxTx.o(.text+0x25): In function `main':
: 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/ccXRUxTx.o(.text+0x34): In function `main':
: undefined reference to `std::cin'
/tmp/ccXRUxTx.o(.text+0x39): In function `main':
: undefined reference to `std::basic_istream<char, std::char_traits<char> >::operator>>(unsigned&)'
/tmp/ccXRUxTx.o(.text+0x78): In function `__static_initialization_and_destruction_0(int, int)':
: undefined reference to `std::ios_base::Init::Init[in-charge]()'
/tmp/ccXRUxTx.o(.text+0xa7): In function `__tcf_0':
: undefined reference to `std::ios_base::Init::~Init [in-charge]()'
/tmp/ccXRUxTx.o(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status
|
what's going on???
thanks for helping...
indy
|