Toggle navigation
首页
问答
文章
积分商城
专家
专区
更多专区...
文档中心
返回主站
搜索
提问
会员
中心
登录
注册
RT-Thread一般讨论
各位大侠帮忙看下这个问题
发布于 2018-07-09 18:32:51 浏览:3251
订阅该版
> scons --verbose scons: Reading SConscript files ... scons: warning: No version of Visual Studio compiler found - C/C++ compilers most likely not set correctly File "D:\work\env t-thread-3.0.4\bsp\beaglebone\SConstruct", line 22, in
scons: done reading SConscript files. scons: Building targets ... scons: building associated VariantDir targets: build arm-none-eabi-gcc -o build\applications\application.o -c -Wall -march=armv7-a -mtune=cortex-a8 -ftree-vectorize -ffast-math -mfpu=vfpv3-d16 -mfloat-abi=softfp -O0 -gdwarf-2 -Wall -DHAVE_CCONFIG_H -DRT_USING_NEWLIB -I. -Iapplications -Idrivers -ID:\work\env t-thread-3.0.4\include -ID:\work\env t-thread-3.0.4\libcpu\arm\am335x -ID:\work\env t-thread-3.0.4\libcpu\arm\common -ID:\work\env t-thread-3.0.4\components\cplusplus -ID:\work\env t-thread-3.0.4\components\dfs\include -ID:\work\env t-thread-3.0.4\components\dfs\filesystems\devfs -ID:\work\env t-thread-3.0.4\components\dfs\filesystems\elmfat -ID:\work\env t-thread-3.0.4\components\drivers\include -ID:\work\env t-thread-3.0.4\components\drivers\include -ID:\work\env t-thread-3.0.4\components\drivers\include -ID:\work\env t-thread-3.0.4\components\finsh -ID:\work\env t-thread-3.0.4\components\libc\compilers
ewlib applications\application.c arm-none-eabi-gcc -o build\applications\board.o -c -Wall -march=armv7-a -mtune=cortex-a8 -ftree-vectorize -ffast-math -mfpu=vfpv3-d16 -mfloat-abi=softfp -O0 -gdwarf-2 -Wall -DHAVE_CCONFIG_H -DRT_USING_NEWLIB -I. -Iapplications -Idrivers -ID:\work\env t-thread-3.0.4\include -ID:\work\env t-thread-3.0.4\libcpu\arm\am335x -ID:\work\env t-thread-3.0.4\libcpu\arm\common -ID:\work\env t-thread-3.0.4\components\cplusplus -ID:\work\env t-thread-3.0.4\components\dfs\include -ID:\work\env t-thread-3.0.4\components\dfs\filesystems\devfs -ID:\work\env t-thread-3.0.4\components\dfs\filesystems\elmfat -ID:\work\env t-thread-3.0.4\components\drivers\include -ID:\work\env t-thread-3.0.4\components\drivers\include -ID:\work\env t-thread-3.0.4\components\drivers\include -ID:\work\env t-thread-3.0.4\components\finsh -ID:\work\env t-thread-3.0.4\components\libc\compilers
ewlib applications\board.c arm-none-eabi-gcc -o build\applications\startup.o -c -Wall -march=armv7-a -mtune=cortex-a8 -ftree-vectorize -ffast-math -mfpu=vfpv3-d16 -mfloat-abi=softfp -O0 -gdwarf-2 -Wall -DHAVE_CCONFIG_H -DRT_USING_NEWLIB -I. -Iapplications -Idrivers -ID:\work\env t-thread-3.0.4\include -ID:\work\env t-thread-3.0.4\libcpu\arm\am335x -ID:\work\env t-thread-3.0.4\libcpu\arm\common -ID:\work\env t-thread-3.0.4\components\cplusplus -ID:\work\env t-thread-3.0.4\components\dfs\include -ID:\work\env t-thread-3.0.4\components\dfs\filesystems\devfs -ID:\work\env t-thread-3.0.4\components\dfs\filesystems\elmfat -ID:\work\env t-thread-3.0.4\components\drivers\include -ID:\work\env t-thread-3.0.4\components\drivers\include -ID:\work\env t-thread-3.0.4\components\drivers\include -ID:\work\env t-thread-3.0.4\components\finsh -ID:\work\env t-thread-3.0.4\components\libc\compilers
ewlib applications\startup.c arm-none-eabi-gcc -o build\drivers\gpio.o -c -Wall -march=armv7-a -mtune=cortex-a8 -ftree-vectorize -ffast-math -mfpu=vfpv3-d16 -mfloat-abi=softfp -O0 -gdwarf-2 -Wall -DHAVE_CCONFIG_H -DRT_USING_NEWLIB -I. -Iapplications -Idrivers -ID:\work\env t-thread-3.0.4\include -ID:\work\env t-thread-3.0.4\libcpu\arm\am335x -ID:\work\env t-thread-3.0.4\libcpu\arm\common -ID:\work\env t-thread-3.0.4\components\cplusplus -ID:\work\env t-thread-3.0.4\components\dfs\include -ID:\work\env t-thread-3.0.4\components\dfs\filesystems\devfs -ID:\work\env t-thread-3.0.4\components\dfs\filesystems\elmfat -ID:\work\env t-thread-3.0.4\components\drivers\include -ID:\work\env t-thread-3.0.4\components\drivers\include -ID:\work\env t-thread-3.0.4\components\drivers\include -ID:\work\env t-thread-3.0.4\components\finsh -ID:\work\env t-thread-3.0.4\components\libc\compilers
ewlib drivers\gpio.c arm-none-eabi-gcc -o build\drivers\uart.o -c -Wall -march=armv7-a -mtune=cortex-a8 -ftree-vectorize -ffast-math -mfpu=vfpv3-d16 -mfloat-abi=softfp -O0 -gdwarf-2 -Wall -DHAVE_CCONFIG_H -DRT_USING_NEWLIB -I. -Iapplications -Idrivers -ID:\work\env t-thread-3.0.4\include -ID:\work\env t-thread-3.0.4\libcpu\arm\am335x -ID:\work\env t-thread-3.0.4\libcpu\arm\common -ID:\work\env t-thread-3.0.4\components\cplusplus -ID:\work\env t-thread-3.0.4\components\dfs\include -ID:\work\env t-thread-3.0.4\components\dfs\filesystems\devfs -ID:\work\env t-thread-3.0.4\components\dfs\filesystems\elmfat -ID:\work\env t-thread-3.0.4\components\drivers\include -ID:\work\env t-thread-3.0.4\components\drivers\include -ID:\work\env t-thread-3.0.4\components\drivers\include -ID:\work\env t-thread-3.0.4\components\finsh -ID:\work\env t-thread-3.0.4\components\libc\compilers
ewlib drivers\uart.c g++ -o build\kernel\components\cplusplus\crt.o -c -Wall -march=armv7-a -mtune=cortex-a8 -ftree-vectorize -ffast-math -mfpu=vfpv3-d16 -mfloat-abi=softfp -O0 -gdwarf-2 -Wall -DHAVE_CCONFIG_H -DRT_USING_NEWLIB -I. -Iapplications -Idrivers -ID:\work\env t-thread-3.0.4\include -ID:\work\env t-thread-3.0.4\libcpu\arm\am335x -ID:\work\env t-thread-3.0.4\libcpu\arm\common -ID:\work\env t-thread-3.0.4\components\cplusplus -ID:\work\env t-thread-3.0.4\components\dfs\include -ID:\work\env t-thread-3.0.4\components\dfs\filesystems\devfs -ID:\work\env t-thread-3.0.4\components\dfs\filesystems\elmfat -ID:\work\env t-thread-3.0.4\components\drivers\include -ID:\work\env t-thread-3.0.4\components\drivers\include -ID:\work\env t-thread-3.0.4\components\drivers\include -ID:\work\env t-thread-3.0.4\components\finsh -ID:\work\env t-thread-3.0.4\components\libc\compilers
ewlib D:\work\env t-thread-3.0.4\components\cplusplus\crt.cpp Error in calling: g++ -o "build\kernel\components\cplusplus\crt.o" -c -Wall -march=armv7-a -mtune=cortex-a8 -ftree-vectorize -ffast-math -mfpu=vfpv3-d16 -mfloat-abi=softfp -O0 -gdwarf-2 -Wall -DHAVE_CCONFIG_H -DRT_USING_NEWLIB -I. -Iapplications -Idrivers -ID:\work\env t-thread-3.0.4\include -ID:\work\env t-thread-3.0.4\libcpu\arm\am335x -ID:\work\env t-thread-3.0.4\libcpu\arm\common -ID:\work\env t-thread-3.0.4\components\cplusplus -ID:\work\env t-thread-3.0.4\components\dfs\include -ID:\work\env t-thread-3.0.4\components\dfs\filesystems\devfs -ID:\work\env t-thread-3.0.4\components\dfs\filesystems\elmfat -ID:\work\env t-thread-3.0.4\components\drivers\include -ID:\work\env t-thread-3.0.4\components\drivers\include -ID:\work\env t-thread-3.0.4\components\drivers\include -ID:\work\env t-thread-3.0.4\components\finsh -ID:\work\env t-thread-3.0.4\components\libc\compilers
ewlib "D:\work\env t-thread-3.0.4\components\cplusplus\crt.cpp" Exception: [Error 2] : No such file or directory scons: *** [build\kernel\components\cplusplus\crt.o] Error 2 scons: building terminated because of errors. ______________________________________________________________________________________ "D:\work\env t-thread-3.0.4\components\cplusplus\crt.cpp"这个文件在硬盘上是存在,这到底是什么问题呢?
查看更多
6
个回答
默认排序
按发布时间排序
漫漫朔雪
2018-07-09
这家伙很懒,什么也没写!
我发现问题所在,是CXX被扩展成"g++“,而不是”arm-none-eabi-g++“。导致问题。但是CC都被正确扩展成”arm-none-eabi-gcc“。rt_config.py文件如下: _______________________________________________________________________________________________ import os # toolchains options ARCH='arm' CPU='am335x' CROSS_TOOL='gcc' if os.getenv('RTT_CC'): CROSS_TOOL = os.getenv('RTT_CC') if CROSS_TOOL == 'gcc': PLATFORM = 'gcc' EXEC_PATH = r'C:\Program Files (x86)\CodeSourcery\Sourcery_CodeBench_Lite_for_ARM_EABI\bin' if os.getenv('RTT_EXEC_PATH'): EXEC_PATH = os.getenv('RTT_EXEC_PATH') BUILD = 'debug' if PLATFORM == 'gcc': # toolchains PREFIX = 'arm-none-eabi-' CC = PREFIX + 'gcc' CXX = PREFIX + 'g++' AS = PREFIX + 'gcc' AR = PREFIX + 'ar' LINK = PREFIX + 'gcc' TARGET_EXT = 'elf' SIZE = PREFIX + 'size' OBJDUMP = PREFIX + 'objdump' OBJCPY = PREFIX + 'objcopy' DEVICE = ' -Wall -march=armv7-a -mtune=cortex-a8'+\ ' -ftree-vectorize -ffast-math -mfpu=vfpv3-d16 -mfloat-abi=softfp' #DEVICE = ' ' CFLAGS = DEVICE AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp -D__ASSEMBLY__' LFLAGS = DEVICE + ' -Wl,--gc-sections,-Map=rtthread-beaglebone.map,-cref,-u,Reset_Handler -T beaglebone_ram.lds' CPATH = '' LPATH = '' if BUILD == 'debug': CFLAGS += ' -O0 -gdwarf-2 -Wall' AFLAGS += ' -gdwarf-2' else: CFLAGS += ' -O2 -Wall' POST_ACTION = OBJCPY + ' -O binary $TARGET rtthread.bin\n' +\ SIZE + ' $TARGET \n' ________________________________________________________________________________________ 是不是scons有bug啊?!
yqiu
2018-07-09
这家伙很懒,什么也没写!
什么平台的,具体操作步骤是怎么样的?
漫漫朔雪
2018-07-09
这家伙很懒,什么也没写!
@yqiu 步骤: 1. 解压rt-thread-3.0.4.tar.gz到env下. 2. 从D:\work\env\sample下拷贝Kconfig文件到D:\work\env\rt-thread-3.0.4\bsp\beaglebone目录下。 3. 进入D:\work\env\rt-thread-3.0.4\bsp\beaglebone目录,右键选择ConEnv Here,进入env命令行 4. 执行scons编译,这时编译成功。 5. 执行menuconfig. 并选择"Support C++ features",然后保存退出menuconfig. 6. 执行scons编译,结果出错,如下: _____________________________________________________________________ > scons scons: Reading SConscript files ... scons: warning: No version of Visual Studio compiler found - C/C++ compilers most likely not set correctly File "D:\work\env\rt-thread-3.0.4\bsp\beaglebone\SConstruct", line 22, in
scons: done reading SConscript files. scons: Building targets ... scons: building associated VariantDir targets: build CC build\applications\application.o CC build\applications\board.o CC build\applications\startup.o CC build\drivers\gpio.o CC build\drivers\uart.o CXX build\kernel\components\cplusplus\crt.o Error in calling: g++ -o "build\kernel\components\cplusplus\crt.o" -c -Wall -march=armv7-a -mtune=cortex-a8 -ftree-vectorize -ffast-math -mfpu=vfpv3-d16 -mfloat-abi=softfp -O0 -gdwarf-2 -Wall -DHAVE_CCONFIG_H -DRT_USING_NEWLIB -I. -Iapplications -Idrivers -ID:\work\env\rt-thread-3.0.4\include -ID:\work\env\rt-thread-3.0.4\libcpu\arm\am335x -ID:\work\env\rt-thread-3.0.4\libcpu\arm\common -ID:\work\env\rt-thread-3.0.4\components\cplusplus -ID:\work\env\rt-thread-3.0.4\components\dfs\include -ID:\work\env\rt-thread-3.0.4\components\dfs\filesystems\devfs -ID:\work\env\rt-thread-3.0.4\components\dfs\filesystems\elmfat -ID:\work\env\rt-thread-3.0.4\components\drivers\include -ID:\work\env\rt-thread-3.0.4\components\drivers\include -ID:\work\env\rt-thread-3.0.4\components\drivers\include -ID:\work\env\rt-thread-3.0.4\components\finsh -ID:\work\env\rt-thread-3.0.4\components\libc\compilers\newlib "D:\work\env\rt-thread-3.0.4\components\cplusplus\crt.cpp" Exception: [Error 2] : No such file or directory scons: *** [build\kernel\components\cplusplus\crt.o] Error 2 scons: building terminated because of errors. _________________________________________________________________________________________
漫漫朔雪
2018-07-09
这家伙很懒,什么也没写!
7. 修改rt_config.py中CXX定义 —————————————————————————————— PREFIX = 'arm-none-eabi-' CC = PREFIX + 'gcc' CXX = PREFIX + 'g++' —————————————————————————————— 修改最后一项CXX为: —————————————————————————————— PREFIX = 'arm-none-eabi-' CC = PREFIX + 'gcc' CXX = 'arm-none-eabi-g++' —————————————————————————————— 再次执行scons编译,错误依旧: ———————————————————————————————— g++ -o "build\kernel\components\cplusplus\crt.o" -c -Wall -march=armv7-a -mtune=cortex-a8 -ftree-vectorize -ffast-math -mfpu=vfpv3-d16 -mfloat-abi=softfp -O0 -gdwarf-2 -Wall -DHAVE_CCONFIG_H -DRT_USING_NEWLIB -I. -Iapplications -Idrivers -ID:\work\env\rt-thread-3.0.4\include -ID:\work\env\rt-thread-3.0.4\libcpu\arm\am335x -ID:\work\env\rt-thread-3.0.4\libcpu\arm\common -ID:\work\env\rt-thread-3.0.4\components\cplusplus -ID:\work\env\rt-thread-3.0.4\components\dfs\include -ID:\work\env\rt-thread-3.0.4\components\dfs\filesystems\devfs -ID:\work\env\rt-thread-3.0.4\components\dfs\filesystems\elmfat -ID:\work\env\rt-thread-3.0.4\components\drivers\include -ID:\work\env\rt-thread-3.0.4\components\drivers\include -ID:\work\env\rt-thread-3.0.4\components\drivers\include -ID:\work\env\rt-thread-3.0.4\components\finsh -ID:\work\env\rt-thread-3.0.4\components\libc\compilers\newlib "D:\work\env\rt-thread-3.0.4\components\cplusplus\crt.cpp" Exception: [Error 2] : No such file or directory ———————————————————————————————————————————— 8. 查看D:\work\env\rt-thread-3.0.4\bsp\beaglebone\SConstruct文件,发现以下定义: _______________________________________________________________________ env = Environment(tools = ['mingw'], AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS, CC = rtconfig.CC, CCFLAGS = rtconfig.CFLAGS, AR = rtconfig.AR, ARFLAGS = '-rc', _______________________________________________________________________ 修改为(添加了其中CXX,对rtconfig不了解,暂时设置为rtconfig.CC): _______________________________________________________________________ env = Environment(tools = ['mingw'], AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS, CC = rtconfig.CC, CXX = rtconfig.CC, CCFLAGS = rtconfig.CFLAGS, AR = rtconfig.AR, ARFLAGS = '-rc', _______________________________________________________________________ 再次执行scons编译,出现以下问题: _______________________________________________________________________ > scons scons: Reading SConscript files ... scons: warning: No version of Visual Studio compiler found - C/C++ compilers most likely not set correctly File "D:\work\env\rt-thread-3.0.4\bsp\beaglebone\SConstruct", line 22, in
scons: done reading SConscript files. scons: Building targets ... scons: building associated VariantDir targets: build CXX build\kernel\components\cplusplus\crt.o LINK rtthread-beaglebone.elf build\kernel\src\components.o: In function `rtthread_startup': D:\work\env\rt-thread-3.0.4\src/components.c:226: multiple definition of `rtthread_startup' build\applications\startup.o:D:\work\env\rt-thread-3.0.4\bsp\beaglebone/applications/startup.c:29: first defined here build\kernel\src\components.o: In function `rt_application_init': D:\work\env\rt-thread-3.0.4\src/components.c:203: multiple definition of `rt_application_init' build\applications\application.o:D:\work\env\rt-thread-3.0.4\bsp\beaglebone/applications/application.c:23: first defined here build\kernel\components\cplusplus\crt_init.o: In function `_init': D:\work\env\rt-thread-3.0.4\components\cplusplus/crt_init.c:40: multiple definition of `_init' d:/work/env/tools/gnu_gcc/arm_gcc/mingw/bin/../lib/gcc/arm-none-eabi/5.4.1/armv7-ar/thumb/softfp/crti.o:(.init+0x0): first defined here build\kernel\components\cplusplus\crt_init.o: In function `_fini': D:\work\env\rt-thread-3.0.4\components\cplusplus/crt_init.c:44: multiple definition of `_fini' d:/work/env/tools/gnu_gcc/arm_gcc/mingw/bin/../lib/gcc/arm-none-eabi/5.4.1/armv7-ar/thumb/softfp/crti.o:(.fini+0x0): first defined here collect2.exe: error: ld returned 1 exit status scons: *** [rtthread-beaglebone.elf] Error 1 scons: building terminated because of errors. ____________________________________________________________________________________ 但是前面问题没有了,说明跟安装mingw环境有关
漫漫朔雪
2018-07-09
这家伙很懒,什么也没写!
9. 修改SConstruct,相关部分改为如下: env = Environment(tools = ['mingw'], AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS, CC = rtconfig.CC, CCFLAGS = rtconfig.CFLAGS, CXX = rtconfig.CC, CXXFLAGS = rtconfig.CXXFLAGS, AR = rtconfig.AR, ARFLAGS = '-rc', LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS) 增加CXX和CXXFLGAS。 10. 修改rtconfig.py,增加“CXXFLAGS = CFLAGS” 11. 执行scons编译,仍然如下: __________________________________ ........... CC build\kernel\src\signal.o CC build\kernel\src\thread.o CC build\kernel\src\timer.o LINK rtthread-beaglebone.elf build\kernel\components\cplusplus\crt_init.o: In function `_init': D:\work\env\rt-thread-3.0.4\components\cplusplus/crt_init.c:40: multiple definition of `_init' d:/work/env/tools/gnu_gcc/arm_gcc/mingw/bin/../lib/gcc/arm-none-eabi/5.4.1/armv7-ar/thumb/softfp/crti.o:(.init+0x0): first defined here build\kernel\components\cplusplus\crt_init.o: In function `_fini': D:\work\env\rt-thread-3.0.4\components\cplusplus/crt_init.c:44: multiple definition of `_fini' d:/work/env/tools/gnu_gcc/arm_gcc/mingw/bin/../lib/gcc/arm-none-eabi/5.4.1/armv7-ar/thumb/softfp/crti.o:(.fini+0x0): first defined here collect2.exe: error: ld returned 1 exit status scons: *** [rtthread-beaglebone.elf] Error 1 scons: building terminated because of errors. ___________________________________________________
漫漫朔雪
2018-07-09
这家伙很懒,什么也没写!
[i=s] 本帖最后由 漫漫朔雪 于 2018-7-9 23:40 编辑 [/i] 又出现重复定义,@yqiu怎么处理. 这个C++特性支持,我们不一定用,我就是想试下各个可能用到的模块是否能正常编译通过。
撰写答案
登录
注册新账号
关注者
0
被浏览
3.3k
关于作者
漫漫朔雪
这家伙很懒,什么也没写!
提问
10
回答
26
被采纳
0
关注TA
发私信
相关问题
1
有关动态模块加载的一篇论文
2
最近的调程序总结
3
晕掉了,这么久都不见layer2的踪影啊
4
继续K9ii的历程
5
[GUI相关] FreeType 2
6
[GUI相关]嵌入式系统中文输入法的设计
7
20081101 RT-Thread开发者聚会总结
8
嵌入式系统基础
9
linux2.4.19在at91rm9200 上的寄存器设置
10
[转]基于嵌入式Linux的通用触摸屏校准程序
推荐文章
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
在用clangd开发RTT吗,快来试试如何简单获得清晰干净的工作区
2
GD32F450 片内 flash驱动适配
3
STM32H7R7运行CherryUSB
4
RT-Smart首次线下培训,锁定2024 RT-Thread开发者大会!
5
使用RC522软件包驱动FM1722
热门标签
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
UART
WIZnet_W5500
ota在线升级
PWM
freemodbus
flash
cubemx
packages_软件包
BSP
潘多拉开发板_Pandora
定时器
ADC
flashDB
GD32
socket
中断
编译报错
Debug
SFUD
rt_mq_消息队列_msg_queue
msh
keil_MDK
ulog
C++_cpp
MicroPython
本月问答贡献
a1012112796
10
个答案
1
次被采纳
踩姑娘的小蘑菇
4
个答案
1
次被采纳
红枫
4
个答案
1
次被采纳
张世争
4
个答案
1
次被采纳
Ryan_CW
4
个答案
1
次被采纳
本月文章贡献
catcatbing
3
篇文章
6
次点赞
YZRD
2
篇文章
5
次点赞
qq1078249029
2
篇文章
2
次点赞
xnosky
2
篇文章
1
次点赞
Woshizhapuren
1
篇文章
5
次点赞
回到
顶部
发布
问题
分享
好友
手机
浏览
扫码手机浏览
投诉
建议
回到
底部