Using C++ and C files. Header file compilation error
Hi All
I have a project using STM32F407 MCU. I have a main.cpp and several .cpp and .c files. When compiling, I am getting errors related to the header files:
For example:
In file included from C:/tmp/ACC/inc/Controller.h:11:0,
from C:/tmp/ACC/inc/main.h:11,
from ../src/simulatorcontrol.c:4:
C:/tmp/ACC_DE25/inc/AdcChannel.h:39:1: error: unknown type name ‘class’
This file AdcChannel.h has the following:
- ifndef ADC_CHANNEL
- define ADC_CHANNEL
- ifdef __cplusplus
extern “C” {
- endif
- include “AdcCommon.h”
class AdcChannel
{
private:
protected:
....
.....
};
- ifdef __cplusplus
}
- endif
- endif // ADC_CHANNEL
Any advice how to fix this?