Errors?

Hi,
When I compile my program I get an error saying i have undefined references and I don't know why this is happening. This is the whole error:

1
2
3
4
5
6
7
8
9
10
11
12
/tmp/user/2155499/ccmUWss9.o: In function `main':
A3Part1.cpp:(.text+0x17): undefined reference to `std::cin'
A3Part1.cpp:(.text+0x1c): undefined reference to `std::basic_istream<char, std::char_traits<char> >::operator>>(unsigned int&)'
A3Part1.cpp:(.text+0x26): undefined reference to `std::cout'
A3Part1.cpp:(.text+0x2b): undefined reference to `std::basic_ostream<char, std::char_traits<char> >::operator<<(unsigned int)'
A3Part1.cpp:(.text+0x38): 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/user/2155499/ccmUWss9.o: In function `__static_initialization_and_destruction_0(int, int)':
A3Part1.cpp:(.text+0x8e): undefined reference to `std::ios_base::Init::Init()'
A3Part1.cpp:(.text+0x93): undefined reference to `std::ios_base::Init::~Init()'
/tmp/user/2155499/ccmUWss9.o:(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status
Last edited on
Check whether header <iostream> (not <iostream.h>) is included.
yes it is included
It looks like the linker can not find appropriate libraries.
do you know what i need to do about it?
What compiler are you using? Looks like it could be g++. What platform are you using?
I'm using gcc -std=c++0x P1.cpp (gcc P1.cpp doesn't work properly) and I'm compiling it in unix
Topic archived. No new replies allowed.