HAL_GPIO_WritePin and HAL_GPIO_ReadPin are not boolean compatible with c++ compiler.
You can interpret return value as boolean (and pass value as boolean for gpio read and write as long as you compile you project in C but as soon as tried to compile in C++ those are not compatibles with boolean but return GPIO_PIN_SET or GPIO_PIN_RESET which is not interpreted as boolean by the compiler.
This is issue is on compilation side or HAL library side ?
NB : Screenshot show error as int and not boolean. And I imported stbool :
#ifndef __cplusplus
#define bool _Bool
#define true 1
#define false 0
#else /* __cplusplus */
/* Supporting _Bool in C++ is a GCC extension. */
#define _Bool bool
#if __cplusplus < 201103L
/* Defining these macros in C++98 is a GCC extension. */
#define bool bool
#define false false
#define true true
#endif
#endif /* __cplusplus */NB : partially solved this issue by adding -fpermissive to my flags compiler as suggested by the compiler message.
Thanks for your help.