我正在将代码从Linux移植到windows的Visual C++。
Visual C++不知道#include <stdint.h>
,所以我把它注释掉了。
后来,我发现了很多这样的'uint32_t': identifier not found
错误。如何解决呢?
发布于 2011-03-02 10:33:55
这种类型是在C头<stdint.h>
中定义的,它是C++11标准的一部分,但不是C++03的标准。根据the Wikipedia page on the header的说法,直到VS2010,它才与Visual Studio一起发布。
同时,您可能可以通过添加将Microsoft's custom integer types映射到C期望的类型的typedef
来伪造您自己的头文件版本。例如:
typedef __int32 int32_t;
typedef unsigned __int32 uint32_t;
/* ... etc. ... */
希望这能有所帮助!
发布于 2013-08-29 14:02:12
你可以使用#include <cstdint>
。自2011年起,它就成为了C++标准的一部分。
发布于 2015-08-31 21:59:15
我有相同的错误,它修复了它,并在文件中包含以下内容
#include <stdint.h>
在您的文件的开头。
https://stackoverflow.com/questions/5162784
复制相似问题