错误 C2011:“MSXML2::IXMLDOMImplementation":“struct"类型重新定义 [英] Error C2011: 'MSXML2::IXMLDOMImplementation' : 'struct' type redefinition

查看:21
本文介绍了错误 C2011:“MSXML2::IXMLDOMImplementation":“struct"类型重新定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在更改我的 C++ 项目,该项目位于 VC6 早期,现在正在迁移到 VS 2008,以使用 MSXML 6 而不是早期的 MSXML 3.当代码在 VC6 中时,我们通过导入使用 MSXML3

I am changing my C++ project, which was earlier in VC6 and now being migrated to VS 2008, to use MSXML 6 instead of the earlier MSXML 3. When the code was in VC6 we were using MSXML3 by importing it

# import "msxml3.dll"

这里被替换为

# import "msxml6.dll"

在此之后,当我编译项目时,我得到了这个和其他几个类似的错误错误 C2011:MSXML2::IXMLDOMImplementation":结构"类型重新定义

After this when I compile the project I get this and several other similar errors Error C2011: 'MSXML2::IXMLDOMImplementation' : 'struct' type redefinition

上述错误在 msxml3.tlh 文件中.

The above error is in the msxml3.tlh file.

1) 为什么 msxml3 仍在使用?

1) Why is msxml3 still being used?

2) 我将问题缩小到 MSXML.h,它以某种方式自动包含在我的项目中.为什么是这样?

2) I narrowed down the problem to MSXML.h which is somehow automatically being included in my project. Why is this?

3) MSXML.h 中引用了哪个版本的 MSXML?

3) Which version of MSXML is being referenced in MSXML.h?

4) 为什么VC++会自动包含这么多头文件?如果我不想包含一些头文件怎么办?

4) Why in the world does VC++ automatically include so many header files? What if I dont want some header files to be included?

5) 在 C++ 项目中使用 MSXML6 的正确方法是什么?#import,头文件??????

5) What is the right way of using MSXML6 in a c++ project? #import, header file?????

6) 我该如何解决这个问题?

随时给我 .net.干净多了.VC++ 项目一团糟.

Give me .net any time. Much cleaner. A VC++ project is a mess.

推荐答案

查看 MSXML 上的 MS 文档.

他们建议像您一样导入 .dll 将创建几个 .thl 和 .tli 文件.确保您已删除这些内容.

They suggest that importing the .dll as you have will create a couple of .thl and .tli files. Make sure you've deleted those.

确保所有包含目录都指向正确的位置.

Make sure any include directories point to the right place.

确保您没有在项目的其他地方导入 msxml3.

Make absolutely certain that you're not importing msxml3 somewhere else in your project.

要找到 msxml.h,请按 CTRL + SHIFT + F 并搜索msxml"的整个解决方案 <- 请注意缺少 .h,因为如果您正确导入了它,则应该按以下方式进行如下:

To find the msxml.h do CTRL + SHIFT + F and search you entire solution for 'msxml' <- note the lack of the .h because if you'd been importing it properly, it ought to be done as follows:

#include <msxml6.dll>

尝试一些...

这篇关于错误 C2011:“MSXML2::IXMLDOMImplementation":“struct"类型重新定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆