找不到条目符号_start [英] Cannot find entry symbol _start
问题描述
我在gcc上编译的c代码给出了错误Cannot find entry symbol _start defaulting to 00000
.谁能告诉我为什么以及如何纠正它?
My c code on compiling on gcc is giving the error Cannot find entry symbol _start defaulting to 00000
. Can anyone tell me why and how to correct it?
命令行为arm-none-eabi-gcc -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -ftree-vectorize -mfloat-abi=softfp file path
,目标平台为a-8 sitara cortex处理器.
The command line is arm-none-eabi-gcc -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -ftree-vectorize -mfloat-abi=softfp file path
and the target platform is a-8 sitara cortex processor.
推荐答案
编译器抛出上述错误的唯一原因是因为操作系统生成的用于运行代码的启动代码(_start函数)找不到默认或注册的函数主要的.因此,您可以使用_start函数代替main函数,但是编译命令应为gcc -nostartfiles filename.c,但是使用_start会有很多例外,因此最好使用main代替.
The only reason the compiler threw the above error is because the start code(_start function) generated by the OS for running your code cannot find the default or registered function main. So either you can use _start function instead of main function but the compilation command should be gcc -nostartfiles filename.c but using _start there are a lot of exceptions so better to use main instead.
这篇关于找不到条目符号_start的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!