主题 : 求大神指点 linux下的串口通信问题 复制链接 | 浏览器收藏 | 打印
级别: 新手上路
UID: 81348
精华: 0
发帖: 3
金钱: 15 两
威望: 3 点
综合积分: 6 分
注册时间: 2012-11-07
最后登录: 2012-11-10
楼主  发表于: 2012-11-09 21:43

 求大神指点 linux下的串口通信问题

我在写完serial文件编译之后出现下面这段文字
huankou.c: In function ‘set_Parity’:
chuankou.c:53:11: error: ‘FALSE’ undeclared (first use in this function)
chuankou.c:53:11: note: each undeclared identifier is reported only once for each function it appears in
chuankou.c:120:11: error: ‘TRUE’ undeclared (first use in this function)
chuankou.c: In function ‘main’:
chuankou.c:154:32: error: ‘FALSE’ undeclared (first use in this function)
我是菜鸟 下周要交作业 这刚开始接触 求大神指点
秋秋号564917271如果您方便加我qq号也可以
在线等
级别: 骑士
UID: 29604
精华: 9
发帖: 171
金钱: 1830 两
威望: 366 点
综合积分: 522 分
注册时间: 2010-10-01
最后登录: 2016-04-13
1楼  发表于: 2012-11-09 22:12
c语言有大小写分别
FALSE你可以试试false
TRUE你可以试试true
某些c++确实可以用大写的FALSE、TRUE
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
2楼  发表于: 2012-11-09 22:14
FALSE和TRUE这两个宏没有定义。通常可以写成
复制代码
  1. #ifndef FALSE
  2. #define FALSE 0
  3. #endif
  4. #ifndef TRUE
  5. #define TRUE 1
  6. #endif
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 新手上路
UID: 81348
精华: 0
发帖: 3
金钱: 15 两
威望: 3 点
综合积分: 6 分
注册时间: 2012-11-07
最后登录: 2012-11-10
3楼  发表于: 2012-11-09 22:20

 回 1楼(benjaminwan) 的帖子

我改了也还是一样的错误