Bonjour à tous. J´essaye depuis une heure de compiler un hello world c++ avec gcc, chose que j´ai très bien réussi à faire avec devc++ ou xlC...
Voici le contenu du fichier test.C que je veux compiler :
- include < iostream.h>
int main()
{
cout < < " Hello world" < < endl ;
}
Et voici maintenant ce que cette merde de gcc m´affiche sur la sortie standard d´erreur :
Dans le fichier inclus à partir de / usr/include/c++/3.3/backward/iostream.h:31,
à partir de test.C:1:
/usr/include/c++/3.3/backward/backward_warning.h:3
2:2: attention : #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 < sstream> instead of the deprecated header < strstream.h>. To disable this warning use -Wno-deprecated.
/ tmp/ccT5iZAJ.o(.text+0x1b): In function `main´:
: undefined reference to `std::cout´
/ tmp/ccT5iZAJ.o(.text+0x20): 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/ccT5iZAJ.o(.text+0x28): In function `main´:
: undefined reference to `std::basic_ostream<char, std::char_traits<char> > & std::endl<char, std::char_traits<char> > (std::basic_ostream<char, std::char_traits<char> > &)´
/ tmp/ccT5iZAJ.o(.text+0x30): In function `main´:
: undefined reference to `std::basic_ostream<char, std::char_traits<char> > ::operator<<(std::basic_ostream<char, std::char_traits<char> > & ( *)(std::basic_ostream<char, std::char_traits<char> > &))´
/ tmp/ccT5iZAJ.o(.text+0x59): In function `__static_initialization_and_destruction_0(int, int)´:
: undefined reference to `std::ios_base::Init::Init[in-charge]()´
/ tmp/ccT5iZAJ.o(.text+0x8a): In function `__tcf_0´:
: undefined reference to `std::ios_base::Init::~Init [in-charge]()´
/ tmp/ccT5iZAJ.o(.eh_frame+0x11): undefined reference to `__gxx_personality_v0´
collect2: ld a retourné 1 code d´état d´exécution
Remarque : je suis sous knoppix. J´ai réussi à compiler du c