ld:入口点(起点)未定义.通常在crt1.o中用于体系结构x86_64
ld: entry point (start) undefined. Usually in crt1.o for architecture x86_64
我已经为我的终端编写了一个简单的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世界函数,应该很好哈哈
#include <iostream>
#include <string>
using namespace std;
int main()
{
cout<<"hello world";
return 0;
}
提前感谢!
嗯,for architecture x86_64
说
尝试使用-m32
:g++ hello.cpp -o hello -m32
进行编译。
此外,我注意到您使用了GCC 4.9.2。我使用GCC 4.9.1编译了完全相同的代码(只是复制粘贴),它的编译和执行都很完美。
更新:对此感到困惑:OSX GCC安装程序
卸载当前GCC并下载安装程序并安装它!试试这个,我自己也用过,很好。
相关文章:
- 1d 智能指针不适用于语法 (*)++
- 使用C++库在Android项目中修改gradle中的cmake参数,用于插入指令的测试
- 用于访问容器<T>数据成员的正确 API
- 重载操作程序时出错>>用于类中的字符串 memebr
- 如何防止 c++ 在从浮点型转换为双精度型(不适用于 IO)时添加额外的小数?
- C++中的cin.ignore()函数不适用于整个流
- 没有用于初始化C++中的变量模板的匹配构造函数
- 用于C++中带有数组和指针的循环
- 为什么它不适用于Visual 2019的原因
- 使用在用于SFINAE的void_t中具有参数的方法
- 在createdialog创建的窗口中捕获用于编辑控件的OnMouseMove消息
- 重载==不适用于二进制树
- Insert函数不适用于2 if语句C++
- 用于矢量处理的多个线程
- 使外部项目可用于find_package CMake
- 在子目录中使用target_sources()命令时用于单元测试(qtest)的项目结构
- 为什么模数运算符不适用于该代码
- 并行用于C++17中数组索引范围内的循环
- 将fold表达式与std::一起用于两个元组
- ld:入口点(起点)未定义.通常在crt1.o中用于体系结构x86_64