Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
9 years, 5 months ago.
compiler error mbed src
Hi!
I am trying to compile mbed library with gcc and eclipse. I get the floowing error
src\mbed\hal/pinmap.h:19:0, from ../mbed/targets/hal/PeripheralPins.h:34, from ../mbed/targets/hal/PeripheralPins.c:31: \src\mbed\targets\hal/PinNames.h:40:58: error: invalid operands to binary << (have 'const struct PinMap *' and 'int')
- define STM_PIN_DATA(MODE, PUPD, AFNUM) ((int)(((AFNUM) << 7) | ((PUPD) << 4) | ((MODE) << 0)))
What can be the problem?
Thank you in advance, Dave
1 Answer
9 years, 5 months ago.
It looks like the compiler is viewing the rest of the bit OR operations as a PinMap struct type when trying to operand them with the typecast int, my suggestion would be to double check that you are using compatible variable types. The phrase "invalid operands" would indicate that you are trying to bit OR variables that have no defined bit OR method.
You could try typecasting all of the variables you are operating on to integers, or do the math in multiple lines to more accurately determine which ones are causing the compilation issue.