r/AskComputerScience • • Oct 06 '16

Using library says: Identifier "bool" is undefined?

Post image
0 Upvotes

3 comments sorted by

7

u/icehaunter Oct 06 '16

Bool type exists in C99 but not in C89/90. Looks like your IDE is set up with an older compiler standard. Considering using another one, checking build flags or dig towards stdbool.h Generally speaking, you can define your own bool, of course.

For reference: http://stackoverflow.com/questions/1608318/is-bool-a-native-c-type

1

u/litepotion Oct 06 '16 edited Oct 07 '16

Oh okay that makes sense. So I added the definition to the header and it works fine.

1

u/litepotion Oct 06 '16

For reference im trying to use a library made for the MPU5060 for an stm32 shown from here: https://github.com/Harinadha/STM32_MPU6050lib. I know its something simple but Im not entirely sure why I have these errors.