J
J
Jmar42018-10-09 14:14:42
C++ / C#
Jmar4, 2018-10-09 14:14:42

C++ mac os error?

#include <iostream>
#include <string>

int n, m;
int main()
{
  std::cin >> n >> m;
  return 0;
}

I bought a new laptop, I throw in an obvious code and it gives an error
Undefined symbols for architecture x86_64:
  "std::__1::basic_istream<char, std::__1::char_traits<char> >::operator>>(int&)", referenced from:
      _main in a-2c3821.o
  "std::__1::cin", referenced from:
      _main in a-2c3821.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Installed default gcc.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question