error: unknown type name ‘bool’ error: unknown type name ‘bool’ c c

error: unknown type name ‘bool’


C90 does not support the boolean data type.

C99 does include it with this include:

#include <stdbool.h>


C99 does, if you have

#include <stdbool.h> 

If the compiler does not support C99, you can define it yourself:

// file : myboolean.h#ifndef MYBOOLEAN_H#define MYBOOLEAN_H#define false 0#define true 1typedef int bool; // or #define bool int#endif

(but note that this definition changes ABI for bool type so linking against external libraries which were compiled with properly defined bool may cause hard-to-diagnose runtime errors).


Just add the following:

#define __USE_C99_MATH#include <stdbool.h>