We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi,
I am currently playing about with MQTT using the MDK-Packs::Paho_MQTT pack in MDK-ARM. However, when I try and include the stm32f7xx.h file in my MQTT thread I get an error:
Arm\Packs\Keil\STM32F7xx_DFP\2.13.0\Drivers\CMSIS\Device\ST\STM32F7xx\Include\stm32f7xx.h(171): error: #101: "SUCCESS" has already been declared in the current scope
which is because it is declared here:
typedef enum { SUCCESS = 0U, ERROR = !SUCCESS } ErrorStatus;
in stm32f7xx.h, and here:
/* all failure return codes must be negative */ enum returnCode { BUFFER_OVERFLOW = -2, FAILURE = -1, SUCCESS = 0 };
in MQTTClient.h.
This currently means that I can't include both files. My question is, is there a way to override this (or otherwise fix this) without editing the two header files (as they are "locked" for editing by MDK-ARM).
Regards,
Alex
For anyone else that runs into this same problem I have created a pull request for the eclipse-paho project here:
github.com/.../214
that addresses this specific problem (by changing the enum values to use name prefixes as per Broeker's suggestion).
You might also raise the issue to ST ...
Broeker said: Changing just the headers would almost certainly not work, either, because these enum constants are going to appear all over the sources
I'm not sure it's actually resolved though ...
fair point.
but the resolution has been identified