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 happening in 64-bit Ubuntu using g++ 4.5.2. It compiles fine on 64-bit CentOS using g++ 4.1.2.
Is there an #include
or a compiler flag that I'm missing? Or, should I use typedef
to assign uint32_t
to a size_t
or maybe an unsigned int
?
uint32_t is a numeric type that guarantees 32 bits. The value is unsigned, meaning that the range of values goes from 0 to 232 - 1.
typedef unsigned integer type uint32_t; // optional //... } uint32 is not, it's a shortcut provided by some compilers (probably as typedef uint32_t uint32 ) for ease of use. More likely as a typedef for something that was known to be an unsigned 32 bit integer at a time before <cstdint> was standard.
This type is defined in the C header <stdint.
Unsigned Integers of 8 bits. A uint8 data type contains all whole numbers from 0 to 255. As with all unsigned numbers, the values must be non-negative. Uint8's are mostly used in graphics (colors are always non-negative).
You need to include stdint.h
#include <stdint.h>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With