Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"int32 undeclared" gcc error

Tags:

c

types

gcc

I'm trying to learn me some C, and have run into what is probably a simple problem. I'm trying to compile some code which contains the following declaration:

int32 count;

However, this results in an error at compile time:

test.c:21: error: ‘int32’ undeclared (first use in this function)

Is there a particular compile-time option I need to set for gcc, or an #include directive that will solve this?

p.s. I'm running on Ubuntu Intrepid.

like image 417
si28719e Avatar asked Aug 29 '09 05:08

si28719e


1 Answers

The int32 type isn't standard C - the standard equivalent is to #include <stdint.h> and use int32_t.

However, as a POSIX system, on Ubuntu plain int is (at least) 32 bit so you could just use that.

like image 196
caf Avatar answered Oct 11 '22 03:10

caf