vead
Full Member level 5
Hello
I was trying to compile basic c++ program on GCC compiler but when I compile program. Compiler show some error
Program code
Error
What's the reason ? How to solve problem ?
I was trying to compile basic c++ program on GCC compiler but when I compile program. Compiler show some error
Program code
Code:
#include <iostream>
using namespace std;
int main(void)
{
cout << "Hello, World!";
return 0;
}
C:\Users\Mr Embedded\Desktop>gcc -o exm exm.cpp
C:\Users\MREMBE~1\AppData\Local\Temp\ccYk0frH.o:exm.cpp.text+0x19): undefined reference to `std::cout'
C:\Users\MREMBE~1\AppData\Local\Temp\ccYk0frH.o:exm.cpp.text+0x1e): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std:perator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
C:\Users\MREMBE~1\AppData\Local\Temp\ccYk0frH.o:exm.cpp.text+0x35): undefined reference to `std::ios_base::Init::~Init()'
C:\Users\MREMBE~1\AppData\Local\Temp\ccYk0frH.o:exm.cpp.text+0x56): undefined reference to `std::ios_base::Init::Init()'
collect2.exe: error: ld returned 1 exit status
What's the reason ? How to solve problem ?