| |||||
Technical Support Support Resources
Product Information | ARMCC: REFERENCING C FUNCTIONS FROM C++Information in this article applies to:
QUESTIONI'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++? ANSWERTo 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. MORE INFORMATION
Last Reviewed: Monday, July 10, 2006 | ||||
| |||||