Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

manish.kesarkar

macrumors newbie
Original poster
Hi
Hi I have written a function nabs in assembly file mymath.s as follows
.text
.align 2
.globl _nABS
.private_extern _nABS
_nABS:
stmfd sp!, {r3-r7,lr}
...... ......
ldmfd sp!, {r3-r7,pc}
I am calling this function from c function func1 in file myfunc.c
I have declared nABS in myfunc.h as
int nABS(int a);
and included myfunc.h in myfunc.c
Both myfunc.c and mymath.s are compiled sussessfuly and generate mymath.o and myfunc.o, but I get a linking error

Undefined symbols:
"_nABS", referenced from:
_func1 in myfunc.o
can anyone tell me why am I getting link error?
 
I don't know the exact answer, but -
- does "nm" command output tells something useful?
- If you compile with -S flag some simple C source containing function, and then try to assembly and link it, what happens?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.