TInyOS 1.x 编译 BLINK 时产生错误
root@everton-laptop:/opt/tinyos-1.x/apps/Blink# make pc
compiling Blink to a pc binary
ncc -o build/pc/main.exe -g -O0 -board=micasb -pthread -target=pc -Wall -Wshadow -DDEF_TOS_AM_GROUP=0x7d -Wnesc-all -fnesc-nido-tosnodes=1000 -fnesc-cfile=build/pc/app.c Blink.nc -lm
In file included from /opt/tinyos-1.x/tos/platform/pc/packet_sim.h:55,
from /opt/tinyos-1.x/tos/platform/pc/nido.h:81,
from /opt/tinyos-1.x/tos/platform/pc/hardware.h:43,
from /opt/tinyos-1.x/tos/system/tos.h:144:
/opt/tinyos-1.x/tos/types/AM.h:155: parse error before `struct'
/opt/tinyos-1.x/tos/types/AM.h:156: parse error before `struct'
/opt/tinyos-1.x/tos/types/AM.h:158: parse error before `struct'
/opt/tinyos-1.x/tos/types/AM.h: In function `TOS_MsgLength':
/opt/tinyos-1.x/tos/types/AM.h:186: parse error before `TOS_Msg'
In file included from /opt/tinyos-1.x/tos/platform/pc/hardware.h:116,
from /opt/tinyos-1.x/tos/system/tos.h:144:
/opt/tinyos-1.x/tos/platform/pc/eeprom.c: At top level:
/opt/tinyos-1.x/tos/platform/pc/eeprom.c:115: warning: declaration of `length' shadows global declaration
/opt/tinyos-1.x/tos/types/AM.h:158: warning: location of shadowed declaration
/opt/tinyos-1.x/tos/platform/pc/eeprom.c:145: warning: declaration of `length' shadows global declaration
/opt/tinyos-1.x/tos/types/AM.h:158: warning: location of shadowed declaration
make: *** [build/pc/main.exe] Error 1
尝试编译 BLink,但我不断收到上述错误,但不知道下一步该怎么做。任何帮助都会很好。
root@everton-laptop:/opt/tinyos-1.x/apps/Blink# make pc
compiling Blink to a pc binary
ncc -o build/pc/main.exe -g -O0 -board=micasb -pthread -target=pc -Wall -Wshadow -DDEF_TOS_AM_GROUP=0x7d -Wnesc-all -fnesc-nido-tosnodes=1000 -fnesc-cfile=build/pc/app.c Blink.nc -lm
In file included from /opt/tinyos-1.x/tos/platform/pc/packet_sim.h:55,
from /opt/tinyos-1.x/tos/platform/pc/nido.h:81,
from /opt/tinyos-1.x/tos/platform/pc/hardware.h:43,
from /opt/tinyos-1.x/tos/system/tos.h:144:
/opt/tinyos-1.x/tos/types/AM.h:155: parse error before `struct'
/opt/tinyos-1.x/tos/types/AM.h:156: parse error before `struct'
/opt/tinyos-1.x/tos/types/AM.h:158: parse error before `struct'
/opt/tinyos-1.x/tos/types/AM.h: In function `TOS_MsgLength':
/opt/tinyos-1.x/tos/types/AM.h:186: parse error before `TOS_Msg'
In file included from /opt/tinyos-1.x/tos/platform/pc/hardware.h:116,
from /opt/tinyos-1.x/tos/system/tos.h:144:
/opt/tinyos-1.x/tos/platform/pc/eeprom.c: At top level:
/opt/tinyos-1.x/tos/platform/pc/eeprom.c:115: warning: declaration of `length' shadows global declaration
/opt/tinyos-1.x/tos/types/AM.h:158: warning: location of shadowed declaration
/opt/tinyos-1.x/tos/platform/pc/eeprom.c:145: warning: declaration of `length' shadows global declaration
/opt/tinyos-1.x/tos/types/AM.h:158: warning: location of shadowed declaration
make: *** [build/pc/main.exe] Error 1
Tried compiling BLink and i keep getting the above error and not sure what to do next. any help would be nice .
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
查看 CVS 存储库中的
tos/types/AM.h
,它似乎因以下代码而令人窒息:第 155、156 和 158 行中的常见项目是
offsetof()
宏,应该在stddef.h
中定义,并且看起来应该在导致AM 之前由
被包含,因此tos.h
引入。 hoffsetof()
应该已经被定义。您可能想验证您使用的编译器是否正确定义了
offsetof()
和/或为什么它不能在AM.h
中使用。如果有必要,您可以使用或多或少常用的实现自行定义它:Looking at the CVS repository for
tos/types/AM.h
, it looks like it's choking on the following code:The common item from lines 155, 156, and 158 are the
offsetof()
macro, which should be defined instddef.h
and which looks like should have been brought in by thetos.h
before it causesAM.h
to be included, sooffsetof()
should already be defined.You might want to verify whether or not the compiler you're using has
offsetof()
properly defined and/or why it's not available for use inAM.h
. If necessary, you can probably define it yourself using a more or less usual implementation: