Использую gcc
Параметры: gcc main.cpp
Код:
#include <iostream>
using namespace std;
int main()
{
cout << "ABC" << endl;
return 0;
}
При компиляции С++:
C:\Users\User\AppData\Local\Temp\ccXFLsb5.o:main.cpp:(.text+0x1c): 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*)'
C:\Users\User\AppData\Local\Temp\ccXFLsb5.o:main.cpp:(.text+0x2b): undefined reference to `std::ostream::operator<<(std::ostream& (*)(std::ostream&))'
C:\Users\User\AppData\Local\Temp\ccXFLsb5.o:main.cpp:(.text+0x4a): undefined reference to `std::ios_base::Init::~Init()'
C:\Users\User\AppData\Local\Temp\ccXFLsb5.o:main.cpp:(.text+0x7a): undefined reference to `std::ios_base::Init::Init()'
C:\Users\User\AppData\Local\Temp\ccXFLsb5.o:main.cpp:(.rdata$.refptr._ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_[.refptr._ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_]+0x0): 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\User\AppData\Local\Temp\ccXFLsb5.o:main.cpp:(.rdata$.refptr._ZSt4cout[.refptr._ZSt4cout]+0x0): undefined reference to `std::cout'
collect2.exe: error: ld returned 1 exit status
При компиляции си все в порядке