I put a simple class in a file named "test.h". The class is as follows:
class a { public: int b; };
I am using the Keil MCBSTM32 board (STM32F103RB processor).
I place this file in "C:\Keil\ARM\Boards\Keil\MCBSTM32\Timer". I then open the timer project.
If I include the file in timer.c I get the following error:
Build target 'MCBSTM32' compiling Timer.c... test.h(2): error: #20: identifier "class" is undefined test.h(2): error: #65: expected a ";" Target not created
Why does it give me an error? I thought the compiler ssuported C++?
C++ is supported by the compiler.
Take a look at the File naming convention: http://www.keil.com/support/man/docs/armcc/armcc_babbjcee.htm
There are also some examples that use C++ in the MDK installation: Keil\ARM\Examples\C++
Thank you for the reference. I was looking for the compiler manual and somehow never came across it. This will definitely help me move forward.