【发布时间】:2015-06-05 06:48:34
【问题描述】:
我已经为我的终端编写了一个简单的 hello world 函数来编译并且我不断得到
587216304:EECS280 jacobmyers$ g++ hello.cpp -o hell
ld: entry point (start) undefined. Usually in crt1.o for architecture x86_64
collect2: error: ld returned 1 exit status
我使用的是 gcc 版本 4.9.2,我在网上找不到任何可以为我解决此问题的东西。我很确定它与编译的 I/O 有关。
还有,这是证明我可以写一个简单的hello world函数的代码,应该不错哈哈
#include <iostream>
#include <string>
using namespace std;
int main()
{
cout<<"hello world";
return 0;
}
提前致谢!
【问题讨论】:
-
可能是因为
-o hell。别开玩笑了,你的程序中有main吗?您发布的示例是否编译和链接? -
你的开发环境坏了(可以重新安装)
-
如何重新安装?
-
这取决于您的操作系统。
-
我正在使用 OSX Yosemite,版本 10.10
标签: c++ xcode gcc osx-yosemite