This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
c++ compiling
- From: Jesus Eduardo Lidanski <jesus_edu at gmx dot net>
- To: gcc-help at gcc dot gnu dot org
- Date: Tue, 4 May 2004 00:20:22 +0200
- Subject: c++ compiling
hello!
i have a very strange problem, please help me.
i tried to compile a c++ program:
#include <iostream>
using namespace std;
int main()
{
cout << "Hello World!\n";
return 0;
}
and everything was okay ....
the next day i tried to compile another program, a basic program, but it gave
me a lot of errors, and i tried to compile another time my first program...
and i got the following errors:
jesus_edu@linux:~/Documents/C++> gcc prueba.cpp
/tmp/ccIan2q6.o(.text+0xd): In function `std::__verify_grouping(char const*,
uns
igned int, std::basic_string<char, std::char_traits<char>,
std::allocator<char>
> const&)':
: undefined reference to `std::basic_string<char, std::char_traits<char>,
std::a
llocator<char> >::size() const'
/tmp/ccIan2q6.o(.text+0x60): In function `std::__verify_grouping(char const*,
un
signed int, std::basic_string<char, std::char_traits<char>,
std::allocator<char>
> const&)':
: undefined reference to `std::basic_string<char, std::char_traits<char>,
std::a
llocator<char> >::operator[](unsigned int) const'
/tmp/ccIan2q6.o(.text+0x9f): In function `std::__verify_grouping(char const*,
un
signed int, std::basic_string<char, std::char_traits<char>,
std::allocator<char>
> const&)':
: undefined reference to `std::basic_string<char, std::char_traits<char>,
std::a
llocator<char> >::operator[](unsigned int) const'
/tmp/ccIan2q6.o(.text+0xce): In function `std::__verify_grouping(char const*,
un
signed int, std::basic_string<char, std::char_traits<char>,
std::allocator<char>
> const&)':
: undefined reference to `std::basic_string<char, std::char_traits<char>,
std::a
llocator<char> >::operator[](unsigned int) const'
/tmp/ccIan2q6.o(.text+0x127): In function `main':
: undefined reference to `std::cout'
/tmp/ccIan2q6.o(.text+0x12c): 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/ccIan2q6.o(.text+0x155): In function
`__static_initialization_and_destructi
on_0(int, int)':
: undefined reference to `std::ios_base::Init::Init()'
/tmp/ccIan2q6.o(.text+0x170): In function
`__static_initialization_and_destructi
on_0(int, int)':
: undefined reference to `std::ios_base::Init::~Init()'
/tmp/ccIan2q6.o(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status
jesus_edu@linux:~/Documents/C++>
what ist this?? how can i compile programs ? why do i get these errors?
thanks,
eduardo lidanski