Заголовочный файл



1Пишу прогу:


int main()


cout<<"Hello World!/n";


затем: $gcc hello.cpp а он мне выдает

In file included from /usr/include/c++/3.3.2/backward/iostream.h:31, from hello.cpp:1: /usr/include/c++/3.3.2/backward/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 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <sstream> instead of the deprecated header <strstream.h>. To disable this warning use -Wno-deprecated. /home/artem/tmp/ccNT86dS.o(.text+0x1d): In function `main': : undefined reference to `std::cout' /home/artem/tmp/ccNT86dS.o(.text+0x22): 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)' /home/artem/tmp/ccNT86dS.o(.text+0x4e): In function `__static_initialization_and_destruction_0(int, int)': : undefined reference to `std::ios_base::Init::Init[in-charge]()' /home/artem/tmp/ccNT86dS.o(.text+0x7d): In function `__tcf_0': : undefined reference to `std::ios_base::Init::~Init [in-charge]()' /home/artem/tmp/ccNT86dS.o(.eh_frame+0x11): undefined reference to `__gxx_personality_v0' collect2: ld returned 1 exit status

В чём же дело???


Re: Заголовочный файл

#include <iostream>

// wbr

klalafuda ★☆☆ ()

Re: Заголовочный файл

std::cout<<"Hello World!"<<std::endl;

Компилятор C++ называется g++, а не gcc.

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