GCC linaro compiler throws error "unknown type name size_t"

rashok picture rashok · Oct 16, 2014 · Viewed 60.2k times · Source

I am using GCC Linaro compiler for compiling my code. Its throwing the error unknown type name size_t from libio.h. Its included from stdio.h. In my code I am just including stdio.h.

Can any one please how to resolve this error.

Answer

Andrew Piroli picture Andrew Piroli · Oct 16, 2014

As per C99, §7.17, size_t is not a builtin type but defined in <stddef.h>.

Including the <stddef.h> header should fix your problem.