此前还跟朋友说Ubuntu下的TinyOS很稳定,不管怎么瞎整都没事。因为此前有个同事,用的是Fedora,系统更新一次TinyOS就立马不行了。现在看来我说错了,今天我的TinyOS也起不来了。以前系统也经常更新,但是从来没遇到过问题,最近一段时间没怎么摆弄它,所以也不知道是哪次系统升级把它整坏了,就连编译最简单的Blink都不行。重装了N遍都无法解决。症状如下,在终端内输入编译命令“make telosb”,直接给我甩回来一长串的syntax error,自带的例程怎么还可能有语法错误?!错误信息的前两行是mkdir -p build/telosb
compiling BlinkAppC to a telosb binary
ncc -o build/telosb/main.exe -Os -O -mdisable-hwmul -fnesc-separator=__ -Wall -Wshadow -Wnesc-all -target=telosb -fnesc-cfile=build/telosb/app.c -board= -DDEFINED_TOS_AM_GROUP=0x22 -DIDENT_APPNAME="BlinkAppC" -DIDENT_USERNAME="shouyanbo" -DIDENT_HOSTNAME="yanbo-thinkpad" -DIDENT_USERHASH=0x38722225L -DIDENT_TIMESTAMP=0x4d5e9b04L -DIDENT_UIDHASH=0xd22d1fe1L BlinkAppC.nc -lm
/usr/lib/ncc/deputy_nodeputy.h:4:20: error: stddef.h: No such file or directory
/usr/lib/ncc/nesc_nx.h:14:26: error: sys/inttypes.h: No such file or directory然后接下去还有一长串的语法错误信息:/usr/lib/ncc/nesc_nx.h:235: syntax error before `__nesc_ntoh_uint8"
/usr/lib/ncc/nesc_nx.h:240: syntax error before `__nesc_hton_uint8"
/usr/lib/ncc/nesc_nx.h:242: warning: type defaults to `int" in declaration of `base"
/usr/lib/ncc/nesc_nx.h:242: `value" undeclared here (not in a function)
/usr/lib/ncc/nesc_nx.h:242: warning: data definition has no type or storage class
/usr/lib/ncc/nesc_nx.h:243: syntax error before `return"
/usr/lib/ncc/nesc_nx.h:246: syntax error before `__nesc_ntoh_leuint8"
/usr/lib/ncc/nesc_nx.h:251: syntax error before `__nesc_hton_leuint8"
/usr/lib/ncc/nesc_nx.h:253: warning: type defaults to `int" in declaration of `base"
/usr/lib/ncc/nesc_nx.h:253: redefinition of `base"
/usr/lib/ncc/nesc_nx.h:242: previous declaration of `base"
/usr/lib/ncc/nesc_nx.h:253: `value" undeclared here (not in a function)
/usr/lib/ncc/nesc_nx.h:253: warning: data definition has no type or storage class
/usr/lib/ncc/nesc_nx.h:254: syntax error before `return"
/usr/lib/ncc/nesc_nx.h:257: syntax error before `__nesc_ntoh_int8"
/usr/lib/ncc/nesc_nx.h:257: syntax error before `__nesc_hton_int8"
/usr/lib/ncc/nesc_nx.h:257: syntax error before `__nesc_ntoh_leint8"
/usr/lib/ncc/nesc_nx.h:257: syntax error before `__nesc_hton_leint8"
/usr/lib/ncc/nesc_nx.h:258: syntax error before `__nesc_bf_decode8"
etc.而且问题好像是针对Telob的,编译micaz一点问题没有,“make micaz”运行地好好的。Google了好一阵子终于找到了解决方法。打开文件/opt/tinyos-2.1.1/support/make/msp/msp.rules,在OBJCOPY = msp430-objcopy
OBJDUMP = msp430-objdump
两行前加入CFLAGS += -I/usr/msp430/include
CFLAGS += -I/usr/lib/gcc-lib/msp430/3.2.3/include
保存、退出,问题解决。按照原帖子作者自己的说法是,这是个“偏方”,具体是什么原因造成这个问题的,有没有更“漂亮”的办法来解决它,不知道。说白了就是凑活着用。想想也是,我们是用TinyOS,这种问题就留给TinyOS的开发人员吧。现在已经把Ubuntu的自动更新禁用了,以后就手动给需要的软件升级了,不瞎升了,系统稳定最重要。Linux下LVM添加磁盘实践操作Ubuntu下Conky的设置相关资讯 Ubuntu教程
- Ubuntu教程 - 使用Ubuntu拷贝CD和 (12/18/2013 14:38:16)
- 让Ubuntu 12.10支持RAR和7Z文件解 (11/15/2012 18:51:50)
- Windows 7硬盘安装Ubuntu 12.10图 (11/03/2012 19:22:47)
| - 完美安装Ubuntu 12.10最新AMD显卡 (11/27/2012 08:17:47)
- Win 7硬盘安装Ubuntu 12.10 (11/05/2012 13:30:34)
- 虚拟机上Ubuntu 11.10升级到12.04 (10/12/2012 20:00:38)
|
本文评论 查看全部评论 (0)