Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

vs2013 compile for debug but not for release?

Tags:

visual-c++

qt

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

This is the newest version of vs 2013 express version. I just got it yesterday. Is this a vs2013's bug? Any solutions? EDIT: All the errors are C2440: cannot convert from xxx to xxx

EDIT2: 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?

like image 316
Nyaruko Avatar asked Jan 10 '23 11:01

Nyaruko


1 Answers

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
like image 141
niculare Avatar answered Jan 18 '23 16:01

niculare