前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >检测到“_CRT_STDIO_ISO_WIDE_SPECIFIERS”的不匹配项

检测到“_CRT_STDIO_ISO_WIDE_SPECIFIERS”的不匹配项

作者头像
用户3519280
发布2023-07-08 14:40:51
2230
发布2023-07-08 14:40:51
举报
文章被收录于专栏:c++ 学习分享c++ 学习分享

libboost_thread-vc142-mt-x64-1_82.lib(thread.obj) : error LNK2038: 检测到“_CRT_STDIO_ISO_WIDE_SPECIFIERS”的不匹配项: 值“0”不匹配值“1”(AcadStr.obj 中) 1> 正在创建库 x64\Release\ArxDbg.lib 和对象 x64\Release\ArxDbg.exp : fatal error LNK1319: 检测到 1 个不匹配项 1>已完成生成项目“ArxDbg.vcxproj”的操作 - 失败。 ========== 全部重新生成: 成功 0 个,失败 1 个,跳过 0 个 ========== 天天都是这种问题 以Debug或Release方式运行,会出现很多问题,我们逐一解决。

c++宏定义_CRT_STDIO_ISO_WIDE_SPECIFIERS

代码语言:javascript
复制
第三方库宏定义冲突解决办法
假如项目用到的两个第三方库,lib_a和lib_b中,头文件a.h和b.h存在宏定义冲突的问题。

那么可以创建一个源文件c.cpp和c.h,将lib_a或lib_b的头文件封装在c.cpp中,在c.h中提供新的接口声明方便自己程序调用即可。

https://blog.csdn.net/RNAMatrix/article/details/5765462

c++预处理器宏定义不匹配 (1) 预处理命令问题,表现为:

LNK2038 检测到“_CRT_STDIO_ISO_WIDE_SPECIFIERS”的不匹配项: 值“1”不匹配值“0”(MainWindow.obj 中) Heart G:\008_Practice\005_PracticeCPP\20200713_MathGL-Qt-openCV\Heart\Heart\mgl-qt5-static.lib(mocs_compilation.obj) 1 解决:进入项目的属性页面,修改预处理命令(Debug和Release分别修改),如下图。

https://blog.csdn.net/JinKairu/article/details/107348999
https://blog.csdn.net/JinKairu/article/details/107348999
代码语言:javascript
复制
That's correct,  I'm surprised that setting _CRT_STDIO_ISO_WIDE_SPECIFIERS was there in RD2020 too.

I was wondering why didn't you encounter this earlier.   :thinking_face:

Anyway the reason for this whole rigmarole is Windows adopted Unicode prior than C standard

 

 

Format	Windows classic	C standard	 
%s	printf	char*	char*	⇐
%s	wprintf	wchar_t*	char*
%S	printf	wchar_t*	N/A
%S	wprintf	char*	N/A
%hs	printf	char*	char*	⇐
%hs	wprintf	char*	char*	⇐
%ls	printf	wchar_t*	wchar_t*	⇐
%ls	wprintf	wchar_t*	wchar_t*	⇐
%ws	printf	wchar_t*	N/A
%ws	wprintf	wchar_t*	N/A
 

<= :  These rows where the C standard agrees with the Windows classic format.

The Windows classic format came first, so the question is whether the C standard chose to align with the Windows classic format, rather than vice versa.

 
 

Defining _CRT_STDIO_ISO_WIDE_SPECIFIERS works as of Visual Studio 2019 and enables C99-conforming format specifiers.

As per my blog you stated, this was introduced in Visual Studio 2015 and was initially intended to be the new default, but that idea was subsequently abandoned.

 

Short answer : Don't use it.

arx里面的_CRT_STDIO_ISO_WIDE_SPECIFIERS继承自这个 rxsdk_common.props

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2023-06-05,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档