您的位置:程序门 -> linux/unix社区 -> 程序开发区



求助:hp移植时编译错误:array type has incomplete element type


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


求助:hp移植时编译错误:array type has incomplete element type
发表于:2007-08-27 11:25:39 楼主
我在移植代码到hp(ia64   b.11.23)时编译出错,
编译器用的是gcc4.1.0,错误提示为:
in   file   included   from   /usr/include/sys/mp.h:53,
                                  from   /usr/include/sys/malloc.h:59,
                                  from   /usr/include/net/netmp.h:51,
                                  from   /usr/include/net/if.h:59,
/usr/include/machine/sys/getppdp.h:65:   error:   array   type   has   incomplete   element   type

我在网络上查找答案,发现编译器gcc4.0.0版本以下(不包括gcc4.0.0)编译不会出现此错误,
但原因在于/usr/include/machine/sys/getppdp.h文件中声明外部数组变量时数组类型还没有定义:
                                          extern   union   mpinfou   spu_info[];
在这里union   mpinfou   还没有声明,
所以有错误提示:数组类型含有不完善的成员类型

请问:这种问题应该如何解决?
发表于:2007-08-27 21:48:271楼 得分:0
编译器给变量要分配空间,依据就是数据结构/类型,如果该数据结构在你平台上未定义,要么自己模拟一个,要么就放弃
自己模拟的东西,只能自己用
如同巧妇难为无米之炊,硬是不给米,还要做出饭来么?
发表于:2007-08-28 11:43:232楼 得分:0
union       mpinfou         定义一下不行吗?


快速检索

最新资讯
热门点击