我无法使用 eclipse & 编译 helloworld.cpp Mac 上的 CDT

发布于 2025-01-06 02:24:19 字数 495 浏览 2 评论 0原文

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

它似乎是一个C编译器,但我确实安装了CDT中列出的所有内容。

我尝试搜索,但都是关于 Windows 的。我已经安装了 CDT 中的所有插件。

奇怪的是,该文件曾经编译并打印过“Hello world”。我不明白发生了什么事。

我的操作系统是 osx lion (10.7.3)。希望有人能帮助我!谢谢!

我的eclipse版本是3.7。 我的cdt版本是8.0.0。

这是 helloworld.cpp 的代码

#include <iostream>

using namespace std;


int main() {


    cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!!

    return 0;

}

compiler says:
Symbol 'std' could not be resolved
Symbol 'cout' could not be resolved
Symbol 'endl' could not be resolved

It seems that it is a C compiler, but I really installed everything listed in CDT.

I tried searching but it's all about windows. I've installed all the plugins in CDT.

Something strange is that the file was once compiled and printed "Hello world". I can't understand what is happening.

My os is osx lion (10.7.3). Hope someone can help me! Thanks!

My eclipse version is 3.7.
My cdt version is 8.0.0.

Here's the code for helloworld.cpp

#include <iostream>

using namespace std;


int main() {


    cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!!

    return 0;

}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

薄荷→糖丶微凉 2025-01-13 02:24:19

Eclipse 可能很难导航。您能否剪切并粘贴您的 helloworld.cpp 以及您所遵循的 Eclipse 说明的链接?

编辑:
K,看来它没有将该文件识别为 c++。您可能想确保您是从 C++ 项目开始的。另外,许多 Windows Eclipse 问题也应该对您有所帮助。

Eclipse can be quite difficult to navigate. Can you cut 'n' paste your helloworld.cpp and the links to the Eclipse instructions you followed?

Edit:
K, It appears that it's not recognizing the file as c++. You may want to make sure you started with a c++ project. Also, many of the windows eclipse problems should help you as well.

甜嗑 2025-01-13 02:24:19

我通过用旧版本的 Helios 替换 Indigo 解决了这个问题,并且工作正常。希望有人能够在不改变 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文