Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'uint32_t' does not name a type

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?

like image 289
rmtheis Avatar asked Jun 17 '12 05:06

rmtheis


People also ask

What does uint32_t mean in C?

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.

What is the difference between uint32 and uint32_t?

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.

Where uint32_t is defined?

This type is defined in the C header <stdint.

What is the meaning of uint8_t?

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).


1 Answers

You need to include stdint.h

 #include <stdint.h> 
like image 181
selbie Avatar answered Oct 06 '22 17:10

selbie