This may be a bit of a long shot...
I have a C project and want to include a C++ file however I am getting an error with the following code:
//GPIO_CPP.cpp
class GPIO
{
public:
uint32_t Port;
uint32_t Pin;
};
#ifndef __cplusplus
#error Enable CPP compilation
#endif
This inluded in my main.c as follows:
//main.c
#include "GPIO_CPP.cpp"
Error:
Error[Pe020]: identifier "class" is undefined
I have also tried putting this in a header file with .h and .hpp extensions with the same behaviour.
I've placed a compiler check:
#ifndef __cplusplus
#error Enable CPP compilation
#endif
which is firing.
My compiler options: