Hi everybody, I am continuning my question series with a very very stupid one. I am trying to write a very simple program with djgpp, ld and nasm.
inside stringExp.asm:
[GLOBAL _name]
_name db 'Ozgun Harmanci',0
//////////////////////////////////////////////////////////////////
inside stringExp.c:
#include "stdio.h"
extern char name[];
int main(void)
{
printf("%s", name);
return 0;
}
I think this program should write Ozgun Harmanci onto screen.
However, when I compile and link these as:
nasm -f aout -o stringa.o stringExp.asm (This is OK)
gcc -c stringExp.c -o stringc.o (This is also OK)
ld -o string.exe stringa.o stringc.o
When ld is executed it gives 2 errors telling that there are undefined references to printf and name inside stringc.o
I know that this is a veryu simple mistake but I am newbie in object files and etc., so ;D. Thanx in advance for any advices...