简体   繁体   English

Mac OSX上的eclipse CDT问题

[英]eclipse CDT issue on Mac OSX

On one of my Mac box, for simple Hello Word C++ program, there are such compile error, other Macs I am working on are ok. 在我的一个Mac盒子上,对于简单的Hello Word C ++程序,有这样的编译错误,我正在处理的其他Mac都可以。 Using even the same version of Eclipse CDT 64-bit Mars. 甚至使用相同版本的Eclipse CDT 64位Mars。

Posted error and Hello Word program, does anyone have any hints? 发布错误和Hello Word程序,有没有人有任何提示? Thanks. 谢谢。

//============================================================================
// Name        : Test1.cpp
// Author      : 
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
using namespace std;

int main() {
    cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!!
    return 0;
}

在此输入图像描述 在此输入图像描述

Attach error from g++ of command line, 从命令行的g ++附加错误,

g++ Test1.cpp Test1.cpp:9:20: error: iostream: No such file or directory Test1.cpp: In function 'int main()': Test1.cpp:13: error: 'cout' was not declared in this scope Test1.cpp:13: error: 'endl' was not declared in this scope g ++ Test1.cpp Test1.cpp:9:20:错误:iostream:没有这样的文件或目录Test1.cpp:在函数'int main()'中:Test1.cpp:13:错误:'cout'未在此声明范围Test1.cpp:13:错误:未在此范围内声明'endl'

In summary, if whether you're developing in C, C++ or Objective C on the Mac, you probably just want to use XCode. 总之,如果您是在Mac上使用C,C ++或Objective C进行开发,您可能只想使用XCode。

Not sure what Eclipse was doing, but (see link in comments) earlier versions of Eclipse might work where later ones will not. 不确定Eclipse在做什么,但是(请参阅注释中的链接)早期版本的Eclipse可能会在以后的版本中不起作用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM