Toggle navigation
首页
问答
文章
积分商城
专家
专区
更多专区...
文档中心
返回主站
搜索
提问
会员
中心
登录
注册
CoAP
CoAP 模块编译问题
发布于 2019-12-03 09:49:06 浏览:1497
订阅该版
执行 ``` scons --menuconfig ``` 使能**CoAP** package 3. 保存配置,执行`pkgs --update` 4. 执行`scons` 5. 编译提示如下错误: ``` james@james-Aspire-1602M:~/work/rt-thread/bsp/qemu-vexpress-a9$ scons scons: Reading SConscript files ... scons: done reading SConscript files. scons: Building targets ... scons: building associated VariantDir targets: build CC build/packages/coap-latest/coap-rtthread/coap_io_rt.o In file included from packages/coap-latest/libcoap/include/coap/coap_io.h:16:0, from packages/coap-latest/coap-rtthread/coap_io_rt.c:39: packages/coap-latest/libcoap/include/coap/address.h:65:29: error: field 'sin6' has incomplete type struct sockaddr_in6 sin6; ^~~~ packages/coap-latest/libcoap/include/coap/address.h: In function '_coap_address_isany_impl': packages/coap-latest/libcoap/include/coap/address.h:83:20: error: 'in6addr_any' undeclared (first use in this function) return memcmp(&in6addr_any, ^~~~~~~~~~~ packages/coap-latest/libcoap/include/coap/address.h:83:20: note: each undeclared identifier is reported only once for each function it appears in packages/coap-latest/coap-rtthread/coap_io_rt.c: In function 'coap_new_endpoint': packages/coap-latest/coap-rtthread/coap_io_rt.c:154:5: warning: implicit declaration of function 'close' [-Wimplicit-function-declaration] close (sockfd); ^~~~~ packages/coap-latest/coap-rtthread/coap_io_rt.c: At top level: packages/coap-latest/coap-rtthread/coap_io_rt.c:213:19: error: field 'ipi6_addr' has incomplete type struct in6_addr ipi6_addr; /* src/dst IPv6 address */ ^~~~~~~~~ scons: *** [build/packages/coap-latest/coap-rtthread/coap_io_rt.o] Error 1 scons: building terminated because of errors. ``` 信息显示需要使能IPV6协议 但是`scons --menuconfig`后找不到使能IPV6的 地方 在menuconfig里搜索可以看出 NETDEV_IPV6需要设置为1 同时也不知道在哪设置这个参数。 ``` .config - RT-Thread Project Configuration > RT-Thread Components > Network > light weight TCP/IP stack > Search (IPV6) ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ┌────────────────────────────────────────────────────────────────────────────────────────── Search Results ───────────────────────────────────────────────────────────────────────────────────────────┐ │ Symbol: NETDEV_IPV6 [=NETDEV_IPV6] │ │ Type : unknown │ │ │ │ │ │ Symbol: RT_USING_LWIP_IPV6 [=n] │ │ Type : boolean │ │ Prompt: IPV6 protocol │ │ Location: │ │ -> RT-Thread Components │ │ -> Network │ │ -> light weight TCP/IP stack │ │ (1) -> Enable lwIP stack (RT_USING_LWIP [=y]) │ │ Defined at ../../components/net/Kconfig:108 │ │ Depends on: RT_USING_LWIP [=y] && (RT_USING_LWIP210 [=n] || RT_USING_LWIP202 [=y]) && (!RT_USING_NETDEV [=y] || RT_USING_NETDEV [=y] && NETDEV_IPV6) ``` 请大神们帮忙指点一下
查看更多
3
个回答
默认排序
按发布时间排序
wz210
2019-12-03
这家伙很懒,什么也没写!
``` ──────── light weight TCP/IP stack │ │ -*- Enable lwIP stack │ │ │ │ lwIP version (lwIP v2.0.2) ---> │ │ │ │ [ ] IGMP protocol │ │ │ │ -*- ICMP protocol │ │ │ │ [ ] SNMP protocol │ │ │ │ [*] Enble DNS for name resolution │ │ │ │ [*] Enable alloc ip address through DHCP │ │ │ │ (1) SOF broadcast │ │ │ │ (1) SOF broadcast recv │ │ │ │ Static IPv4 Address ---> │ │ │ │ -*- UDP protocol │ │ │ │ [*] TCP protocol │ │ │ │ -*- RAW protocol │ │ │ │ [ ] PPP protocol │ │ │ │ (8) the number of struct netconns │ │ │ │ (16) the number of PBUF │ │ │ │ (4) the number of raw connection │ │ │ │ (4) the number of UDP socket │ │ │ │ (4) the number of TCP socket │ │ │ │ (40) the number of TCP segment │ │ │ │ (8196) the size of send buffer │ │ │ │ (8196) the size of TCP send window │ │ │ │ (10) the priority level value of lwIP thread │ │ │ │ (8) the number of mail in the lwIP thread mailbox │ │ │ │ (1024) the stack size of lwIP thread │ │ │ │ [ ] Not use Rx thread │ │ │ │ [ ] Not use Tx thread │ │ │ │ (12) the priority level value of ethernet thread │ │ │ │ (1024) the stack size of ethernet thread │ │ │ │ (8) the number of mail in the ethernet thread mailbox │ │ │ │ [*] Enable IP reassembly and frag │ │ │ │ (1) Enable netif status callback │ │ │ │ (1) Enable netif link status callback │ │ │ │ (1) Enable SO_REUSEADDR option │ │ │ │ (1) Enable receive timeout for sockets/netconns and SO_RCVTIMEO processing. │ │ │ │ (1) Enable send timeout for sockets/netconns and SO_SNDTIMEO processing. │ │ │ │ (1) Enable SO_RCVBUF processing │ │ │ │ [ ] Enable netif loopback │ │ │ │ [ ] Enable lwIP statistics │ │ │ │ [ ] Enable hardware checksum │ │ │ │ [*] Enable ping features │ │ │ │ [ ] Enable lwIP Debugging Options ---- ``` 从`menuconfig`里看不到设置IPV6的地方
wz210
2019-12-03
这家伙很懒,什么也没写!
将CoAP代码中关于`case AF_INET6: `代码块的地方全部注释。 模块不支持ipv6了 就可以编译通过了。 但少了对ipv6的支持。最好还是配置好rt-thread使他支持 ipv6。
wz210
2019-12-03
这家伙很懒,什么也没写!
编译链接时出现问题 : ``` build/packages/coap-latest/libcoap/src/address.o: In function `coap_is_mcast': /home/james/work/rt-thread/bsp/qemu-vexpress-a9/packages/coap-latest/libcoap/src/address.c:47: undefined reference to `IN_MULTICAST' collect2: error: ld returned 1 exit status ``` 不知道为什么 IN_MULTICAST 是这样一个宏定义,为什么出链接问题? ``` james@james-Aspire-1602M:~/work/rt-thread$ find . -name "*.c" | xargs grep "IN_MULTICAST" ./bsp/qemu-vexpress-a9/packages/coap-latest/libcoap/src/address.c: return IN_MULTICAST(ntohl(a->addr.sin.sin_addr.s_addr)); ./components/net/lwip-1.4.1/src/netif/ppp/auth.c: || IN_MULTICAST(addr) || IN_BADCLASS(addr); ./components/net/lwip-2.1.0/src/netif/ppp/auth.c: || IN_MULTICAST(addr) || IN_BADCLASS(addr); ./components/net/lwip-2.0.2/src/netif/ppp/auth.c: || IN_MULTICAST(addr) || IN_BADCLASS(addr); james@james-Aspire-1602M:~/work/rt-thread$ find . -name "*.h" | xargs grep "IN_MULTICAST" ./bsp/simulator/pcap/Include/ip6_misc.h:#define IN_MULTICAST(a) IN_CLASSD(a) ./components/net/lwip-1.4.1/src/include/ipv4/lwip/inet.h:#define IN_MULTICAST(a) IP_MULTICAST(a) ./components/net/lwip-2.1.0/src/include/lwip/inet.h:#define IN_MULTICAST(a) IP_MULTICAST(a) ./components/net/lwip-2.0.2/src/include/lwip/inet.h:#define IN_MULTICAST(a) IP_MULTICAST(a) james@james-Aspire-1602M:~/work/rt-thread$ vim ./components/net/lwip-2.0.2/src/include/lwip/inet.h james@james-Aspire-1602M:~/work/rt-thread$ find . -name "*.h" | xargs grep "IP_MULTICAST" 。 。 。 ./components/net/lwip-2.0.2/src/include/lwip/inet.h:#define IN_MULTICAST(a) IP_MULTICAST(a) ./components/net/lwip-2.0.2/src/include/lwip/sockets.h:#if LWIP_MULTICAST_TX_OPTIONS ./components/net/lwip-2.0.2/src/include/lwip/sockets.h:#define IP_MULTICAST_TTL 5 ./components/net/lwip-2.0.2/src/include/lwip/sockets.h:#define IP_MULTICAST_IF 6 ./components/net/lwip-2.0.2/src/include/lwip/sockets.h:#define IP_MULTICAST_LOOP 7 ./components/net/lwip-2.0.2/src/include/lwip/sockets.h:#endif /* LWIP_MULTICAST_TX_OPTIONS */ ./components/net/lwip-2.0.2/src/include/lwip/udp.h:#if LWIP_MULTICAST_TX_OPTIONS ./components/net/lwip-2.0.2/src/include/lwip/udp.h:#endif /* LWIP_MULTICAST_TX_OPTIONS */ ./components/net/lwip-2.0.2/src/include/lwip/udp.h:#if LWIP_MULTICAST_TX_OPTIONS ./components/net/lwip-2.0.2/src/include/lwip/udp.h:#endif /* LWIP_MULTICAST_TX_OPTIONS */ ./components/net/lwip-2.0.2/src/include/lwip/ip4_addr.h:#define IP_MULTICAST(a) IP_CLASSD(a) ./components/net/lwip-2.0.2/src/include/lwip/opt.h: * LWIP_MULTICAST_PING==1: respond to multicast pings (default is unicast only) ./components/net/lwip-2.0.2/src/include/lwip/opt.h:#if !defined LWIP_MULTICAST_PING || defined __DOXYGEN__ ./components/net/lwip-2.0.2/src/include/lwip/opt.h:#define LWIP_MULTICAST_PING 0 ./components/net/lwip-2.0.2/src/include/lwip/opt.h: * LWIP_MULTICAST_TX_OPTIONS==1: Enable multicast TX support like the socket options ./components/net/lwip-2.0.2/src/include/lwip/opt.h: * IP_MULTICAST_TTL/IP_MULTICAST_IF/IP_MULTICAST_LOOP ./components/net/lwip-2.0.2/src/include/lwip/opt.h:#if !defined LWIP_MULTICAST_TX_OPTIONS || defined __DOXYGEN__ ./components/net/lwip-2.0.2/src/include/lwip/opt.h:#define LWIP_MULTICAST_TX_OPTIONS (LWIP_IGMP && LWIP_UDP) ./components/net/lwip-2.0.2/src/include/lwip/ip4.h:#if LWIP_MULTICAST_TX_OPTIONS ./components/net/lwip-2.0.2/src/include/lwip/ip4.h:#endif /* LWIP_MULTICAST_TX_OPTIONS */ james@james-Aspire-1602M:~/work/rt-thread$ find . -name "*.h" | xargs grep "IP_CLASSD" 。 。 。 ./components/net/lwip-2.1.0/src/include/lwip/ip4_addr.h:#define IP_MULTICAST(a) IP_CLASSD(a) ./components/net/lwip-2.0.2/src/include/lwip/inet.h:#define IN_CLASSD(d) IP_CLASSD(d) ./components/net/lwip-2.0.2/src/include/lwip/inet.h:#define IN_CLASSD_NET IP_CLASSD_NET /* These ones aren't really */ ./components/net/lwip-2.0.2/src/include/lwip/inet.h:#define IN_CLASSD_NSHIFT IP_CLASSD_NSHIFT /* net and host fields, but */ ./components/net/lwip-2.0.2/src/include/lwip/inet.h:#define IN_CLASSD_HOST IP_CLASSD_HOST /* routing needn't know. */ ./components/net/lwip-2.0.2/src/include/lwip/inet.h:#define IN_CLASSD_MAX IP_CLASSD_MAX ./components/net/lwip-2.0.2/src/include/lwip/ip4_addr.h:#define IP_CLASSD(a) (((u32_t)(a) & 0xf0000000UL) == 0xe0000000UL) ./components/net/lwip-2.0.2/src/include/lwip/ip4_addr.h:#define IP_CLASSD_NET 0xf0000000 /* These ones aren't really */ ./components/net/lwip-2.0.2/src/include/lwip/ip4_addr.h:#define IP_CLASSD_NSHIFT 28 /* net and host fields, but */ ./components/net/lwip-2.0.2/src/include/lwip/ip4_addr.h:#define IP_CLASSD_HOST 0x0fffffff /* routing needn't know. */ ./components/net/lwip-2.0.2/src/include/lwip/ip4_addr.h:#define IP_MULTICAST(a) IP_CLASSD(a) 直接修改代码 packages/coap-latest/libcoap/src/address.c 41 int coap_is_mcast(const coap_address_t *a) { 42 if (!a) 43 return 0; 44 45 switch (a->addr.sa.sa_family) { 46 case AF_INET: 47 //return IN_MULTICAST(ntohl(a->addr.sin.sin_addr.s_addr)); 48 return (((unsigned long)(ntohl(a->addr.sin.sin_addr.s_addr)) & 0xf0000000UL) == 0xe0000000UL); 49 /* case AF_INET6: 50 return IN6_IS_ADDR_MULTICAST(&a->addr.sin6.sin6_addr);*/ 51 default: /* fall through and signal error */ 52 ; 53 } 54 return 0; 55 } ``` 编译成功。。。
撰写答案
登录
注册新账号
关注者
0
被浏览
1.5k
关于作者
wz210
这家伙很懒,什么也没写!
提问
1
回答
3
被采纳
0
关注TA
发私信
相关问题
1
coap有关的问题,求助
2
rtthread添加CoAP package编译出错的问题
3
coap(libcoap) 回包怎么能够不修改库的情况下拿到response
4
请教,coap连接阿里云失败,求解
5
coap最新软件包无法编译通过
6
请教coap的ctx为空问题
7
弱弱问一句rtthread可以同时支持mqtt和coap么
8
Coap example示例演示失败
9
RT-Thread有没有加入mqtt,coap,lwm2m,http这些协议
10
使用coap时device绑定问题
推荐文章
1
RT-Thread应用项目汇总
2
玩转RT-Thread系列教程
3
国产MCU移植系列教程汇总,欢迎查看!
4
机器人操作系统 (ROS2) 和 RT-Thread 通信
5
五分钟玩转RT-Thread新社区
6
【技术三千问】之《玩转ART-Pi》,看这篇就够了!干货汇总
7
关于STM32H7开发板上使用SDIO接口驱动SD卡挂载文件系统的问题总结
8
STM32的“GPU”——DMA2D实例详解
9
RT-Thread隐藏的宝藏之completion
10
【ART-PI】RT-Thread 开启RTC 与 Alarm组件
最新文章
1
【1024】瑞萨 RA 系列 BSP 制作与适配最新版本的 Keil 、 RSC、固件,较新的 FSP
2
基于 RT-Thread 星火一号开发板的俄罗斯方块
3
RTThread studio 中添加 Micro_ROS 软件包有 Bug
4
【1024 RT-Thread与英飞凌(infineon)合作得板子PSOC 6 板子学习】
5
【1024】用HMI-Board 復刻 X-Track
热门标签
RT-Thread Studio
串口
Env
LWIP
SPI
AT
Bootloader
Hardfault
CAN总线
ART-Pi
FinSH
USB
DMA
文件系统
RT-Thread
SCons
RT-Thread Nano
线程
MQTT
STM32
RTC
rt-smart
FAL
ESP8266
I2C_IIC
WIZnet_W5500
ota在线升级
UART
cubemx
PWM
flash
packages_软件包
freemodbus
BSP
潘多拉开发板_Pandora
定时器
ADC
GD32
flashDB
socket
中断
Debug
编译报错
msh
keil_MDK
SFUD
rt_mq_消息队列_msg_queue
C++_cpp
at_device
ulog
本月问答贡献
出出啊
1516
个答案
342
次被采纳
小小李sunny
1440
个答案
289
次被采纳
张世争
793
个答案
171
次被采纳
crystal266
547
个答案
161
次被采纳
whj467467222
1222
个答案
148
次被采纳
本月文章贡献
出出啊
1
篇文章
1
次点赞
小小李sunny
1
篇文章
1
次点赞
张世争
1
篇文章
4
次点赞
crystal266
2
篇文章
2
次点赞
whj467467222
2
篇文章
1
次点赞
回到
顶部
发布
问题
分享
好友
手机
浏览
扫码手机浏览
投诉
建议
回到
底部