I have C and asm files which I want to link them. I compiled C files with tcc and asm files with tasm. But I wonder how the linker(tlink) understands the entry point of code.
Here is my makefile:
pmode.exe: pmodeasm.obj pmodec.obj
tlink /c /x /3 c:\tc\lib\c0s pmodeasm pmodec, pmode,, c:\tc\lib\cs
pmodeasm.obj: pmodeasm.asm
tasm /m2 /mx /zi /o pmodeasm.asm
pmodec.obj: pmode.h pmodec.c
tcc /c pmodec.c
And tlink gives this error:
Error: Undefined symbol _main in module c0.ASM
But my main code is in asm part and I use C file to call some function from it. how can I tell the linker that the entry point of code is in Asm file?
C & Asm
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:C & Asm
name your entry point _main
however, if you have a ASM entry point, i'm not sure you need c:\tc\lib\c0s to be linked. that runtime library is likely to have its own entry point which calls _main, and you might have trouble with it as it could perform operations you don't want to be performed ...
however, if you have a ASM entry point, i'm not sure you need c:\tc\lib\c0s to be linked. that runtime library is likely to have its own entry point which calls _main, and you might have trouble with it as it could perform operations you don't want to be performed ...