qvector.h(74):错误 C2182:“t":非法使用类型“void" [英] qvector.h(74) : error C2182: 't' : illegal use of type 'void'

查看:100
本文介绍了qvector.h(74):错误 C2182:“t":非法使用类型“void"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从 Qt 的网站下载了 5.2.1 版本,它说可以与 mscv2012_64_opengl 一起使用.

I downloaded from Qt's website the version 5.2.1 which says is good to use with mscv2012_64_opengl.

它运行良好,直到我决定使用公共语言运行时支持 /clr 选项.我这样做是因为我使用了一个 .dll,它充当 C++ 和我在 C# 中的一些代码之间的包装器.

It was working fine until I decided to use the Common Language Runtime Support /clr option. I did that because I am using a .dll that acts as a wrapper between C++ and some code I have in C#.

当我构建项目时,我收到以下错误

When I build the project I get the following errors

C:\Qt\Qt5.2.1\5.2.1\msvc2012_64_opengl\include\QtCore/qvector.h(74): error C2182: 't' : illegal use of type 'void'
1>          c:\qt\qt5.2.1\5.2.1\msvc2012_64_opengl\include\qtcore\qmap.h(119) : see reference to class template instantiation 'QVector<T>' being compiled
1>          with
1>          [
1>              T=void
1>          ]
1>          C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\xmemory0(903) : see reference to function template instantiation 'void std::allocator_traits<_Alloc>::construct<_Ty,_Ty>(std::allocator<_Ty> &,_Objty *,_V0_t &&)' being compiled
1>          with
1>          [
1>              _Alloc=std::allocator<DataColumn_3D>,
1>              _Ty=DataColumn_3D,
1>              _Objty=DataColumn_3D,
1>              _V0_t=DataColumn_3D
1>          ]
1>          C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\xmemory0(903) : see reference to function template instantiation 'void std::allocator_traits<_Alloc>::construct<_Ty,_Ty>(std::allocator<_Ty> &,_Objty *,_V0_t &&)' being compiled
1>          with
1>          [
1>              _Alloc=std::allocator<DataColumn_3D>,
1>              _Ty=DataColumn_3D,
1>              _Objty=DataColumn_3D,
1>              _V0_t=DataColumn_3D
1>          ]
1>          C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\xmemory(433) : see reference to function template instantiation 'void std::_Wrap_alloc<_Alloc>::construct<DataColumn_3D,_Valty>(_Ty *,_V0_t &&)' being compiled
1>          with
1>          [
1>              _Alloc=std::allocator<DataColumn_3D>,
1>              _Valty=DataColumn_3D,
1>              _Ty=DataColumn_3D,
1>              _V0_t=DataColumn_3D
1>          ]
1>          C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\xmemory(433) : see reference to function template instantiation 'void std::_Wrap_alloc<_Alloc>::construct<DataColumn_3D,_Valty>(_Ty *,_V0_t &&)' being compiled
1>          with
1>          [
1>              _Alloc=std::allocator<DataColumn_3D>,
1>              _Valty=DataColumn_3D,
1>              _Ty=DataColumn_3D,
1>              _V0_t=DataColumn_3D
1>          ]
1>          C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\xmemory(473) : see reference to function template instantiation '_FwdIt std::_Uninit_move<_InIt,_FwdIt,std::allocator<_Ty>,DataColumn_3D>(_InIt,_InIt,_FwdIt,std::_Wrap_alloc<_Alloc> &,_Valty *,std::_Nonscalar_ptr_iterator_tag)' being compiled
1>          with
1>          [
1>              _FwdIt=DataColumn_3D *,
1>              _InIt=DataColumn_3D *,
1>              _Ty=DataColumn_3D,
1>              _Alloc=std::allocator<DataColumn_3D>,
1>              _Valty=DataColumn_3D
1>          ]
1>          C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\vector(1561) : see reference to function template instantiation '_FwdIt std::_Uninitialized_move<_Iter,DataColumn_3D*,std::_Wrap_alloc<_Alloc>>(_InIt,_InIt,_FwdIt,std::_Wrap_alloc<_Alloc> &)' being compiled
1>          with
1>          [
1>              _FwdIt=DataColumn_3D *,
1>              _Iter=DataColumn_3D *,
1>              _Alloc=std::allocator<DataColumn_3D>,
1>              _InIt=DataColumn_3D *
1>          ]
1>          C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\vector(1504) : see reference to function template instantiation 'DataColumn_3D *std::vector<_Ty>::_Umove<DataColumn_3D*>(_Iter,_Iter,DataColumn_3D *)' being compiled
1>          with
1>          [
1>              _Ty=DataColumn_3D,
1>              _Iter=DataColumn_3D *
1>          ]
1>          C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\vector(1504) : see reference to function template instantiation 'DataColumn_3D *std::vector<_Ty>::_Umove<DataColumn_3D*>(_Iter,_Iter,DataColumn_3D *)' being compiled
1>          with
1>          [
1>              _Ty=DataColumn_3D,
1>              _Iter=DataColumn_3D *
1>          ]
1>          C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\vector(1500) : while compiling class template member function 'void std::vector<_Ty>::_Reallocate(unsigned __int64)'
1>          with
1>          [
1>              _Ty=DataColumn_3D
1>          ]
1>          C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\vector(961) : see reference to function template instantiation 'void std::vector<_Ty>::_Reallocate(unsigned __int64)' being compiled
1>          with
1>          [
1>              _Ty=DataColumn_3D
1>          ]
1>          DataSource.cpp(256) : see reference to class template instantiation 'std::vector<_Ty>' being compiled
1>          with
1>          [
1>              _Ty=DataColumn_3D
1>          ]
1>C:\Qt\Qt5.2.1\5.2.1\msvc2012_64_opengl\include\QtCore/qvector.h(133): error C2182: 'at' : illegal use of type 'void'
1>C:\Qt\Qt5.2.1\5.2.1\msvc2012_64_opengl\include\QtCore/qvector.h(134): error C2182: '[]' : illegal use of type 'void'
1>C:\Qt\Qt5.2.1\5.2.1\msvc2012_64_opengl\include\QtCore/qvector.h(135): error C2182: '[]' : illegal use of type 'void'
1>C:\Qt\Qt5.2.1\5.2.1\msvc2012_64_opengl\include\QtCore/qvector.h(136): error C2182: 't' : illegal use of type 'void'
1>C:\Qt\Qt5.2.1\5.2.1\msvc2012_64_opengl\include\QtCore/qvector.h(137): error C2182: 't' : illegal use of type 'void'
1>C:\Qt\Qt5.2.1\5.2.1\msvc2012_64_opengl\include\QtCore/qvector.h(138): error C2182: 't' : illegal use of type 'void'
1>C:\Qt\Qt5.2.1\5.2.1\msvc2012_64_opengl\include\QtCore/qvector.h(139): error C2182: 't' : illegal use of type 'void'
1>C:\Qt\Qt5.2.1\5.2.1\msvc2012_64_opengl\include\QtCore/qvector.h(140): error C2182: 't' : illegal use of type 'void'
1>C:\Qt\Qt5.2.1\5.2.1\msvc2012_64_opengl\include\QtCore/qvector.h(148): error C2182: 't' : illegal use of type 'void'
1>C:\Qt\Qt5.2.1\5.2.1\msvc2012_64_opengl\include\QtCore/qvector.h(150): error C2182: 't' : illegal use of type 'void'
1>C:\Qt\Qt5.2.1\5.2.1\msvc2012_64_opengl\include\QtCore/qvector.h(151): error C2182: 't' : illegal use of type 'void'
1>C:\Qt\Qt5.2.1\5.2.1\msvc2012_64_opengl\include\QtCore/qvector.h(152): error C2182: 't' : illegal use of type 'void'
1>C:\Qt\Qt5.2.1\5.2.1\msvc2012_64_opengl\include\QtCore/qvector.h(153): error C2182: 't' : illegal use of type 'void'
1>C:\Qt\Qt5.2.1\5.2.1\msvc2012_64_opengl\include\QtCore/qvector.h(182): error C2182: 'x' : illegal use of type 'void'
1>C:\Qt\Qt5.2.1\5.2.1\msvc2012_64_opengl\include\QtCore/qvector.h(183): error C2182: 'x' : illegal use of type 'void'
1>C:\Qt\Qt5.2.1\5.2.1\msvc2012_64_opengl\include\QtCore/qvector.h(189): error C2182: 'first' : illegal use of type 'void'
1>C:\Qt\Qt5.2.1\5.2.1\msvc2012_64_opengl\include\QtCore/qvector.h(190): error C2182: 'first' : illegal use of type 'void'
1>C:\Qt\Qt5.2.1\5.2.1\msvc2012_64_opengl\include\QtCore/qvector.h(191): error C2182: 'last' : illegal use of type 'void'
1>C:\Qt\Qt5.2.1\5.2.1\msvc2012_64_opengl\include\QtCore/qvector.h(192): error C2182: 'last' : illegal use of type 'void'
1>C:\Qt\Qt5.2.1\5.2.1\msvc2012_64_opengl\include\QtCore/qvector.h(193): error C2182: 't' : illegal use of type 'void'
1>C:\Qt\Qt5.2.1\5.2.1\msvc2012_64_opengl\include\QtCore/qvector.h(194): error C2182: 't' : illegal use of type 'void'
1>C:\Qt\Qt5.2.1\5.2.1\msvc2012_64_opengl\include\QtCore/qvector.h(198): error C2182: 'defaultValue' : illegal use of type 'void'
1>C:\Qt\Qt5.2.1\5.2.1\msvc2012_64_opengl\include\QtCore/qvector.h(204): error C2182: 'reference' : illegal use of type 'void'
1>C:\Qt\Qt5.2.1\5.2.1\msvc2012_64_opengl\include\QtCore/qvector.h(205): error C2182: 'const_reference' : illegal use of type 'void'
1>C:\Qt\Qt5.2.1\5.2.1\msvc2012_64_opengl\include\QtCore/qvector.h(210): error C2182: 't' : illegal use of type 'void'
1>C:\Qt\Qt5.2.1\5.2.1\msvc2012_64_opengl\include\QtCore/qvector.h(211): error C2182: 't' : illegal use of type 'void'
1>C:\Qt\Qt5.2.1\5.2.1\msvc2012_64_opengl\include\QtCore/qvector.h(216): error C2182: 'front' : illegal use of type 'void'
1>C:\Qt\Qt5.2.1\5.2.1\msvc2012_64_opengl\include\QtCore/qvector.h(225): error C2182: 't' : illegal use of type 'void'
1>C:\Qt\Qt5.2.1\5.2.1\msvc2012_64_opengl\include\QtCore/qvector.h(227): error C2182: 't' : illegal use of type 'void'

这里有人知道如何解决这个问题吗?

Does anyone here has an idea on how to fix this?

推荐答案

尝试以下操作,将 替换为您的模块.

Try the following, replace <QtXXX> with your Module.

#pragma unmanaged
#include <QtXXX>
#pragma managed

这篇关于qvector.h(74):错误 C2182:“t":非法使用类型“void"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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