2024-09-24 11:04 AM
Hello,
I have problem with including assembly code into my C++ project.
Include section of main.cpp:
#include "asm_math_wk.h"
asm_math_wk.h file:
#ifndef INC_ASM_MATH_WK_H_
#define INC_ASM_MATH_WK_H_
extern void megawkurw(uint32_t test);
#endif /* INC_ASM_MATH_WK_H_ */
asm_math_wk.s file:
.syntax unified
.global megawkurw
.type megawkurw, %function
megawkurw:
.fnstart
movs R1, R0
bx LR
.fnend
When I call my assembly function:
megawkurw(999);
I get build error:
main.cpp: undefined reference to 'megawkurw(unsigned long)'
This problem occurs only in .cpp, when I include same assembly code into the .c project, everything compiles fine.
Best Regards
Solved! Go to Solution.
2024-09-24 11:32 AM
extern "C" void megawkurw(uint32_t test); // address name mangling..
2024-09-24 11:32 AM
extern "C" void megawkurw(uint32_t test); // address name mangling..
2024-09-24 12:26 PM
It compiles fine.
You are great, thank you!
BR,
Wikte