我寫了一個簡單的C++程序,TEST.CPP:無法在UNIX
#include <iostream>
#include <string>
using namespace std;
int main() {
string s;
cin >> s;
cout << s << endl;
return 0;
}
爲什麼捉迷藏gcc test.cpp -o mytest
給我這些錯誤,多?
Undefined symbols for architecture x86_64:
"std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string()", referenced from:
_main in cc8rGYVq.o
"std::cin", referenced from:
_main in cc8rGYVq.o
你使用的是什麼Unix系統? –
Darwin -------- –