解决VC2015包含stdint.h头文件冲突问题

stdint.h是C99的标准,主要用于统一跨平台数据定义。
MSVC中不带有这个头文件,直到VS2010。
在之前的版本里面,我们可以:
(1)下载这个头文件
download a MS version of this header from:
http://msinttypes.googlecode.com/svn/trunk/stdint.h
A portable one can be found here:
http://www.azillionmonkeys.com/qed/pstdint.h
(2)将头文件放到(以VS2015为例):
C:\Program Files\Microsoft Visual Studio 14.0\VC\include

出现“C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\stdint.h(17): error C2632: “char”后面的“char”非法”错误。stdint.h文件17行是typedef signed char        int8_t;
解决方法:
先查找工程中引用int8_t的地方,屏蔽掉这段代码,增加 #include <cstdint>
总的解决方法如下:
Features of C standard Library are also provided in the C++ Standard library and as a general naming convention they are pre-pended by an c to the corresponding names in C standard library.
In C++, You should be using:
#include <cstdint>
and fully qualify the symbol names you use with std::
while in C, You should use:
#include <stdint.h>
https://stackoverflow.com/questions/13642827/cstdint-vs-stdint-h
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

byxdaz

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值