问题描述
编译器说:
符号'std'无法解析
无法解析符号'cout'
无法解析符号'endl'
compiler says:Symbol 'std' could not be resolvedSymbol 'cout' could not be resolvedSymbol 'endl' could not be resolved
似乎它是一个C编译器,但我真的安装了CDT中列出的所有内容。
It seems that it is a C compiler, but I really installed everything listed in CDT.
我尝试搜索,但它都是关于windows。我已经安装了CDT中的所有插件。
I tried searching but it's all about windows. I've installed all the plugins in CDT.
奇怪的是,该文件曾被编译并打印Hello world。我不明白发生了什么。
Something strange is that the file was once compiled and printed "Hello world". I can't understand what is happening.
我的os是osx lion(10.7.3)。希望有人可以帮助我!谢谢!
My os is osx lion (10.7.3). Hope someone can help me! Thanks!
我的eclipse版本是3.7。
我的cdt版本是8.0.0。
My eclipse version is 3.7.My cdt version is 8.0.0.
这是helloworld.cpp的代码
Here's the code for helloworld.cpp
#include <iostream>
using namespace std;
int main() {
cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!!
return 0;
}
推荐答案
这是用老版本Helios替换靛蓝,它的工作正常。希望有人可以提出其他方法来解决问题,而不用改变Eclipse版本。
I fixed this by replace Indigo with an older version Helios, and it's working fine. Hope someone can come up with other approaches to the problem without changing Eclipse version.
这篇关于我不能编译helloworld.cpp与eclipse& mac上的CDT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!