错误 C2440:“默认参数":无法从“const wchar_t [1]"转换为“BSTR" [英] error C2440: 'default argument': cannot convert from 'const wchar_t [1]' to 'BSTR'
问题描述
我在使用此命令时遇到以下错误 qmake.exe project.pro -r -spec win32-msvc2015
I am getting below error while using this command qmake.exe project.pro -r -spec win32-msvc2015
C:\Program Files (x86)\Windows Kits\8.1\include\um\mshtml.h(50130): error C2440: 'default argument': cannot convert from 'const wchar_t [1]' to 'BSTR'
它与 qmake.exe project.pro -r -spec win32-msvc2013
意味着它用 win32-msvc2013 构建得很好,但不是 win32-msvc2015.我在项目文件中添加了以下行,之后我能够在 2013 年构建,但不能在 2015 年构建.
Means it built fine with win32-msvc2013 but not win32-msvc2015. I have added below line in the project file and after that it I was able to build in 2013 but Not in 2015.
win32: QMAKE_CXXFLAGS_RELEASE -= -Zc:strictStrings
有人知道 2015 年需要什么吗?
Any one have idea on this that what it needing for 2015?
推荐答案
这是因为某些 Windows 标头违反了 strictStrings 规则.您可以尝试进一步放松检查:
It's because some Windows headers violate strictStrings rules. You could try loosening checking even more:
win32: QMAKE_CXXFLAGS_RELEASE -= -Zc:strictStrings
win32: QMAKE_CFLAGS_RELEASE -= -Zc:strictStrings
win32: QMAKE_CFLAGS -= -Zc:strictStrings
win32: QMAKE_CXXFLAGS -= -Zc:strictStrings
这篇关于错误 C2440:“默认参数":无法从“const wchar_t [1]"转换为“BSTR"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!