Bonjour,
1)Pourquoi, en faisant make -k , j'ai les erreurs:
make -k
gcc exo1.cpp
/tmp/ccCpRzZy.o: In function `std::__verify_grouping(char const*, unsigned int, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
exo1.cpp.text+0xe): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::size() const'
exo1.cpp.text+0x59): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator[](unsigned int) const'
exo1.cpp.text+0x97): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator[](unsigned int) const'
exo1.cpp.text+0xdf): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator[](unsigned int) const'
/tmp/ccCpRzZy.o: In function `__static_initialization_and_destruction_0(int, int)':
exo1.cpp.text+0x129): undefined reference to `std::ios_base::Init::Init()'
/tmp/ccCpRzZy.o: In function `__tcf_0':
exo1.cpp.text+0x176): undefined reference to `std::ios_base::Init::~Init()'
/tmp/ccCpRzZy.o: In function `f()':
exo1.cpp.text+0x19a): undefined reference to `pow'
/tmp/ccCpRzZy.o: In function `main':
exo1.cpp.text+0x1ff): undefined reference to `std::cout'
exo1.cpp.text+0x204): undefined reference to `std::basic_ostream<char, std::char_traits<char> >::operator<<(int)'
exo1.cpp.text+0x20c): 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> >&)'
exo1.cpp.text+0x214): 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/ccCpRzZy.o.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status
make: *** [all] Erreur 1
2)En C++, peut-on écrire tout le code(classes ,fonctions,main) en 1 seul fichier.cpp:sans header?
Partager