我正在从Linux C到Windows的VisualC++中移植代码.
Visual C++不知道#include <stdint.h>
,所以我 comments 了它.
后来,我发现了这'uint32_t': identifier not found
个错误中的很多.怎么才能解决呢?
我正在从Linux C到Windows的VisualC++中移植代码.
Visual C++不知道#include <stdint.h>
,所以我 comments 了它.
后来,我发现了这'uint32_t': identifier not found
个错误中的很多.怎么才能解决呢?
这种类型在C头<stdint.h>
中定义,它是C++11标准的一部分,但不是C++03中的标准.根据the Wikipedia page on the header的说法,它直到VS2010才随Visual Studio发布.
同时,你也可以通过添加typedef
来伪造你自己版本的标题,将Microsoft's custom integer types映射到C所期望的类型.例如:
typedef __int32 int32_t;
typedef unsigned __int32 uint32_t;
/* ... etc. ... */
希望这能有所帮助!