编译错误:multiple types in one declaration
#ifndef __DOWNLISTEN_H__
#define __DOWNLISTEN_H__
#include "CAgent.h"
#include "EpollEvent.h"
#include "IPAddress.h"
//#include "TCPSocket.h"
#include "UDPSocket.h" //2011.10.31
#include <list>
#include <time.h>
#include <sys/types.h>
#include "sysparameter.h"
#include "Timer.h"
#include "hash.h"
class DownAgent; //此处调试报错,multiple types in one declaration
struct down_job{
string ip;
//u_int16_t num;
int num;
time_t createtime;
DownAgent* downAgent;
};
我试着用以下方式没有为解决该问题,在线坐等大虾指导
在网上查了些资料,资料有个如下代码
01.#ifndef _TOIW_BBSDBSVR_H_
02.#define _TOIW_BBSDBSVR_H_
03.
04.typedef char DWORD[4];
05.typedef char WORD[2];
06.typedef char BYTE;//此处报错Multiple types in one declaration
, 报错可能性有两种可能性.
1. typedef语句后面没有加分号
2. 重复define BYTE
看头文件,排除1的可能性,针对2,有两种方法解决.
1. 在头文件中typedef语句前后加上ifdef开关
2. 在调用处加上undef BYTE
#define __DOWNLISTEN_H__
#include "CAgent.h"
#include "EpollEvent.h"
#include "IPAddress.h"
//#include "TCPSocket.h"
#include "UDPSocket.h" //2011.10.31
#include <list>
#include <time.h>
#include <sys/types.h>
#include "sysparameter.h"
#include "Timer.h"
#include "hash.h"
class DownAgent; //此处调试报错,multiple types in one declaration
struct down_job{
string ip;
//u_int16_t num;
int num;
time_t createtime;
DownAgent* downAgent;
};
我试着用以下方式没有为解决该问题,在线坐等大虾指导
在网上查了些资料,资料有个如下代码
01.#ifndef _TOIW_BBSDBSVR_H_
02.#define _TOIW_BBSDBSVR_H_
03.
04.typedef char DWORD[4];
05.typedef char WORD[2];
06.typedef char BYTE;//此处报错Multiple types in one declaration
, 报错可能性有两种可能性.
1. typedef语句后面没有加分号
2. 重复define BYTE
看头文件,排除1的可能性,针对2,有两种方法解决.
1. 在头文件中typedef语句前后加上ifdef开关
2. 在调用处加上undef BYTE
...全文
相关推荐
汇编错误编号解释.txt
Operand must be in same segment or one constant- **含义**:操作数必须在同一段内或一个为常量。
MASM报错速查表(很好很强大)
Operand must be in same segment or one constant- **描述**:指令要求两个操作数位于同一段或至少有一个是常量。
c语言编译常见错误列表
然而,在编写C语言程序的过程中,开发者常常会遇到各种各样的编译错误,这些错误往往会影响程序的正常运行甚至导致程序无法编译通过。以下是对给定文件中提到的一些常见编译错误的详细解释:#### 1.
C语言中编译相关的常见错误
**缺失主函数错误**: 错误信息:“undefined reference to `main'”表明编译器在寻找程序的入口点`main`函数时未能找到。在C语言中,`main`函数是程序执行的起点。
keil MDK编译器警告和错误详解
Warning: #1295-D: Deprecated declaration lcd_init - give arg types描述:在定义函数的时候,如果你写上函数参数,就会有这个警告,比如`void


