Click to See Complete Forum and Search --> : TASM and BCC


ionutdinulescu
March 14th, 2005, 09:57 AM
I have the following cpp and asm sources :

//--testc.cpp
#include <stdio.h>
extern int rez(int,int);
void main(){
int x,y;
int v=rez(3,5);
printf("%d", v);
}
//--testa.asm
.model small
.stack 100
.code
public _rez
_rez proc near
push bp
mov bp,sp
mov ax,[bp+4]
add ax,[bp+6]
pop bp
ret
_rez endp
end

I use the following commands to compile&link :
d:\borlandc\bin\bcc -ms -c -Id:\borlandc\include testc.cpp
d:\borlandc\bin\tasm /ml testa.asm
d:\borlandc\bin\tlink d:\borlandc\lib\c0s testc testa, testc,,d:\borlandc\lib\cs

The linker tells me :
Undefined symbol rez(int,int) in module TEST.CPP

I use bcc ver3.1, asm ver3.1, tlink ver 5.1

Does anyone know what is happening ??? What tlinker/tasm/bcc version should I use to get this working ?

Thank you

NoHero
March 14th, 2005, 11:21 AM
Try...


extern "C" int rez( int, int );