【Linux】【Debug】编译错误error: two or more data types in declaration specifiers
2016-01-26 13:55
656 查看
在项目开发时,遇到编译出错,看提示是重复的定义,错误信息如下:
In file included from ./include/wrn/wm/common/wm.h:176,
from ./include/wrn/wm/http/httpLib.h:55,
from ./include/wrn/wm/common/wmAuth.h:17,
from src/common/wmAuth.c:49:
./include/wrn/wm/common/wmData.h:241: error: two or more data types in declaration specifiers
./include/wrn/wm/common/wmData.h:241: warning: useless type name in empty declaration
./include/wrn/wm/common/wmData.h:242: error: two or more data types in declaration specifiers
./include/wrn/wm/common/wmData.h:242: warning: useless type name in empty declaration
src/common/wmAuth.c: In function 'wm_string_getCode':
src/common/wmAuth.c:816: warning: comparison between pointer and integer
src/common/wmAuth.c: In function 'wmAuthSetNewCookie':
src/common/wmAuth.c:2323: warning: passing argument 2 of 'wmAUTHGetClientCookie' from incompatible pointer type
src/common/wmAuth.c:2324: warning: passing argument 3 of 'httpMimeOutCookieSet' from incompatible pointer type
make[1]: *** [src/common/wmAuth.o] Error 1
make: *** [webserver_build] Error 2
网上查看过,说是加分号,和其他头文件存在相同的定义,但是查找过,本地文件目录和交叉编译工具链中的头文件,都没有发现相同的定义:
./include/wm_options.h:typedef int sbyte4;
./include/wrn/wm/backplane/wmbLib.h:typedef int WMB_RID_T;
./include/wrn/wm/backplane/wmbLib.h:typedef int WMB_DOMAIN_T;
./include/wrn/wm/backplane/wmb.h:typedef int WMB_HASH_HINT_T;
./include/wrn/wm/backplane/wmb.h:typedef int WMB_ROLES_T;
./include/wrn/wm/backplane/wmb.h:typedef int WMB_RESOURCE_ID_T;
./include/wrn/wm/backplane/wmb.h:typedef int WMB_ARCHIVE_TYPE_T;
./include/wrn/wm/backplane/wmb.h:typedef int WMB_CMD_T;
./include/wrn/wm/common/wmnet.h:typedef int OS_SOCKET_T;
./include/wrn/wm/common/wmnet.h:typedef int OS_SOCKET_T;
./include/wrn/wm/common/wmnet.h:typedef int OS_SOCKET_T;
./include/wrn/wm/common/wmnet.h:typedef int OS_SOCKET_T;
./include/wrn/wm/common/wmnet.h:typedef int OS_SOCKET_T;
./include/wrn/wm/common/wm.h:typedef int sbyte4;
./include/wrn/wm/common/wmos.h:typedef int OS_THREAD_T;
./include/wrn/wm/common/wmos.h:typedef int OS_SEM_T;
./include/wrn/wm/common/wmos.h:typedef int OS_MSGQ_T;
./include/wrn/wm/common/wmos.h:typedef int OS_PIPE_T;
./include/wrn/wm/common/wmos.h:typedef int OS_TIME_T;
./include/wrn/wm/common/wmos.h:typedef int SHARED_DATA_T;
./include/wrn/wm/common/wmos.h:typedef int OS_SEM_T;
./include/wrn/wm/common/wmos.h:typedef int OS_MSGQ_T;
./include/wrn/wm/common/wmos.h:typedef int OS_PIPE_T;
./include/wrn/wm/common/wmos.h:type
4000
def int SHARED_DATA_T;
./include/wrn/wm/common/wmos.h:typedef int OS_SEM_T;
./include/wrn/wm/common/wmos.h:typedef int OS_MSGQ_T;
./include/wrn/wm/common/wmos.h:typedef int OS_PIPE_T;
./include/wrn/wm/common/wmos.h:typedef int SHARED_DATA_T;
./include/wrn/wm/common/wmos.h:typedef int OS_MSGQ_T;
./include/wrn/wm/common/wmos.h:typedef int OS_PIPE_T;
./include/wrn/wm/common/wmos.h:typedef int SHARED_DATA_T;
./include/wrn/wm/common/wmos.h:typedef int OS_ARG_T;
./include/wrn/wm/common/wmos.h:typedef int OS_THREAD_T;
./include/wrn/wm/common/wmos.h:typedef int OS_PIPE_T;
./include/wrn/wm/common/wmos.h:typedef int OS_ARG_T;
./include/wrn/wm/common/wmos.h:typedef int SHARED_DATA_T;
./include/wrn/wm/common/wmos.h: typedef int OS_MSGQ_T;
./include/wrn/wm/common/wmos.h:typedef int SD_ID;
./include/wrn/wm/common/wmData.h:typedef int CompareType;
./include/wrn/wm/common/wmData.h:typedef int STATUS;
./include/wrn/wm/common/wmData.h:typedef int BOOL;
./include/wrn/wm/common/zlib/vxWorks/zconf.h:typedef int FAR intf;
查看提示错误的地方,是一个类型的定义:
typedef int STATUS;;
typedef int BOOL;;
修改成:
#ifndef STATUS
#define STATUS int
#endif
#ifndef BOOL
#define BOOL int
#endif
In file included from ./include/wrn/wm/common/wm.h:176,
from ./include/wrn/wm/http/httpLib.h:55,
from ./include/wrn/wm/common/wmAuth.h:17,
from src/common/wmAuth.c:49:
./include/wrn/wm/common/wmData.h:241: error: two or more data types in declaration specifiers
./include/wrn/wm/common/wmData.h:241: warning: useless type name in empty declaration
./include/wrn/wm/common/wmData.h:242: error: two or more data types in declaration specifiers
./include/wrn/wm/common/wmData.h:242: warning: useless type name in empty declaration
src/common/wmAuth.c: In function 'wm_string_getCode':
src/common/wmAuth.c:816: warning: comparison between pointer and integer
src/common/wmAuth.c: In function 'wmAuthSetNewCookie':
src/common/wmAuth.c:2323: warning: passing argument 2 of 'wmAUTHGetClientCookie' from incompatible pointer type
src/common/wmAuth.c:2324: warning: passing argument 3 of 'httpMimeOutCookieSet' from incompatible pointer type
make[1]: *** [src/common/wmAuth.o] Error 1
make: *** [webserver_build] Error 2
网上查看过,说是加分号,和其他头文件存在相同的定义,但是查找过,本地文件目录和交叉编译工具链中的头文件,都没有发现相同的定义:
./include/wm_options.h:typedef int sbyte4;
./include/wrn/wm/backplane/wmbLib.h:typedef int WMB_RID_T;
./include/wrn/wm/backplane/wmbLib.h:typedef int WMB_DOMAIN_T;
./include/wrn/wm/backplane/wmb.h:typedef int WMB_HASH_HINT_T;
./include/wrn/wm/backplane/wmb.h:typedef int WMB_ROLES_T;
./include/wrn/wm/backplane/wmb.h:typedef int WMB_RESOURCE_ID_T;
./include/wrn/wm/backplane/wmb.h:typedef int WMB_ARCHIVE_TYPE_T;
./include/wrn/wm/backplane/wmb.h:typedef int WMB_CMD_T;
./include/wrn/wm/common/wmnet.h:typedef int OS_SOCKET_T;
./include/wrn/wm/common/wmnet.h:typedef int OS_SOCKET_T;
./include/wrn/wm/common/wmnet.h:typedef int OS_SOCKET_T;
./include/wrn/wm/common/wmnet.h:typedef int OS_SOCKET_T;
./include/wrn/wm/common/wmnet.h:typedef int OS_SOCKET_T;
./include/wrn/wm/common/wm.h:typedef int sbyte4;
./include/wrn/wm/common/wmos.h:typedef int OS_THREAD_T;
./include/wrn/wm/common/wmos.h:typedef int OS_SEM_T;
./include/wrn/wm/common/wmos.h:typedef int OS_MSGQ_T;
./include/wrn/wm/common/wmos.h:typedef int OS_PIPE_T;
./include/wrn/wm/common/wmos.h:typedef int OS_TIME_T;
./include/wrn/wm/common/wmos.h:typedef int SHARED_DATA_T;
./include/wrn/wm/common/wmos.h:typedef int OS_SEM_T;
./include/wrn/wm/common/wmos.h:typedef int OS_MSGQ_T;
./include/wrn/wm/common/wmos.h:typedef int OS_PIPE_T;
./include/wrn/wm/common/wmos.h:type
4000
def int SHARED_DATA_T;
./include/wrn/wm/common/wmos.h:typedef int OS_SEM_T;
./include/wrn/wm/common/wmos.h:typedef int OS_MSGQ_T;
./include/wrn/wm/common/wmos.h:typedef int OS_PIPE_T;
./include/wrn/wm/common/wmos.h:typedef int SHARED_DATA_T;
./include/wrn/wm/common/wmos.h:typedef int OS_MSGQ_T;
./include/wrn/wm/common/wmos.h:typedef int OS_PIPE_T;
./include/wrn/wm/common/wmos.h:typedef int SHARED_DATA_T;
./include/wrn/wm/common/wmos.h:typedef int OS_ARG_T;
./include/wrn/wm/common/wmos.h:typedef int OS_THREAD_T;
./include/wrn/wm/common/wmos.h:typedef int OS_PIPE_T;
./include/wrn/wm/common/wmos.h:typedef int OS_ARG_T;
./include/wrn/wm/common/wmos.h:typedef int SHARED_DATA_T;
./include/wrn/wm/common/wmos.h: typedef int OS_MSGQ_T;
./include/wrn/wm/common/wmos.h:typedef int SD_ID;
./include/wrn/wm/common/wmData.h:typedef int CompareType;
./include/wrn/wm/common/wmData.h:typedef int STATUS;
./include/wrn/wm/common/wmData.h:typedef int BOOL;
./include/wrn/wm/common/zlib/vxWorks/zconf.h:typedef int FAR intf;
查看提示错误的地方,是一个类型的定义:
typedef int STATUS;;
typedef int BOOL;;
修改成:
#ifndef STATUS
#define STATUS int
#endif
#ifndef BOOL
#define BOOL int
#endif
相关文章推荐
- grep 命令系列:如何在 Linux/UNIX 中使用 grep 命令
- linux c setitimer使用方法说明
- linux下文件操作API:write/read/fcntl/ioctl/mmap
- Linux下高cpu解决方案(转载)
- Linux上源码安装php7
- linux(2)文件和目录管理(新增,删除,复制,移动,文件和目录权限,文件查找)
- Linux内核的加密函数框架
- centos6.6,kvm安装配置详解,让你秒会kvm
- Linux下的cryptoloop的使用方法和算法分析
- Linux终端ctrl+z和ctrl+c的区别
- Linux---cacti安装后不出图
- Linux搭建svn服务器
- linux 多路径配置
- Linux实操题
- Linux — 字符处理
- linux回环网卡驱动设计
- Linux 服务器之重装系统
- 使用光盘搭建本地yum仓库源
- linux php5.3.x升级到php5.5.x
- linux 问答