Levenlol
Levenlol

Reputation: 415

Error compiling simple C++ program

im trying to compile my first program in c++, it's a pretty simple code and i dont get why it dont compile and give me lots of errors:

#include <iostream>

using namespace std;
int main () {
std::cout << "Game Over";
return 0;
}

and these are the errors:

Undefined symbols for architecture x86_64:
"std::__1::locale::use_facet(std::__1::locale::id&) const", referenced from:
  std::__1::basic_ostream<char, std::__1::char_traits<char> >&      std::__1::__put_character_sequence<char, std::__1::char_traits<char> >       (std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*, unsigned long) in untitled-7bd2fc.o
...

and so on.

Upvotes: 0

Views: 127

Answers (1)

pts
pts

Reputation: 87201

Compile (and link) it with g++ instead of gcc.

Upvotes: 6

Related Questions