wuyueyu
EVAN
对于启动文件报错 Unresolved Symbol ?C_STARTUP
,见:https://developer.arm.com/documentation/ka003779/1-0
解决方法:
原文:
For a project in the SMALL memory model that uses no floating point arithmetic, C51S.LIB is required.
For a project in the LARGE memory model that uses floating-point, C51FPL.LIB and C51L.LIB are required.
If a project uses floating arithmetic, it is important that C51FPx.LIB is included before the standard library file C51x.LIB. Otherwise printf and scanf will not work with floating-point numbers.
问题原因:
keil 编译 C 时,先生成 SRC
文件,然后编译成 OBJ
,如下:
- Generate Assembler SRC File
- Assembler SRC File
eide 中是直接一步编译成 OBJ
,按照官网的说法,链接器无法检测到是否需要 C run-time libraries
,因此必须手动添加 C51x.LIB
(如果不加 STARTUP.A51
,链接器会链接默认的 C run-time 库)
When you compile all your C modules with the SRC directive and the assembler, the linker does not detect the required C run-time libraries (because the files were assembled). In this case, you must add the libraries to your project manually.