简体   繁体   English

C ++在Qt项目中包括Visual Studio头文件。 <xstring> 包含错误

[英]C++ Including Visual Studio header files in Qt project. <xstring> include error

I have found a library to generate barcodes ( libbarpp ). 我找到了一个生成条形码的库( libbarpp )。 I would like to use this library in my Qt project. 我想在我的Qt项目中使用此库。

Doing a svn checkout of the source: http://libbarpp.googlecode.com/svn/trunk/ reveals a nice VS example in the src folder. 对源代码进行svn检出: http : //libbarpp.googlecode.com/svn/trunk/揭示了src文件夹中的VS示例。 I opened the project in VS and found the included header files. 我在VS中打开了项目,并找到了包含的头文件。 I have included these header files in my Qt project, however i encountered a problem when several of the files required a system header file 我已经在Qt项目中包含了这些头文件,但是当几个文件需要系统头文件时遇到了问题

#include <xstring>

In VS i can see the this file is located in (on my system): 在VS中,我可以看到此文件位于(在我的系统上):

c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xstring 

However the files does not have any extension and i don't really know what to do with it. 但是文件没有任何扩展名,我真的不知道该怎么办。

Do i need to include something in my Qt project file in order to use this VS file? 我需要在Qt项目文件中包含一些内容才能使用此VS文件吗?

I tried including 我尝试包括

CONFIG += stl

to my Qt project file, but with no luck. 到我的Qt项目文件中,但是没有运气。

Any help or comments is greatly appreciated. 任何帮助或意见,我们将不胜感激。

EDIT : I'm using Qt 5.2.1 with MinGW compiler 编辑 :我正在使用Qt 5.2.1与MinGW编译器

xstring is a Microsoft specific header that contains implementation of std::basic_string and some related specializations. xstring是Microsoft特定的标头,包含std::basic_string和一些相关的专业化。

It shouldn't be included directly in the first place and unless the code you are talking about is using something implementation specific from that file you should be fine replacing it with just: 它不应该首先包含在其中,除非您所讨论的代码使用的是该文件中的特定实现,否则应将其替换为:

#include <string>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM