简体   繁体   English

使用VC ++ 2013-Windows 10编译Qt5.9时,出现错误C2440:“默认参数”:无法从“ const wchar_t [1]”转换为“ BSTR”

[英]While compiling Qt5.9 with VC++2013 - Windows 10, getting error C2440: 'default argument': cannot convert from 'const wchar_t [1]' to 'BSTR'

I am building Qt5.9 with VC++2013, Windows 10. I am getting the error as below: 我正在使用VC ++ 2013,Windows 10构建Qt5.9。出现以下错误:

 C2440: 'default argument': cannot convert from 'const wchar_t [1]' to 'BSTR.

I have read this question error C2440: 'default argument': cannot convert from 'const wchar_t [1]' to 'BSTR' but seem not my problem because I am compiling Qt5.9, not qt app project. 我已阅读此问题错误C2440:'默认参数':无法从'const wchar_t [1]'转换为'BSTR',但似乎不是我的问题,因为我正在编译Qt5.9,而不是qt应用程序项目。

I found an article about this issue but it is about compiling Qt5.6 ( http://wangjie.rocks/2015/12/28/compile-qt/ ). 我找到了有关此问题的文章,但它与编译Qt5.6( http://wangjie.rocks/2015/12/28/compile-qt/ )有关。 This is a chinese site, I need to translate using chrome. 这是一个中文网站,我需要使用chrome进行翻译。 There is no file qtbase\\mkspecs\\common\\msvc-base.conf in Qt5.9 but I found a similar config file qtbase\\mkspecs\\common\\msvc-version.conf . qtbase\\mkspecs\\common\\msvc-base.conf中没有文件qtbase\\mkspecs\\common\\msvc-base.conf ,但我发现了类似的配置文件qtbase\\mkspecs\\common\\msvc-version.conf I did the same but it doesn't work. 我做了同样的事情,但是没有用。

I found solution. 我找到了解决方案。

It pops up error while compile qtsystems\\src\\systeminfo\\systeminfo.pro so I added bellow config to that systeminfo.pro . 它在编译qtsystems\\src\\systeminfo\\systeminfo.pro时弹出错误,因此我在该systeminfo.pro添加了以下配置。 It works. 有用。

win32: QMAKE_CXXFLAGS_RELEASE -= -Zc:strictStrings
win32: QMAKE_CFLAGS_RELEASE -= -Zc:strictStrings
win32: QMAKE_CFLAGS -= -Zc:strictStrings
win32: QMAKE_CXXFLAGS -= -Zc:strictStrings

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 错误C2440:“正在初始化”:无法从“ const wchar_t [9]”转换为“ LPCSTR” - error C2440: 'initializing' : cannot convert from 'const wchar_t [9]' to 'LPCSTR' C++ “默认参数”:无法从“const wchar_t”转换为“BSTR” - C++ 'default argument': cannot convert from 'const wchar_t' to 'BSTR' 错误C2440&#39;=&#39;:无法从&#39;cli :: array转换 <Type> ^&#39;至&#39;wchar_t&#39; - Error C2440 '=' : cannot convert from 'cli::array<Type> ^' to 'wchar_t' 错误C2440:'=':无法从'const char [2]'转换为'char' - error C2440: '=' : cannot convert from 'const char [2]' to 'char' 错误 C2440:“正在初始化”:无法从“const mynamespace::mytype*”转换为“const T*” - error C2440: 'initializing' : cannot convert from 'const mynamespace::mytype*' to 'const T*' 无法将参数1从&#39;const char *&#39;转换为&#39;const wchar_t *&#39; - cannot convert argument 1 from 'const char *' to 'const wchar_t *' 返回NULL但得到错误C2440:&#39;return&#39;:无法从&#39;int&#39;转换为&#39;const&&#39; - returning NULL but getting error C2440: 'return' : cannot convert from 'int' to 'const &' &#39;默认参数&#39;:无法从&#39;const char [1]&#39;转换为&#39;const wchar_t *&#39; - 'default argument' : cannot convert from 'const char [1]' to 'const wchar_t *' 错误:C2440“返回”:无法从“int”转换为 T - error: C2440 'return': cannot convert from 'int' to T 错误c2440&#39;=&#39;无法从int *转换为Type <T> * - Error c2440 '=' cannot convert from int * to Type<T> *
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM