#include <iostream>
using namespace std;
int main()
{
int a;
int n = 2017;
cout << "You date birth: "<<endl;
cin >>a;
cout <<"Your age is "<< n - a << endl;
return 0;
}
ошибка компилятора...
C:\Users\Gor\AppData\Local\Temp\ccC9WmMU.o:havayi1.cpp:(.text+0x29): undefined reference to 'st d::cout' C:\Users\Gor\AppData\Local\Temp\ccC9WmMU.o:havayi1.cpp:(.text+0x2e): undefined reference to 'st d::basic_ostream >& std::operator<< (std: :basic_ostream >&, char const*)' C:\Users\Gor\AppData\Local\Temp\ccC9WmMU.o:havayi1.cpp:(.text+0x35): undefined reference to 'st d::basic_ostream >& std::endl (std:: basic_ostream >&)' C:\Users\Gor\AppData\Local\Temp\ccC9WmMU.o:havayi1.cpp:(.text+0x3c): undefined reference to 'st d::ostream::operator<<(std::ostream& ()(std::ostream&))' C:\Users\Gor\AppData\Local\Temp\ccC9WmMU.o:havayi1.cpp:(.text+0x4a): undefined reference to 'st d::cin' C:\Users\Gor\AppData\Local\Temp\ccC9WmMU.o:havayi1.cpp:(.text+0x4f): undefined reference to 'st d::istream::operator>>(int&)' C:\Users\Gor\AppData\Local\Temp\ccC9WmMU.o:havayi1.cpp:(.text+0x6b): undefined reference to 'st d::cout' C:\Users\Gor\AppData\Local\Temp\ccC9WmMU.o:havayi1.cpp:(.text+0x70): undefined reference to 'st d::basic_ostream >& std::operator<< (std: :basic_ostream >&, char const)' C:\Users\Gor\AppData\Local\Temp\ccC9WmMU.o:havayi1.cpp:(.text+0x7a): undefined reference to 'st d::ostream::operator<<(int)' C:\Users\Gor\AppData\Local\Temp\ccC9WmMU.o:havayi1.cpp:(.text+0x84): undefined reference to 'st d::basic_ostream >& std::endl (std:: basic_ostream >&)' C:\Users\Gor\AppData\Local\Temp\ccC9WmMU.o:havayi1.cpp:(.text+0x8b): undefined reference to 'st d::ostream::operator<<(std::ostream& (*)(std::ostream&))' C:\Users\Gor\AppData\Local\Temp\ccC9WmMU.o:havayi1.cpp:(.text+0xad): undefined reference to 'st d::ios_base::Init::~Init()' C:\Users\Gor\AppData\Local\Temp\ccC9WmMU.o:havayi1.cpp:(.text+0xce): undefined reference to '`st d::ios_base::Init::Init()' collect2.exe: error: ld returned 1 exit status
PS havayi1.cpp - это файл с кодом
у меня всеми кодами так получается, <iostream>
а если использую <stdio.h>
то все гладок...
Вангую что компиляция С++ кода делалась при помощи gcc/clang, которые сами по себе не будут подключать стандартную библиотеку языка С++. Из-за неподключенной стандартной библиотеки и лезут эти ошибки.
Для компиляции С++ кода следует либо использовать g++/clang++, либо явно попросить gcc/clang подключить стандартную библиотеку языка С++ путем указания -lstdc++ в командной строке.
Апостиль в Лос-Анджелесе без лишних нервов и бумажной волокиты
Основные этапы разработки сайта для стоматологической клиники
Продвижение своими сайтами как стратегия роста и независимости