我刚刚开始一个C++类,并且正在处理我们的第一个作业。我使用Eclipse,它给我一些问题。这里是我的代码:“符号”cin'无法解析“在OS X上的Eclipse错误
#include <iostream>
using namespace std;
int main() {
int first, second;
cout<< "Type the first number and press enter.\n";
cin>>first;
cout << "Type the second number and press enter.\n";
cin>>second;
cout<<"The sum of "<<first<<" and "<<second<<" is "<<(first+second)<<", and the product is "<<(first*second)<<endl;
}
我相当确定代码是好的,应该编译和运行,但Eclipse给了我一堆的错误。对于每个cin和cout语句,我都会收到一个错误消息:“符号'cin'/'cout'无法解析。”我也遇到了一个错误:“架构x86_64找不到符号”。我正在运行Mac OS X v10.7.2,GNU Make 3.81和i686-apple-darwin11-llvm-g ++ - 4.2(GCC)4.2.1(基于Apple Inc. build 5658)(LLVM build 2336.1。 00)。
就像我说的,我是新的,所以如果你需要更多的信息,请让我知道。谢谢。
看来您正在尝试构建64位代码,并且您没有为此安装库。 –
我该如何解决这个问题?我安装了XCode,我的电脑是64位的。 –
这很奇怪,狮子支持64位... – fdh