LINUX.ORG.RU

Проблемы с gcc в Mandrake 10.1


0

0

Помогите разобраться, что случилось с gcc, просто в прошлой жизни системы таких проблем не было и я не знаю, что делать! а код программы qqq.cpp :

#include <iostream.h> int main() { cout <<"Hello world!\n"; retirn 0; }

[nettoy@localhost nettoy]$ gcc qqq.cpp In file included from /usr/lib/gcc/i586-mandrake-linux-gnu/3.4.1/../../../../include/c++/3.4.1/backwar d/iostream.h:31, from qqq.cpp:1: /usr/lib/gcc/i586-mandrake-linux-gnu/3.4.1/../../../../include/c++/3.4.1/backwar d/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <iostream> instead of the deprecated header <iostream.h>. To disable this warning use -Wno-deprecated. /home/nettoy/tmp/ccuc41Tg.o(.text+0xd): In function `std::__verify_grouping(char const*, unsigned 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::allocator<char> >::size() const' /home/nettoy/tmp/ccuc41Tg.o(.text+0x60): In function `std::__verify_grouping(char const*, unsigned 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::allocator<char> >::operator[](unsigned int) const' /home/nettoy/tmp/ccuc41Tg.o(.text+0x9d): In function `std::__verify_grouping(char const*, unsigned 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::allocator<char> >::operator[](unsigned int) const' /home/nettoy/tmp/ccuc41Tg.o(.text+0xc8): In function `std::__verify_grouping(char const*, unsigned 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::allocator<char> >::operator[](unsigned int) const' /home/nettoy/tmp/ccuc41Tg.o(.text+0x129): In function `main': : undefined reference to `std::cout' /home/nettoy/tmp/ccuc41Tg.o(.text+0x12e): 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*)' /home/nettoy/tmp/ccuc41Tg.o(.text+0x15a): In function `__static_initialization_and_destruction_0(int, int)': : undefined reference to `std::ios_base::Init::Init()' /home/nettoy/tmp/ccuc41Tg.o(.text+0x189): In function `__tcf_0': : undefined reference to `std::ios_base::Init::~Init()' /home/nettoy/tmp/ccuc41Tg.o(.eh_frame+0x11): undefined reference to `__gxx_personality_v0' collect2: ld returned 1 exit status


---
#include <iostream> 
using std::cout;
using std::endl;
int main() 
{ 
  cout << "Hello world!" << endl; 
  return 0; 
}
---
g++ test.cpp -o test

1) retirn -> return
2) iostream.h -> iostream (об это, кстати, компилятор сообщает)
3) gcc -> g++, потому что код C++

phoenix ★★★★
()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.