I\'m trying to compile a C++ software package that was written in 2007 and I\'m getting this error:
error: ‘uint32_t’ does not name a type
This is h
I had tha same problem trying to compile a lib I download from the internet. In my case, there was already a #include <cstdint>
in the code. I solved it adding a:
using std::uint32_t;
The other answers assume that your compiler is C++11 compliant. That is fine if it is. But what if you are using an older compiler?
I picked up the following hack somewhere on the net. It works well enough for me:
#if defined __UINT32_MAX__ or UINT32_MAX
#include <inttypes.h>
#else
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned long uint32_t;
typedef unsigned long long uint64_t;
#endif
It is not portable, of course. But it might work for your compiler.
Add the following in the base.mk file. The following 3rd line is important
-include $(TOP)/defs.mk
CFLAGS=$(DEBUG) -Wall -W -Wwrite-strings
CFLAGS_C=-Wmissing-prototypes
CFLAGS_CXX=-std=c++0x
LDFLAGS=
LIBS=
to avoid the #error This file requires compiler and library support for the upcoming ISO C++ standard, C++0x. This support is currently experimental, and must be enabled with the -std=c++0x or -std=gnu++0x compiler options