https://blog.csdn.net/leafage_m/article/details/57406094
原因就是main.cpp为c++代码,调用了c语言库的函数,因此链接的时候找不到,解决方法:即在main.cpp中,把与c语言库test.a相关的头文件包含添加一个extern “C”的声明即可。例如,修改后的main.cpp如下:
extern "C" { #include "loragw_hal.h" #include "loragw_com.h" #include "loragw_aux.h" }