This question already has an answer here:
#Include<iostream>
using namespace std;
// A C++ Program to output a greeting.
int main()
{
cout << "Hello World!" << endl ;
return 0 ;
}
Microsoft Windows [Version 10.0.16299.431] (c) 2017 Microsoft Corporation. All rights reserved.
C:\Users\Ehizojie>cd c:/myprograms
c:\MyPrograms>gcc hello.cpp C:\Users\Ehizojie\AppData\Local\Temp\ccwSXPQe.o:hello.cpp:(.text+0x21): undefined reference to std::cout' C:\Users\Ehizojie\AppData\Local\Temp\ccwSXPQe.o:hello.cpp:(.text+0x26): undefined reference to
std::basic_ostream >& std::operator<< >(std::basic_ostream >&, char const*)' C:\Users\Ehizojie\AppData\Local\Temp\ccwSXPQe.o:hello.cpp:(.text+0x2d): 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> >&)' C:\Users\Ehizojie\AppData\Local\Temp\ccwSXPQe.o:hello.cpp:(.text+0x34): undefined reference to
std::ostream::operator<<(std::ostream& (*)(std::ostream&))' C:\Users\Ehizojie\AppData\Local\Temp\ccwSXPQe.o:hello.cpp:(.text+0x54): undefined reference to std::ios_base::Init::~Init()' C:\Users\Ehizojie\AppData\Local\Temp\ccwSXPQe.o:hello.cpp:(.text+0x75): undefined reference to
std::ios_base::Init::Init()' collect2.exe: error: ld returned 1 exit status
c:\MyPrograms>
Aucun commentaire:
Enregistrer un commentaire