Toggle navigation
首页
问答
文章
积分商城
专家
专区
更多专区...
文档中心
返回主站
搜索
提问
会员
中心
登录
注册
ART-Pi
Linux
编译环境
ART-Pi SDK在Linux环境下编译不通过问题
发布于 2020-11-08 21:46:01 浏览:1901
订阅该版
本人对于RT-Thread算是新手一枚,平时用的最多的是Linux开发环境,Windows下RT-Studio开发是方便,但编译速度相对比较慢,想尝试在linux下编译ART-Pi SDK。 Linux环境如下: * Win10 WSL * Ubuntu 20.0.4 * `gcc version 9.2.1 20191025 (release) [ARM/arm-9-branch revision 277599] ` 注:RT-Thread的相关配置是在Windows下已经配置好生成rtconfig.h,及确保新引入的模块已经加入到SConscript,没有使用env配置. 遇到的问题如下3个问题: 1、在SDK下的工程目录下执行`scons --target=makefile`,编译过程正常,但无文件生成; ``` $ scons --target=makefile scons: Reading SConscript files ... scons: done reading SConscript files. scons: Building targets ... scons: building associated VariantDir targets: build CC build/applications/main.o CC build/board/CubeMX_Config/Core/Src/stm32h7xx_hal_msp.o CC build/board/board.o CC build/board/drv_mpu.o ... ... CC build/packages/webnet-v2.0.2/src/wn_utils.o AS libraries/STM32H7xx_HAL/CMSIS/Device/ST/STM32H7xx/Source/Templates/gcc/startup_stm32h750xx.o LINK rt-thread.elf arm-none-eabi-objcopy -O binary rt-thread.elf rtthread.bin arm-none-eabi-size rt-thread.elf scons: done building targets. **2、执行scons命令,出错** scons scons: Reading SConscript files ... scons: done reading SConscript files. scons: Building targets ... scons: building associated VariantDir targets: build CC build/applications/main.o In file included from rt-thread/components/net/sal_socket/include/dfs_net/sys_select/sys/select.h:14, from /usr/include/newlib/sys/types.h:50, from /usr/include/newlib/time.h:28, from /usr/include/newlib/sys/stat.h:9, from rt-thread/include/libc/libc_stat.h:14, from rt-thread/include/rtlibc.h:15, from rt-thread/include/rtdef.h:1090, from rt-thread/include/rtthread.h:24, from applications/main.c:11: rt-thread/components/dfs/include/dfs_select.h:19:22: error: unknown type name 'fd_set' 19 | int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout); | ^~~~~~ rt-thread/components/dfs/include/dfs_select.h:19:39: error: unknown type name 'fd_set' 19 | int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout); | ^~~~~~ rt-thread/components/dfs/include/dfs_select.h:19:57: error: unknown type name 'fd_set' 19 | int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout); | ^~~~~~ In file included from /usr/include/newlib/signal.h:6, from rt-thread/include/libc/libc_signal.h:71, from rt-thread/include/rtlibc.h:21, from rt-thread/include/rtdef.h:1090, from rt-thread/include/rtthread.h:24, from applications/main.c:11: /usr/include/newlib/sys/signal.h:42:7: error: redefinition of 'union sigval' 42 | union sigval { | ^~~~~~ In file included from rt-thread/include/rtlibc.h:21, from rt-thread/include/rtdef.h:1090, from rt-thread/include/rtthread.h:24, from applications/main.c:11: rt-thread/include/libc/libc_signal.h:27:7: note: originally defined here 27 | union sigval | ^~~~~~ In file included from /usr/include/newlib/signal.h:6, from rt-thread/include/libc/libc_signal.h:71, from rt-thread/include/rtlibc.h:21, from rt-thread/include/rtdef.h:1090, from rt-thread/include/rtthread.h:24, from applications/main.c:11: /usr/include/newlib/sys/signal.h:47:8: error: redefinition of 'struct sigevent' 47 | struct sigevent { | ^~~~~~~~ In file included from rt-thread/include/rtlibc.h:21, from rt-thread/include/rtdef.h:1090, from rt-thread/include/rtthread.h:24, from applications/main.c:11: rt-thread/include/libc/libc_signal.h:35:8: note: originally defined here 35 | struct sigevent | ^~~~~~~~ In file included from /usr/include/newlib/signal.h:6, from rt-thread/include/libc/libc_signal.h:71, from rt-thread/include/rtlibc.h:21, from rt-thread/include/rtdef.h:1090, from rt-thread/include/rtthread.h:24, from applications/main.c:11: /usr/include/newlib/sys/signal.h:72:3: error: conflicting types for 'siginfo_t' 72 | } siginfo_t; | ^~~~~~~~~ In file included from rt-thread/include/rtlibc.h:21, from rt-thread/include/rtdef.h:1090, from rt-thread/include/rtthread.h:24, from applications/main.c:11: rt-thread/include/libc/libc_signal.h:54:24: note: previous declaration of 'siginfo_t' was here 54 | typedef struct siginfo siginfo_t; | ^~~~~~~~~ In file included from packages/webnet-v2.0.2/inc/wn_module.h:33, from modules/web/web.h:21, from applications/main.c:17: packages/webnet-v2.0.2/inc/wn_session.h:100:29: error: unknown type name 'fd_set' 100 | int webnet_sessions_set_fds(fd_set *readset, fd_set *writeset); | ^~~~~~ packages/webnet-v2.0.2/inc/wn_session.h:100:46: error: unknown type name 'fd_set' 100 | int webnet_sessions_set_fds(fd_set *readset, fd_set *writeset); | ^~~~~~ packages/webnet-v2.0.2/inc/wn_session.h:101:33: error: unknown type name 'fd_set' 101 | void webnet_sessions_handle_fds(fd_set *readset, fd_set *writeset); | ^~~~~~ packages/webnet-v2.0.2/inc/wn_session.h:101:50: error: unknown type name 'fd_set' 101 | void webnet_sessions_handle_fds(fd_set *readset, fd_set *writeset); | ^~~~~~ scons: *** [build/applications/main.o] Error 1 scons: building terminated because of errors. ``` 3、scons --menuconfig执行出错 ``` $ scons --menuconfig scons: Reading SConscript files ... AttributeError: 'str' object has no attribute 'load_config': File "/mnt/e/STM32/STM32H750XB_ART_Pi/SConstruct", line 44: objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) File "/mnt/e/STM32/STM32H750XB_ART_Pi/rt-thread/tools/building.py", line 374: menuconfig(Rtt_Root) File "/home/algo/.local/lib/python3.8/site-packages/menuconfig.py", line 685: _conf_changed = _load_config() File "/home/algo/.local/lib/python3.8/site-packages/menuconfig.py", line 741: print(_kconf.load_config()) ``` 主要遇到以上3个问题,不确定是WSL编译环境导致,还是本身ART-Pi的SDK对Linux下的支持不是很完善。
查看更多
jhb
2021-06-18
这家伙很懒,什么也没写!
翻一下旧帖子,希望遇到同样问题的人可以看到 环境: Ubuntu 下开发,使用 scons --menuconfig 命令出现问题 报错信息: ```python AttributeError: 'str' object has no attribute 'load_config': File "/home/jhb/phytium_work/ft2004/rtos/rt-thread/bsp/phytium/ft2004/SConstruct", line 31: objs = PrepareBuilding(env, RTT_ROOT) File "/home/jhb/phytium_work/ft2004/rtos/rt-thread/tools/building.py", line 398: menuconfig(Rtt_Root) File "/usr/local/lib/python2.7/dist-packages/menuconfig.py", line 685: _conf_changed = _load_config() File "/usr/local/lib/python2.7/dist-packages/menuconfig.py", line 741: print(_kconf.load_config()) ``` 1、观察发现是调用`menuconfig.py`文件内出来问题,在排查过程中发现在rtt的tools目录下也有这个文件,故怀疑是俩个文件的名字重复了,导致调用了错误的文件 2、`/usr/local/lib/python2.7/dist-packages/menuconfig.py` 这个文件是之前安装kconfiglib包时安装的文件,使用`pip uninstall kconfiglib`命令卸载该包 3、再次执行 `scons --menuconfig` 恢复正常。 该调用来自`tools/building.py`文件内,但是对于python不是很熟悉,不清楚如何引用本目录下的文件 是否可以实现类似C语言的 `#include<> #include"` 这个效果 目前只能使用删除`kconfiglib`包解决这个问题
4
个回答
默认排序
按发布时间排序
chenyaxing
2020-11-10
泥上偶然留指爪,鸿飞那复计东西。
使用python2 的scons 试一下,这里的一些问题看起来像是python2 和python3 的差异原因
whj467467222
认证专家
2020-12-02
开源,分享,交流,共同进步
在 RTT Studio 中使用了 cconfig.h 来指定了编译器和lib 库,你看看你这个在 linux 怎么设置
NHMF_4386
2023-08-11
这家伙很懒,什么也没写!
感谢感谢,今天在Centos7上搞定了,就这个问题
撰写答案
登录
注册新账号
关注者
0
被浏览
1.9k
关于作者
Algo
这家伙很懒,什么也没写!
提问
1
回答
2
被采纳
0
关注TA
发私信
相关问题
1
RT-Thread Studio 跨平台
2
Linux下Scons编译工程遇到宏定义的问题,如何解决?
3
Linux下开发rtthread,求资料
4
qemu-vexpress-a9运行 qemu-dbg.sh 提示错误
5
虚拟串口在Linux下的使用问题
6
linux命令行通过串口发送finsh指令无法执行
7
怎么移植linux上的软件
8
linux下使用RT-Thread Studio插件如何进行stlink下载
9
代码在ubuntu上编译不能运行
10
env还没支持python3吗?
推荐文章
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
使用百度AI助手辅助编写一个rt-thread下的ONVIF设备发现功能的功能代码
2
RT-Thread 发布 EtherKit开源以太网硬件!
3
rt-thread使用cherryusb实现虚拟串口
4
《C++20 图形界面程序:速度与渲染效率的双重优化秘籍》
5
《原子操作:程序世界里的“最小魔法单位”解析》
热门标签
RT-Thread Studio
串口
Env
LWIP
SPI
AT
Bootloader
Hardfault
CAN总线
FinSH
ART-Pi
USB
DMA
文件系统
RT-Thread
SCons
RT-Thread Nano
线程
MQTT
STM32
RTC
FAL
rt-smart
ESP8266
I2C_IIC
WIZnet_W5500
ota在线升级
UART
PWM
cubemx
freemodbus
flash
packages_软件包
BSP
潘多拉开发板_Pandora
定时器
ADC
GD32
flashDB
socket
中断
Debug
编译报错
msh
SFUD
keil_MDK
rt_mq_消息队列_msg_queue
at_device
ulog
C++_cpp
本月问答贡献
踩姑娘的小蘑菇
7
个答案
3
次被采纳
张世争
8
个答案
2
次被采纳
rv666
5
个答案
2
次被采纳
用户名由3_15位
11
个答案
1
次被采纳
KunYi
6
个答案
1
次被采纳
本月文章贡献
程序员阿伟
6
篇文章
2
次点赞
hhart
3
篇文章
4
次点赞
大龄码农
1
篇文章
2
次点赞
ThinkCode
1
篇文章
1
次点赞
Betrayer
1
篇文章
1
次点赞
回到
顶部
发布
问题
分享
好友
手机
浏览
扫码手机浏览
投诉
建议
回到
底部