arm-none-eabi-gcc 报错 undefined reference to `_exit'解决方案
程序员文章站
2022-06-22 19:54:40
...
Bug
使用arm-none-ebai-gcc出现如下报错
Reason
ARM Compiler toolchain 提到一种semi-host机制,博主没仔细看,感觉大概是要么使用semi-host要么不使用。
Semihosting is a mechanism that enables code running on an ARM target to communicate and use the Input/Output facilities on a host computer that is running a debugger.
semi-host是一种可以使得ARM架构的代码能够在debugger机器上使用通信和输入输出功能的机制。如果使用的话,则
$ arm-none-eabi-gcc --specs=rdimon.specs $(OTHER_LINK_OPTIONS)
如果不使用,则是
** non-semihosting/retarget
If you are using retarget, linking like:
$ arm-none-eabi-gcc --specs=nosys.specs $(OTHER_LINK_OPTIONS)
测试发现,不使用该机制则编译通过,后续研究清楚该机制后再更新补充一下这个机制的作用和用法
Solve
使用--specs=nosys.specs
即可
$ arm-none-eabi-gcc --specs=nosys.specs $(OTHER_LINK_OPTIONS)
推荐阅读
-
Android NDK 报错:undefined reference to ‘main‘(invalid character)解决办法
-
"undefined reference to `WinMain' collect2.exe" C++ / vscode报错记录
-
Android studio opencv报错undefined reference to 'cv::imwrite(cv::String const&, c
-
arm-none-eabi-gcc 报错 undefined reference to `_exit'解决方案
-
g++链接gcc编译的库报错“undefined reference to xxx”
-
linux:gcc编译error:“collect2: ld returned 1 exit status” (Undefined reference )
-
g++链接gcc编译的库报错“undefined reference to xxx”
-
那些报错之 error: undefined reference to ‘ ‘ ...
-
ROS PCL 配置 报错 undefined reference to
-
【ffmpeg】编译时报错:error: undefined reference to `av...