ftpclient.h与windef.h冲突声明 [英] ftpclient.h conflicting declaration with windef.h
本文介绍了ftpclient.h与windef.h冲突声明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好,
我从这个网站下载了这个宏伟的类,但是当我要编译项目时,我收到一个编译错误说:
Hello,
I downloaded this magnificent class from this web, but when I'm going to compile the project I get a compilation error saying:
Definements.h:42:25: error: conflicting declaration ‘typedef unsigned int DWORD'
windef.h:117:27: error: ‘DWORD’ has a previous declaration as ‘typedef long unsigned int DWORD’
Definements.h:45:25: error: conflicting declaration ‘typedef unsigned int ULONG’
windef.h:25:27: error: ‘ULONG’ has a previous declaration as ‘typedef long unsigned int ULONG’
这些是我的包含:
These are my includes:
#include <string>
#include <windows.h>
#include <FtpClient.h>
#include <sstream>
#include <fstream>
#include <iostream>
#include <stdio.h>
#include <cstdlib>
我不知道我能做些什么。欢迎任何解决方案。
非常感谢!
I'm not sure what can I do. Any solution is welcome.
Thank you very much!
推荐答案
编辑.h
发生重复错误的文件。
用包装重复的声明#ifndef
和#endif
。
示例
Edit the.h
file where the duplicate error occurs.
Wrap the duplicate declaration(s) with#ifndef
and#endif
.
Example
#ifndef
typedef unsigned int DWORD
#endif
根据此表数据类型范围 [ ^ ],这两个定义是兼容的,因此您可以安全地遵循 Mike Meinz 的建议并保留其中一个。
According to this table Data Type Ranges[^], the two definitions are compatible, hence you may safely follow Mike Meinz's advice and keep just one of them.
>
这篇关于ftpclient.h与windef.h冲突声明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文