【debug】 烧写 ttn-otaa.ino提示 undefined reference to ‘table_g‘ / ‘table_get_ostime‘

在使用Arduino UNO和LoRa shield时,遇到编译错误,错误信息显示未定义引用到`table_get_u2`和`table_get_ostime`。解决方法是在oslmic.h文件中将`inline`类型函数改为`static inline`。这个更改解决了链接阶段的错误,允许代码正确编译和运行。

设备:

  Arduino UNO + LoRa shield

代码:

  ttn-otaa.ino

错误信息:

Arduino:1.8.10 (Windows 10), 开发板:"Arduino/Genuino Uno"

C:\Users\ADMINI~1\AppData\Local\Temp\cceEo6Kv.ltrans0.ltrans.o: In function `radio_irq_handler':

D:\APP\Arduino\libraries\arduino-lmic-master\src\lmic/radio.c:777: undefined reference to `table_get_u2'

C:\Users\ADMINI~1\AppData\Local\Temp\cceEo6Kv.ltrans0.ltrans.o: In function `schedRx12':

D:\APP\Arduino\libraries\arduino-lmic-master\src\lmic/lmic.c:1604: undefined reference to `table_get_ostime'

collect2.exe: error: ld returned 1 exit status


为开发板 Arduino/Genuino Uno 编译时出错。

解决方法:

文件 oslmic.h,以下代码

inline type table_get ## postfix(const type *table, size_t index) { \

变成

static inline type table_get ## postfix(const type *table, size_t index) { \

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值