.\output\stm32f103.axf: Error: L6218E: Undefined symbol UsartPrintf (referred from stm32f10x_it.o).
时间: 2023-11-12 10:18:12 浏览: 267
Error: L6218E: Undefined symbol delay-init (referred from main.o
根据你提供的引用信息,错误信息".\output\stm32f103.axf: Error: L6218E: Undefined symbol UsartPrintf (referred from stm32f10x_it.o)"指出在stm32f10x_it.o文件中引用了未定义的符号UsartPrintf。解决该问题的方法可以参考之前解决SystemInit未定义的方法类似,即在代码中增加对UsartPrintf的定义。具体做法是在代码中包含头文件"stm32f10x.h",并在main函数之前声明UsartPrintf函数,如下所示:
#include "stm32f10x.h"
void UsartPrintf(void); //声明UsartPrintf函数
int main(void) {
while(1);
}
void UsartPrintf(void) {
//UsartPrintf函数的具体实现
}
这样,在编译时就能正确找到和解析UsartPrintf函数的定义,从而解决该错误。请注意,具体的UsartPrintf函数的实现需要根据你的具体需求进行编写。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [关于STM32编译报错:Error: L6218E: Undefined symbol SystemInit (referred from startup_stm32f10x_md.o)...](https://blog.csdn.net/weixin_55374353/article/details/123254431)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *2* [MDK编译报错Error: L6218E: Undefined symbol SystemInit (referred from startup_stm32f10x_md.0)](https://blog.csdn.net/qq_52011409/article/details/127302100)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文