Content originally posted in LPCWare by fjrg76 on Wed Dec 24 16:58:15 MST 2014 Hi,
I faced an issue for the interrupt handlers while compiling my C++ application. I solved it already, but I want to post my solution in case you'll find yourself struggling with the same problem.
General solution:
When mixing C and C++ code for the same project one needs to place the C code in between
#ifdef __cplusplus
extern "C" {
#endif
/* here your C functions (prototypes or declarations */
#ifdef __cplusplus
}
#endif
Particular solution:
What I did was to embrace the interrupt handler in between the preprocessor directives
Why is so? Because C++ adds some characteres to the name of the functions (or methods). So, for the compiler (if you don't use the preprocessor guards) the function SysTick_Handler looks like __SysTick_Handler__ (or something similar), which is naturally very different to what you expect. Using the preprocessor guards you're compeling the compiler to respect the name (among other things).
Content originally posted in LPCWare by R2D2 on Wed Dec 24 17:03:47 MST 2014 Quote: fjrg76 Why is so? Because C++ adds some characteres to the name of the functions (or methods).