您的位置:首页 > 编程语言 > C语言/C++

VS2008下编译C++程序,解决找不到 stdint.h的问题方案

2013-02-27 23:10 537 查看
VS2008下编译C++程序,解决找不到 stdint.h的问题方案

在 VS2008 下编译c++程序,发现找不到 stdint.h, 最后证实原因如下红字,解决方案是改用符合C99标准的编译器(如VS2010),或自定义头文件:

#ifdef _MSC_VER

typedef __int32 int32_t;

typedef unsigned __int32 uint32_t;

typedef __int64 int64_t;

typedef unsigned __int64 uint64_t;

#else

#include <stdint.h>

#endif

Visual Studio 2003 - 2008 (Visual C++ 7.1 - 9) don't claim to be C99 compatible

另注:在VS2010下,stdint.h 的位置在 C:\Program Files\Microsoft Visual Studio 10.0\VC\include

参考:

1. http://www.cnblogs.com/verygis/archive/2012/04/22/2465561.html
2. https://svn.boost.org/trac/boost/ticket/4182
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐