社区
Linux/Unix社区
帖子详情
求助:有main(),却提示cannot find entry symbol _start
漫步星辰575654643
2011-12-06 12:35:14
gcc 不会自已设起始地址吗?难道还要加什么选项?
...全文
673
4
打赏
收藏
求助:有main(),却提示cannot find entry symbol _start
gcc 不会自已设起始地址吗?难道还要加什么选项?
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
4 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
漫步星辰575654643
2011-12-06
打赏
举报
回复
原来我生成动态库去了,加了-SHARED -FPIC
xunxun
2011-12-06
打赏
举报
回复
写出你的命令行
尽量不使用ld显式链接(除非你对链接相当了解),而是使用gcc的wrapper
李迟
2011-12-06
打赏
举报
回复
接1楼,如果代码没错,很可能是命令使用出错造成的。
写一个简单的hello world,保存为hello.c,使用:
gcc hello.c
就可以生成一个可以执行的a.out文件了。
我遇到这种错误主要是使用ld来链接。
无知者无谓
2011-12-06
打赏
举报
回复
gcc默认入口就是main函数,出现这种问题只能是你代码错了。
acpi控制笔记本风扇转速
ResourceTemplate, but cannot be disassembled as such because the EndTag does not appear at the very end of the buffer. AcpiExec - Added the "-t" command line option to enable the serialized mode of ...
Bochs - The cross platform IA-32 (x86) emulator
[2994370] Cannot build with 3DNow support - these S.F. feature requests were closed/implemented [1510142] Native Windows XP x64 Edition binary [1062553] select mouse (de)activation in bochsrc ...
在x86-64位机器上不用gcc直接ld:ld: warning: cannot find
entry
symbol
_s
tar
t; defaulting to 00000000004002c8
随便在x86的linux机器上写了一个test.c文件,文件中只有
main
函数。... 再用ld链接成可执行文件的时候,如果直接使用ld test.o -lrt,是会报warning,类似ld: warning: cannot find
entry
symbol
_s
ld: warning: cannot find
entry
symbol
_s
tar
t; defaulting to 00000000004002a0
没有__s
tar
t是因为c程序以
main
为主函数,汇编以s
tar
t为主函数入口 你改用gcc连接就行了,
ld: warning: cannot find
entry
symbol
_s
tar
t; defaulting to 00000000080481d8
场景: 正常 经过 gcc -oloccheck loccheck.c [root@luozhonghua 9]# ./loccheck in
main
(),pooh=2 and &pooh=0xbfcfa31c in
main
(),bah=5 and &bah=0xbfcfa318 ...------------------------...in
main
(),p...
Linux/Unix社区
23,223
社区成员
74,537
社区内容
发帖
与我相关
我的任务
Linux/Unix社区
Linux/Unix社区 应用程序开发区
复制链接
扫一扫
分享
社区描述
Linux/Unix社区 应用程序开发区
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章