2015-10-14 140 views
0

我想在Microsoft Visual Studio 2015中使用Qt 5.5。但是,使用Qt的Microsoft编译器的最后一个兼容版本是MSVC2013。因此,我想告诉Visual 2015使用旧版本的Microsoft编译器来编译“传统”模式。在Visual Studio 2015下使用Microsoft Visual C++ 2013编译

如何做到这一点?

当我使用MSVC2015我得到这个错误:

Gravité Code Description Projet Fichier Ligne 
Erreur LNK2019 symbole externe non résolu "__declspec(dllimport) char const 

* __cdecl std::_Winerror_map(int)" ([email protected]@@[email protected]) 

référencé dans la fonction "public: virtual class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall std::_System_error_category::message(int)const " ([email protected][email protected]@@[email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@Z) helloworld C:\Users\roman\Documents\QtTest\bin\qtmaind.lib(qtmain_win.obj) 1 

我想这是因为Qt的库被编译为MSVC2013

+0

您是否尝试更改“项目属性” - >“常规” - >“平台工具集”? – stijn

+0

@stijn我只在这个下拉列表中有Visual Studio 2015 ... –

回答

0

您正在尝试使用为VS 2013构建的Qt以及使用VS 2015构建的代码。这绝不会起作用 - 它甚至不是用于Qt的问题,但是C++ ABI在VS版本之间变化。

所有C++代码都必须使用相同的Visual Studio版本进行编译。

0

编译器有没有“传统模式”功能,这样(的一小撮之外次要开关,这样的支持等)。

如果安装了VS2013,则可以使用VS2015 IDE并更改项目的工具集(在项目设置下)。

如果一切都失败了,你也可以用VS2015重新编译QT。


注意:您看到的错误是因为有在C++运行时ABI breaking changes(什么出口,而不是等)。新的运行时DLL(s)不再导出一些异常机制。用相应的工具链重新编译目标将处理这个问题。

+0

嗨,ho重新编译VS2015的Qt?它不会出现在安装程序和维护工具上 –

+0

您可以下载源代码并按照其指导进行操作。这里还有其他的在线教程。 – Niall