vs2013 编译用于调试而不是用于发布? [英] vs2013 compile for debug but not for release?
问题描述
我在 VS2013 中遇到过奇怪的事情.我的程序在调试模式下构建良好.但是在发布模式下,有很多错误,比如:
I have met strange things in VS2013. My program builds well in debug mode. But in release mode, there are many errors like:
Error 2 error C2440: 'default argument' : cannot convert from 'const wchar_t [1]' to 'const BSTR' (src\GAudioOutput.cc) C:\Program Files (x86)\Windows Kits\8.1\Include\um\sapi.h 16917 1 qgroundcontrol
这是 vs 2013 express 版本的最新版本.我昨天刚拿到.这是vs2013的bug吗?任何解决方案?所有错误都是 C2440:无法从 xxx 转换为 xxx
This is the newest version of vs 2013 express version. I just got it yesterday. Is this a vs2013's bug? Any solutions? All the errors are C2440: cannot convert from xxx to xxx
我使用 VS2010 编译没有任何问题的相同代码.我发现所有错误都来自 windows_kit 8.1.有什么想法吗?
The same code I compiled without any problem using VS2010. And I found that all the errors are from the windows_kit 8.1. Any thoughts?
推荐答案
我在用 Qt5.4 和 msvc2013 构建项目时遇到了同样的编译错误.这是因为windows头文件违反了标准,将通过在.pro文件中添加以下行来修复:
I had the same compile error when building a project with Qt5.4 and msvc2013. It is because the windows headers violate the standard, and it will be fixed by adding the following line in the .pro file:
win32: QMAKE_CXXFLAGS_RELEASE -= -Zc:strictStrings
这篇关于vs2013 编译用于调试而不是用于发布?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!