编译错误:multiple types in one declaration

ro360 ro360 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
#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


...全文

相关推荐

汇编错误编号解释.txt

列举了一些常见的汇编错误编号解释,一共八十几种

JIAN_BOY_RISE

MASM报错速查表(很好很强大)

大家学习汇编语言时,恐怕最难受的就是不知道提示的错误是什么,所以我花了一点时间帮大家整理了一供大家下载。

yyz_2637

c语言编译常见错误列表

1."c" not an argument in function sum 该标识符不是函数的参数 2.array bounds missing ] in function main 缺少数组界限符 "]" 3.Array size too large in function main 数组规模太大 4.bad file name format in include directive 在包含指令中的文件名格式不正确. 5.Call of non-function in function main 调用未经过定义的函数. 6.cannot modify a const object in function main 对常量不能进行修改. 7.character constant too long in function main 字符常量太大 8.constant expression required in funtion main 数组定义的时候,数组大小要求是常数 9.compound statment missing } in function main 复合语句漏掉符号 "{" 10.declaration syntax error in function main 宣告语法错误 ……

lk123456sc

C语言中编译相关的常见错误

1、/usr/lib/gcc/i686-linux-gnu/4.6/../../../i386-linux-gnu/crt1.o: In function `_start':   (.text+0x18):undefined reference to `main'   collect2: ld 返回 1   Reason: no main function in source file   2、to get compile options -I and -l   pkg-config lib   e.g: pkg-config –cflags –libs dbus-1

weixin_38551205

keil MDK编译器警告和错误详解

在这里把平时遇到的编译器给出的警告和错误信息给出详解,希望给初学者一点帮助,发现错误,需要补充的欢迎留言.

weixin_38674223
评论 2
收藏 已收藏
分享
返回顶部
ro360
C++ 语言 65,214 成员 250,514 内容