Toggle navigation
首页
问答
文章
积分商城
专家
专区
更多专区...
文档中心
返回主站
搜索
提问
会员
中心
登录
注册
BSP
stm32f429-st-disco在ubuntu下gcc编译报错重复定义
发布于 2020-01-06 18:23:11 浏览:1606
订阅该版
我用的github上master最新版代码, - ubuntu18.04, - arm-none-eabi-gcc(GNU Tools for Arm Embedded Processors 7-2018-q3-update) 7.3.1工具链 在stm32f429-st-disco bsp包下执行scons开始gcc编译,报错显示重复定义: ``` scons: Reading SConscript files ... scons: done reading SConscript files. scons: Building targets ... scons: building associated VariantDir targets: build CC build/applications/lcd_init.o In file included from /usr/arm-none-eabi/include/signal.h:6:0, from /home/dianli/workspace/src/rt-thread-master/include/libc/libc_signal.h:71, from /home/dianli/workspace/src/rt-thread-master/include/rtlibc.h:21, from /home/dianli/workspace/src/rt-thread-master/include/rtdef.h:1088, from /home/dianli/workspace/src/rt-thread-master/include/rtthread.h:24, from applications/lcd_init.c:11: /usr/arm-none-eabi/include/sys/signal.h:42:7: error: redefinition of 'union sigval' union sigval { ^~~~~~ In file included from /home/dianli/workspace/src/rt-thread-master/include/rtlibc.h:21:0, from /home/dianli/workspace/src/rt-thread-master/include/rtdef.h:1088, from /home/dianli/workspace/src/rt-thread-master/include/rtthread.h:24, from applications/lcd_init.c:11: /home/dianli/workspace/src/rt-thread-master/include/libc/libc_signal.h:27:7: note: originally defined here union sigval ^~~~~~ In file included from /usr/arm-none-eabi/include/signal.h:6:0, from /home/dianli/workspace/src/rt-thread-master/include/libc/libc_signal.h:71, from /home/dianli/workspace/src/rt-thread-master/include/rtlibc.h:21, from /home/dianli/workspace/src/rt-thread-master/include/rtdef.h:1088, from /home/dianli/workspace/src/rt-thread-master/include/rtthread.h:24, from applications/lcd_init.c:11: /usr/arm-none-eabi/include/sys/signal.h:47:8: error: redefinition of 'struct sigevent' struct sigevent { ^~~~~~~~ In file included from /home/dianli/workspace/src/rt-thread-master/include/rtlibc.h:21:0, from /home/dianli/workspace/src/rt-thread-master/include/rtdef.h:1088, from /home/dianli/workspace/src/rt-thread-master/include/rtthread.h:24, from applications/lcd_init.c:11: /home/dianli/workspace/src/rt-thread-master/include/libc/libc_signal.h:35:8: note: originally defined here struct sigevent ^~~~~~~~ In file included from /usr/arm-none-eabi/include/signal.h:6:0, from /home/dianli/workspace/src/rt-thread-master/include/libc/libc_signal.h:71, from /home/dianli/workspace/src/rt-thread-master/include/rtlibc.h:21, from /home/dianli/workspace/src/rt-thread-master/include/rtdef.h:1088, from /home/dianli/workspace/src/rt-thread-master/include/rtthread.h:24, from applications/lcd_init.c:11: /usr/arm-none-eabi/include/sys/signal.h:72:3: error: conflicting types for 'siginfo_t' } siginfo_t; ^~~~~~~~~ In file included from /home/dianli/workspace/src/rt-thread-master/include/rtlibc.h:21:0, from /home/dianli/workspace/src/rt-thread-master/include/rtdef.h:1088, from /home/dianli/workspace/src/rt-thread-master/include/rtthread.h:24, from applications/lcd_init.c:11: /home/dianli/workspace/src/rt-thread-master/include/libc/libc_signal.h:54:24: note: previous declaration of 'siginfo_t' was here typedef struct siginfo siginfo_t; ^~~~~~~~~ scons: *** [build/applications/lcd_init.o] Error 1 scons: building terminated because of errors. ``` 试了下`stm32f429-fire-challenger bsp`下执行scons却可以顺利编译通过,搞不清楚这是什么问题
查看更多
6
个回答
默认排序
按发布时间排序
hctang
2020-01-06
这家伙很懒,什么也没写!
在rtconfig.h文件中手动定义 ```c #define HAVE_SIGACTION 1 #define HAVE_SIGEVENT 1 #define HAVE_SIGINFO 1 #define HAVE_SIGVAL 1 ``` 可以解决问题。 但是我发现在`tools/gcc.py`中GCCResult其实会进行一些判断并且会在`GenerateGCCConfig`中将以上定义写入`cconfig.h`,但是显然在某个地方出了问题,cconfig.h中只有 ```c /* Automatically generated file; DO NOT EDIT. */ /* compiler configure file for RT-Thread in GCC*/ #define GCC_VERSION "7.3.1 20180622 (release) [ARM/embedded-7-branch revision 261907]" #define STDC "1989" ``` 还请诸位大神给分析分析到底是哪里出问题了
bernard
2020-01-06
这家伙很懒,什么也没写!
删除cconfig.h文件,或者scons -c后,是否正确? 不过你的GCC版本是相对高的,这个版本不能开pthreads,应该是这样
hctang
2020-01-06
这家伙很懒,什么也没写!
用了scons -c,生成的cconfig.h文件确实少了那些定义
hctang
2020-01-06
这家伙很懒,什么也没写!
更奇怪的是其他有些stm32f429的bsp应该也存在这个问题的,但偏偏他们就不会报错
hctang
2020-01-07
这家伙很懒,什么也没写!
找到原因了,在gcc.py中GetGCCRoot函数有如下假定 ```python if exec_path == '/usr/bin': root_path = os.path.join('/usr/lib', prefix) else: root_path = os.path.join(exec_path, '..', prefix) ``` 根据前面的报错提示是与`/usr/arm-none-eabi/include/`中的头文件冲突了,所以只要把`root_path = os.path.join('/usr/lib', prefix)`中的`/usr/lib`改为`/usr`就行了。
李肯陪你玩赚嵌入式
认证专家
2021-10-11
2022年度和2023年度RT-Thread社区优秀开源布道师,COC深圳城市开发者社区主理人,专注于嵌入式物联网的架构设计
感谢楼主分享这个问题的解决方法,之前有遇到类似这种文件定义冲突的问题,很头疼。
撰写答案
登录
注册新账号
关注者
0
被浏览
1.6k
关于作者
hctang
这家伙很懒,什么也没写!
提问
1
回答
4
被采纳
0
关注TA
发私信
相关问题
1
STM32 407 串口接收数据 系统卡死
2
RTT nrf24l01 设备驱动程序
3
stm32f10x串口只能发送数据,无法接收
4
第一次尝试移植rt-thread 到stm32F103系列问题
5
有人把stm32L07xx的bsp移到rtt上来了吗?求一个
6
rt-thread线程调度异常在stm32f103芯片上
7
RTT是否支持STM32F429
8
请问谁有 STM32F40x HAL + RT-THREAD 模板
9
rt-thread在stm32f411下的移植问题
10
针对STM32F7系列平台的MPU,Cache特性,需要注意哪些问题?
推荐文章
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
rt-thread官方usb驱动之虚拟串口
2
RTduino物联网应用零基础入门
3
TinyUSB Demo运行教程
4
RT-Thread学习大礼包一键带走!
5
freemodbus从机调试说明
热门标签
RT-Thread Studio
串口
Env
LWIP
SPI
AT
Bootloader
Hardfault
CAN总线
ART-Pi
FinSH
USB
DMA
文件系统
RT-Thread
SCons
RT-Thread Nano
线程
MQTT
STM32
RTC
FAL
rt-smart
ESP8266
I2C_IIC
WIZnet_W5500
ota在线升级
UART
cubemx
freemodbus
PWM
flash
packages_软件包
BSP
潘多拉开发板_Pandora
定时器
ADC
GD32
flashDB
socket
中断
Debug
编译报错
msh
SFUD
rt_mq_消息队列_msg_queue
keil_MDK
ulog
C++_cpp
at_device
本月问答贡献
踩姑娘的小蘑菇
5
个答案
3
次被采纳
张世争
8
个答案
2
次被采纳
rv666
3
个答案
2
次被采纳
用户名由3_15位
11
个答案
1
次被采纳
KunYi
5
个答案
1
次被采纳
本月文章贡献
出出啊
1
篇文章
2
次点赞
小小李sunny
1
篇文章
1
次点赞
张世争
1
篇文章
4
次点赞
crystal266
2
篇文章
2
次点赞
whj467467222
2
篇文章
1
次点赞
回到
顶部
发布
问题
分享
好友
手机
浏览
扫码手机浏览
投诉
建议
回到
底部