I'm using the version of gcc installed from the Tiger Developer Tools outfit. I try to compile this simple C++ code:
#include <iostream>
using namespace std;
int main ()
{
int i;
cout << "Please enter an integer value: ";
cin >> i;
cout << "The value you entered is " << i;
cout << " and its double is " << i*2 << ".\n";
return 0;
}
with gcc, using no special flags or suchlike. I get the following errors:
/usr/bin/ld: Undefined symbols:
std::basic_istream<char, std::char_traits<char> >:perator>>(int&)
std::basic_ostream<char, std::char_traits<char> >:perator<<(int)
std::ios_base::Init::Init()
std::ios_base::Init::~Init()
std::cin
std::cout
std::basic_ostream<char, std::char_traits<char> >& std:perator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)
___gxx_personality_v0
collect2: ld returned 1 exit status
What's going on? Does gcc not support ANSI C++? I think not. I am stumped. Any help would be greatly appreciated
#include <iostream>
using namespace std;
int main ()
{
int i;
cout << "Please enter an integer value: ";
cin >> i;
cout << "The value you entered is " << i;
cout << " and its double is " << i*2 << ".\n";
return 0;
}
with gcc, using no special flags or suchlike. I get the following errors:
/usr/bin/ld: Undefined symbols:
std::basic_istream<char, std::char_traits<char> >:perator>>(int&)
std::basic_ostream<char, std::char_traits<char> >:perator<<(int)
std::ios_base::Init::Init()
std::ios_base::Init::~Init()
std::cin
std::cout
std::basic_ostream<char, std::char_traits<char> >& std:perator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)
___gxx_personality_v0
collect2: ld returned 1 exit status
What's going on? Does gcc not support ANSI C++? I think not. I am stumped. Any help would be greatly appreciated