我不能编译helloworld.cpp与eclipse& mac上的CDT [英] I cannot compile helloworld.cpp with eclipse & CDT on mac

查看:303
本文介绍了我不能编译helloworld.cpp与eclipse& mac上的CDT的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

编译器说:
符号'std'无法解析
无法解析符号'cout'
无法解析符号'endl'

compiler says: Symbol 'std' could not be resolved Symbol 'cout' could not be resolved Symbol '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&amp; mac上的CDT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆