By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,369 Members | 1,147 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,369 IT Pros & Developers. It's quick & easy.

linking asm and c procedures

P: n/a
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

Nov 14 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
R <ruthless@@@poczta.onet.pl> scribbled the following:
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


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

--
/-- Joona Palaste (pa*****@cc.helsinki.fi) ------------- Finland --------\
\-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
"This isn't right. This isn't even wrong."
- Wolfgang Pauli
Nov 14 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.