Получение ошибки компиляции в gcc, даже если она отлично работает в Visual Studio C ++
#include <iostream>
using std::cout; // tried it, didn't work
using std::cin; // tried it, didn't work
using std::endl; // tried it, didn't work
using namespace std;
Это ошибка, которую я получаю при попытке ее скомпилировать.
hw2_part2.cpp:(.text+0xa2): undefined reference to `std::cout'
hw2_part2.cpp:(.text+0xa7): 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*)'
hw2_part2.cpp:(.text+0xb6): undefined reference to `std::cout'
hw2_part2.cpp:(.text+0xbb): 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*)'
hw2_part2.cpp:(.text+0xca): undefined reference to `std::cout'
hw2_part2.cpp:(.text+0xcf): 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*)'
hw2_part2.cpp:(.text+0xde): undefined reference to `std::cin'