linking asm and c procedures

R

R

hello.

I've got problem with linking asm and c procedures.

I've got main.c where i've got my external definitions:

extern int buffer(int,int,int); // coded in asm
extern int hash(int,int); //coded in asm

I've got simple make file for my project:

BC=c:\bc5
BCBIN=c:\bc5\bin
proj.exe: main.obj buffer.obj
$(BCBIN)\tlink32 -L$(BC)\lib c0x32.obj $**, proj.exe, ,import32.lib +
cw32.lib
main.obj: main.c
$(BCBIN)\bcc32 -c main.c
buffer.obj: buffer.asm
$(BCBIN)\tasm /ml buffer.asm

Both buffer.obj and main.obj are created but when i try link them using
tlink32 i get:

MAKE Version 5.0 Copyright (c) 1987, 1997 Borland International
c:\bc5\bin\tlink32 -m -Lc:\bc5\lib c0x32.obj main.obj buffer.obj ,
proj.exe, ,import32.lib + cw32.lib
Turbo Link Version 2.0.68.0 Copyright (c) 1993,1997 Borland International
Error: Unresolved external '__ExceptInit' referenced from module c0nt.ASM
Error: Unresolved external '__startup' referenced from module c0nt.ASM
Error: Unresolved external '__GetExceptDLLinfoInternal' referenced from
module c0nt.ASM
Error: Unresolved external '_printf' referenced from module main.c
Error: Unresolved external '_getch' referenced from module main.c
Error: Unresolved external '_exit' referenced from module main.c
Error: Unresolved external '__matherr' referenced from module c0nt.ASM
Error: Unresolved external '__matherrl' referenced from module c0nt.ASM
Error: Unresolved external '__fmode' referenced from module c0nt.ASM
Error: Unresolved external '__setargv__' referenced from module c0nt.ASM
Error: Unresolved external '__setenvp__' referenced from module c0nt.ASM
** error 2 ** deleting proj.exe

the problem is only when i try to link both OBJ files.

what am i doing wrong?

maybe i should include more libs? i use only: c0x32.obj, import32.lib and
cw32.lib

thanks in advance
best regards R
 
J

Joona I Palaste

R said:
I've got problem with linking asm and c procedures.
I've got main.c where i've got my external definitions:
extern int buffer(int,int,int); // coded in asm
extern int hash(int,int); //coded in asm
I've got simple make file for my project:
BC=c:\bc5
BCBIN=c:\bc5\bin
proj.exe: main.obj buffer.obj
$(BCBIN)\tlink32 -L$(BC)\lib c0x32.obj $**, proj.exe, ,import32.lib +
cw32.lib
main.obj: main.c
$(BCBIN)\bcc32 -c main.c
buffer.obj: buffer.asm
$(BCBIN)\tasm /ml buffer.asm
Both buffer.obj and main.obj are created but when i try link them using
tlink32 i get:
MAKE Version 5.0 Copyright (c) 1987, 1997 Borland International
c:\bc5\bin\tlink32 -m -Lc:\bc5\lib c0x32.obj main.obj buffer.obj ,
proj.exe, ,import32.lib + cw32.lib
Turbo Link Version 2.0.68.0 Copyright (c) 1993,1997 Borland International
Error: Unresolved external '__ExceptInit' referenced from module c0nt.ASM
Error: Unresolved external '__startup' referenced from module c0nt.ASM
Error: Unresolved external '__GetExceptDLLinfoInternal' referenced from
module c0nt.ASM
Error: Unresolved external '_printf' referenced from module main.c
Error: Unresolved external '_getch' referenced from module main.c
Error: Unresolved external '_exit' referenced from module main.c
Error: Unresolved external '__matherr' referenced from module c0nt.ASM
Error: Unresolved external '__matherrl' referenced from module c0nt.ASM
Error: Unresolved external '__fmode' referenced from module c0nt.ASM
Error: Unresolved external '__setargv__' referenced from module c0nt.ASM
Error: Unresolved external '__setenvp__' referenced from module c0nt.ASM
** error 2 ** deleting proj.exe
the problem is only when i try to link both OBJ files.
what am i doing wrong?
maybe i should include more libs? i use only: c0x32.obj, import32.lib and
cw32.lib

Your question is about your compiler, not about the C language. Please
ask in a Borland newsgroup.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top