Mail Archives: djgpp/1998/06/14/03:38:12
I've decided to rewrite everything in NASM, but came across a problem.
1. When I write:
--[file.asm]------------------------------------------------
[BITS 32]
[GLOBAL _My_function]
[SECTION .text]
_My_function:
mov ax, 1010
ret
------------------------------------------------------------
with
--[test.c]--------------------------------------------------
extern int My_function();
void main()
{
printf("Result=%d\n", My_function());
return;
}
------------------------------------------------------------
it compiles ok. But if I change file name from test.c to objective
test.cc it doesn't. It says "Undefined reference to My_function(void)"
2. When I write:
--[file.asm]------------------------------------------------
[BITS 32]
[GLOBAL _My_function__FUi]
[SECTION .text]
_My_function__FUi:
mov ax, 1010
ret
------------------------------------------------------------
with
--[test.c]--------------------------------------------------
extern int My_function(unsigned int);
void main()
{
printf("Result=%d\n", My_function(23));
return;
}
------------------------------------------------------------
it says "Undefined reference to My_function". Why?
Please help me.
-PK
- Raw text -