error: unknown type name ‘bool’
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).