Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/160.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java TInyOS 1.x在编译BLINK时生成错误_Java_C++_C_Tinyos - Fatal编程技术网

Java TInyOS 1.x在编译BLINK时生成错误

Java TInyOS 1.x在编译BLINK时生成错误,java,c++,c,tinyos,Java,C++,C,Tinyos,root@everton-笔记本电脑:/opt/tinyos-1.x/apps/Blink#制作电脑 尝试编译BLink时,我不断遇到上述错误,不确定下一步该怎么办。任何帮助都很好。查看CVS存储库中的tos/types/AM.h,它似乎被以下代码阻塞了: 154: enum { 155: MSG_DATA_SIZE = offsetof(struct TOS_Msg, crc) + sizeof(uint16_t), // 36 by default 156: TINYSEC_MS

root@everton-笔记本电脑:/opt/tinyos-1.x/apps/Blink#制作电脑


尝试编译BLink时,我不断遇到上述错误,不确定下一步该怎么办。任何帮助都很好。

查看CVS存储库中的
tos/types/AM.h
,它似乎被以下代码阻塞了:

154: enum {
155:    MSG_DATA_SIZE = offsetof(struct TOS_Msg, crc) + sizeof(uint16_t), // 36 by default
156:    TINYSEC_MSG_DATA_SIZE = offsetof(struct TinySec_Msg, mac) + TINYSEC_MAC_LENGTH, // 41 by default
157:    DATA_LENGTH = TOSH_DATA_LENGTH,
158:    LENGTH_BYTE_NUMBER = offsetof(struct TOS_Msg, length) + 1,
159:    TINYSEC_NODE_ID_SIZE = sizeof(uint16_t)
160: };
第155、156和158行中的公共项是
offsetof()
宏,它应该在
stddef.h
中定义,并且看起来应该是由
tos.h
在它导致
AM.h
被包含之前引入的,因此应该已经定义了
offsetof()

您可能需要验证正在使用的编译器是否已正确定义了offsetof(),以及/或者为什么它不能在
AM.h
中使用。如有必要,您可能可以使用一种或多或少常用的实现来定义它:

#define offsetof(st, m) ((size_t) ( (char *)&((st *)(0))->m - (char *)0 ))  // stolen from Wikipedia

我们将尝试升级编译器,看看这是否能解决问题
#define offsetof(st, m) ((size_t) ( (char *)&((st *)(0))->m - (char *)0 ))  // stolen from Wikipedia