ARMCC: REFERENCING C FUNCTIONS FROM C++
Information in this article applies to:
I'm calling a C function called my_func from a C++ module. When I try to build the project, I get the following linker error:
Error: L6218E: Undefined symbol my_func().
In my C++ module, I declared the function as follows:
extern void my_func (void);
What is wrong? How do I call a C function from C++?
To call a C function from C++, use the following type conversion notation:
extern "C" void my_func (void);
This tells the linker that the my_func function requires a C-style linkage to the C++ module.
The following Discussion Forum threads may provide information related to this topic.
Last Reviewed: Friday, November 9, 2018
of your data.