Toggle navigation
首页
问答
文章
积分商城
专家
专区
更多专区...
文档中心
返回主站
搜索
提问
会员
中心
登录
注册
RT-Thread发布
最简编译出错
发布于 2012-08-03 15:52:27 浏览:4311
订阅该版
我下载的是trunk版本,使用的是 AT91SAM7S 注释了rtconfig.h的绝大部分宏,去掉了很多组建,但是编译却出错了, **rtconfig.h 如下** ``` /* RT-Thread config file */ #ifndef __RTTHREAD_CFG_H__ #define __RTTHREAD_CFG_H__ /* RT_NAME_MAX*/ #define RT_NAME_MAX 8 /* RT_ALIGN_SIZE*/ #define RT_ALIGN_SIZE 4 /* PRIORITY_MAX*/ #define RT_THREAD_PRIORITY_MAX 32 /* Tick per Second*/ #define RT_TICK_PER_SECOND 100 /* SECTION: RT_DEBUG */ /* Thread Debug*/ //#define RT_DEBUG /* #define RT_THREAD_DEBUG */ /* Using Hook*/ //#define RT_USING_HOOK /* SECTION: IPC */ /* Using Semaphore*/ //#define RT_USING_SEMAPHORE /* Using Mutex*/ //#define RT_USING_MUTEX /* Using Event*/ //#define RT_USING_EVENT /* Using MailBox*/ //#define RT_USING_MAILBOX /* Using Message Queue*/ #define RT_USING_MESSAGEQUEUE /* SECTION: Memory Management */ /* Using Memory Pool Management*/ //#define RT_USING_MEMPOOL /* Using Dynamic Heap Management*/ //#define RT_USING_HEAP /* Using Small MM*/ #define RT_USING_SMALL_MEM /* Using SLAB Allocator*/ /* #define RT_USING_SLAB */ /* SECTION: Device System */ /* Using Device System*/ //#define RT_USING_DEVICE //#define RT_USING_CONSOLE /* buffer size for UART reception*/ //#define RT_UART_RX_BUFFER_SIZE 64 /* buffer size for UART transmission*/ //#define RT_UART_TX_BUFFER_SIZE 64 /* Using UART1*/ //#define RT_USING_UART1 /* Using UART2*/ /* #define RT_USING_UART2 */ /* SECTION: Console options */ /* the buffer size of console*/ //#define RT_CONSOLEBUF_SIZE 128 /* SECTION: FinSH shell options */ /* Using FinSH as Shell*/ //#define RT_USING_FINSH /* use symbol table */ //#define FINSH_USING_SYMTAB //#define FINSH_USING_DESCRIPTION /* SECTION: a runtime libc library */ /* a runtime libc library*/ /* #define RT_USING_NEWLIB */ #endif ``` **编译错误如下:** ``` Build target 'RT-Thread/AT91SAM7S' compiling application.c... compiling board.c... compiling startup.c... compiling clock.c... compiling idle.c... compiling ipc.c... compiling irq.c... compiling kservice.c... compiling mem.c... compiling mempool.c... compiling object.c... compiling timer.c... compiling scheduler.c... compiling slab.c... compiling thread.c... compiling device.c... compiling cpu.c... compiling interrupt.c... compiling serial.c... ....libcpuarmAT91SAM7Sserial.c(60): error: #70: incomplete type is not allowed ....libcpuarmAT91SAM7Sserial.c: struct rt_device parent; ....libcpuarmAT91SAM7Sserial.c: ^ ....libcpuarmAT91SAM7Sserial.c(68): error: #20: identifier "RT_UART_RX_BUFFER_SIZE" is undefined ....libcpuarmAT91SAM7Sserial.c: rt_uint8_t rx_buffer[RT_UART_RX_BUFFER_SIZE]; ....libcpuarmAT91SAM7Sserial.c: ^ ....libcpuarmAT91SAM7Sserial.c(100): error: #20: identifier "rt_device_t" is undefined ....libcpuarmAT91SAM7Sserial.c: device = (rt_device_t)serial; ....libcpuarmAT91SAM7Sserial.c: ^ ....libcpuarmAT91SAM7Sserial.c(100): error: #65: expected a ";" ....libcpuarmAT91SAM7Sserial.c: device = (rt_device_t)serial; ....libcpuarmAT91SAM7Sserial.c: ^ ....libcpuarmAT91SAM7Sserial.c(125): error: #393: pointer to incomplete class type is not allowed ....libcpuarmAT91SAM7Sserial.c: if (device->rx_indicate != RT_NULL) ....libcpuarmAT91SAM7Sserial.c: ^ ....libcpuarmAT91SAM7Sserial.c(126): error: #393: pointer to incomplete class type is not allowed ....libcpuarmAT91SAM7Sserial.c: device->rx_indicate(device, 1); ....libcpuarmAT91SAM7Sserial.c: ^ ....libcpuarmAT91SAM7Sserial.c(132): error: #20: identifier "rt_device_t" is undefined ....libcpuarmAT91SAM7Sserial.c: static rt_err_t rt_serial_init (rt_device_t dev) ....libcpuarmAT91SAM7Sserial.c: ^ ....libcpuarmAT91SAM7Sserial.c(187): error: #20: identifier "rt_device_t" is undefined ....libcpuarmAT91SAM7Sserial.c: static rt_err_t rt_serial_open(rt_device_t dev, rt_uint16_t oflag) ....libcpuarmAT91SAM7Sserial.c: ^ ....libcpuarmAT91SAM7Sserial.c(192): error: #20: identifier "RT_DEVICE_FLAG_INT_RX" is undefined ....libcpuarmAT91SAM7Sserial.c: if (dev->flag & RT_DEVICE_FLAG_INT_RX) ....libcpuarmAT91SAM7Sserial.c: ^ ....libcpuarmAT91SAM7Sserial.c(207): error: #20: identifier "rt_device_t" is undefined ....libcpuarmAT91SAM7Sserial.c: static rt_err_t rt_serial_close(rt_device_t dev) ....libcpuarmAT91SAM7Sserial.c: ^ ....libcpuarmAT91SAM7Sserial.c(212): error: #20: identifier "RT_DEVICE_FLAG_INT_RX" is undefined ....libcpuarmAT91SAM7Sserial.c: if (dev->flag & RT_DEVICE_FLAG_INT_RX) ....libcpuarmAT91SAM7Sserial.c: ^ ....libcpuarmAT91SAM7Sserial.c(222): error: #20: identifier "rt_device_t" is undefined ....libcpuarmAT91SAM7Sserial.c: static rt_size_t rt_serial_read (rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) ....libcpuarmAT91SAM7Sserial.c: ^ ....libcpuarmAT91SAM7Sserial.c(231): error: #20: identifier "RT_DEVICE_FLAG_INT_RX" is undefined ....libcpuarmAT91SAM7Sserial.c: if (dev->flag & RT_DEVICE_FLAG_INT_RX) ....libcpuarmAT91SAM7Sserial.c: ^ ....libcpuarmAT91SAM7Sserial.c(265): error: #20: identifier "RT_DEVICE_FLAG_DMA_RX" is undefined ....libcpuarmAT91SAM7Sserial.c: else if (dev->flag & RT_DEVICE_FLAG_DMA_RX) ....libcpuarmAT91SAM7Sserial.c: ^ ....libcpuarmAT91SAM7Sserial.c(290): error: #20: identifier "rt_device_t" is undefined ....libcpuarmAT91SAM7Sserial.c: static rt_size_t rt_serial_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) ....libcpuarmAT91SAM7Sserial.c: ^ ....libcpuarmAT91SAM7Sserial.c(297): error: #20: identifier "RT_DEVICE_OFLAG_WRONLY" is undefined ....libcpuarmAT91SAM7Sserial.c: if (dev->open_flag & RT_DEVICE_OFLAG_WRONLY) ....libcpuarmAT91SAM7Sserial.c: ^ ....libcpuarmAT91SAM7Sserial.c(299): error: #20: identifier "RT_DEVICE_FLAG_STREAM" is undefined ....libcpuarmAT91SAM7Sserial.c: if (dev->flag & RT_DEVICE_FLAG_STREAM) ....libcpuarmAT91SAM7Sserial.c: ^ ....libcpuarmAT91SAM7Sserial.c(336): error: #20: identifier "rt_device_t" is undefined ....libcpuarmAT91SAM7Sserial.c: static rt_err_t rt_serial_control (rt_device_t dev, rt_uint8_t cmd, void *args) ....libcpuarmAT91SAM7Sserial.c: ^ ....libcpuarmAT91SAM7Sserial.c(343): error: #20: identifier "rt_device_t" is undefined ....libcpuarmAT91SAM7Sserial.c: rt_device_t device; ....libcpuarmAT91SAM7Sserial.c: ^ ....libcpuarmAT91SAM7Sserial.c(132): warning: #177-D: function "rt_serial_init" was declared but never referenced ....libcpuarmAT91SAM7Sserial.c: static rt_err_t rt_serial_init (rt_device_t dev) ....libcpuarmAT91SAM7Sserial.c: ^ ....libcpuarmAT91SAM7Sserial.c(187): warning: #177-D: function "rt_serial_open" was declared but never referenced ....libcpuarmAT91SAM7Sserial.c: static rt_err_t rt_serial_open(rt_device_t dev, rt_uint16_t oflag) ....libcpuarmAT91SAM7Sserial.c: ^ ....libcpuarmAT91SAM7Sserial.c(207): warning: #177-D: function "rt_serial_close" was declared but never referenced ....libcpuarmAT91SAM7Sserial.c: static rt_err_t rt_serial_close(rt_device_t dev) ....libcpuarmAT91SAM7Sserial.c: ^ ....libcpuarmAT91SAM7Sserial.c(222): warning: #177-D: function "rt_serial_read" was declared but never referenced ....libcpuarmAT91SAM7Sserial.c: static rt_size_t rt_serial_read (rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) ....libcpuarmAT91SAM7Sserial.c: ^ ....libcpuarmAT91SAM7Sserial.c(290): warning: #177-D: function "rt_serial_write" was declared but never referenced ....libcpuarmAT91SAM7Sserial.c: static rt_size_t rt_serial_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) ....libcpuarmAT91SAM7Sserial.c: ^ ....libcpuarmAT91SAM7Sserial.c(336): warning: #177-D: function "rt_serial_control" was declared but never referenced ....libcpuarmAT91SAM7Sserial.c: static rt_err_t rt_serial_control (rt_device_t dev, rt_uint8_t cmd, void *args) ....libcpuarmAT91SAM7Sserial.c: ^ ....libcpuarmAT91SAM7Sserial.c: ....libcpuarmAT91SAM7Sserial.c: 6 warnings, 19 errors compiling stack.c... compiling trap.c... compiling cmd.c... compiling finsh_compiler.c... compiling finsh_error.c... compiling finsh_heap.c... compiling finsh_init.c... compiling finsh_node.c... compiling finsh_ops.c... compiling finsh_parser.c... compiling finsh_token.c... compiling finsh_var.c... compiling finsh_vm.c... compiling shell.c... ....componentsfinshshell.h(51): error: #70: incomplete type is not allowed ....componentsfinshshell.h: struct rt_semaphore rx_sem; ....componentsfinshshell.h: ^ ....componentsfinshshell.h(70): error: #20: identifier "rt_device_t" is undefined ....componentsfinshshell.h: rt_device_t device; ....componentsfinshshell.h: ^ ....componentsfinshshell.c(104): error: #20: identifier "rt_device_t" is undefined ....componentsfinshshell.c: static rt_err_t finsh_rx_ind(rt_device_t dev, rt_size_t size) ....componentsfinshshell.c: ^ ....componentsfinshshell.c(109): warning: #223-D: function "rt_sem_release" declared implicitly ....componentsfinshshell.c: rt_sem_release(&shell->rx_sem); ....componentsfinshshell.c: ^ ....componentsfinshshell.c(123): error: #20: identifier "rt_device_t" is undefined ....componentsfinshshell.c: rt_device_t dev = RT_NULL; ....componentsfinshshell.c: ^ ....componentsfinshshell.c(126): warning: #223-D: function "rt_device_find" declared implicitly ....componentsfinshshell.c: dev = rt_device_find(device_name); ....componentsfinshshell.c: ^ ....componentsfinshshell.c(127): warning: #223-D: function "rt_device_open" declared implicitly ....componentsfinshshell.c: if (dev != RT_NULL && rt_device_open(dev, RT_DEVICE_OFLAG_RDWR) == RT_EOK) ....componentsfinshshell.c: ^ ....componentsfinshshell.c(127): error: #20: identifier "RT_DEVICE_OFLAG_RDWR" is undefined ....componentsfinshshell.c: if (dev != RT_NULL && rt_device_open(dev, RT_DEVICE_OFLAG_RDWR) == RT_EOK) ....componentsfinshshell.c: ^ ....componentsfinshshell.c(132): warning: #223-D: function "rt_device_close" declared implicitly ....componentsfinshshell.c: rt_device_close(shell->device); ....componentsfinshshell.c: ^ ....componentsfinshshell.c(136): warning: #223-D: function "rt_device_set_rx_indicate" declared implicitly ....componentsfinshshell.c: rt_device_set_rx_indicate(dev, finsh_rx_ind); ....componentsfinshshell.c: ^ ....componentsfinshshell.c(365): warning: #223-D: function "rt_sem_take" declared implicitly ....componentsfinshshell.c: if (rt_sem_take(&shell->rx_sem, RT_WAITING_FOREVER) != RT_EOK) continue; ....componentsfinshshell.c: ^ ....componentsfinshshell.c(368): warning: #223-D: function "rt_device_read" declared implicitly ....componentsfinshshell.c: while (rt_device_read(shell->device, 0, &ch, 1) == 1) ....componentsfinshshell.c: ^ ....componentsfinshshell.c(513): warning: #223-D: function "rt_sem_init" declared implicitly ....componentsfinshshell.c: rt_sem_init(&(shell->rx_sem), "shrx", 0, 0); ....componentsfinshshell.c: ^ ....componentsfinshshell.c: ....componentsfinshshell.c: 8 warnings, 5 errors compiling symbol.c... Target not created ```
查看更多
2
个回答
默认排序
按发布时间排序
prife
2012-08-03
这家伙很懒,什么也没写!
如何裁剪参考这里: [http://www.rt-thread.org/dokuwiki/doku.php](http://www.rt-thread.org/dokuwiki/doku.php) 其他 RT-Thread裁剪示例 另外,注释掉宏以后,需要使用 scons重新生成工程。 SCons的用法参见wiki: 配置RT-Thread开发环境 RT-Thread中的SCons使用详解 或者可以看这篇文档:ART使用MDK开发.pdf [https://pan.baidu.com/s/1jHXLvH8](https://pan.baidu.com/s/1jHXLvH8)
撰写答案
登录
注册新账号
关注者
0
被浏览
4.3k
关于作者
himm
这家伙很懒,什么也没写!
提问
1
回答
0
被采纳
0
关注TA
发私信
相关问题
1
RT-Thread单内核v0.2.2正式版
2
[发布] RT-Thread RTOS v0.2.3版本
3
RT-Thread 0.3.0 beta
4
RT-Thread/STM32 0.3.0 RC1发布
5
RT-Thread/LM3S 0.3.0 RC1版发布
6
建议弄个MIPS版本的。龙芯上用。
7
开源实时操作系统RT-Thread 0.3.0正式版发布
8
关于RT-THREAD的UDP讨论
9
这里是BUG回报板块!
10
rt-thread stm32 0.3.0 rc1 网络问题
推荐文章
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 小内存算法源码分析
2
env中添加lvgl软件包后,keil编译包--c99错误
3
【NXP-MCXA153】 定时器驱动移植
4
GD32F450 看门狗驱动适配
5
【NXP-MCXA153】看门狗驱动移植
热门标签
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
GD32
flashDB
socket
中断
编译报错
Debug
rt_mq_消息队列_msg_queue
SFUD
keil_MDK
msh
ulog
C++_cpp
MicroPython
本月问答贡献
踩姑娘的小蘑菇
7
个答案
2
次被采纳
a1012112796
18
个答案
1
次被采纳
红枫
8
个答案
1
次被采纳
Ryan_CW
5
个答案
1
次被采纳
张世争
4
个答案
1
次被采纳
本月文章贡献
YZRD
3
篇文章
6
次点赞
catcatbing
3
篇文章
6
次点赞
lizimu
2
篇文章
11
次点赞
qq1078249029
2
篇文章
2
次点赞
xnosky
2
篇文章
1
次点赞
回到
顶部
发布
问题
分享
好友
手机
浏览
扫码手机浏览
投诉
建议
回到
底部