I'm trying to link a .cpp file and a .asm file, this is my code:
factorial1.cpp
#include<iostream.h>;
#include<conio.h>;
int n;
extern int factorial();
void main(){
char tl;
L1:
clrscr();
cout<<"\n n: "; cin>>n;
cout<<"\n n factorial: "<<n<<" is: "<<factorial();
cout<<"\n continue (y/n)?";
tl=getch();
if(tl=='y') goto L1;
}
factorial2.asm
.MODEL large
.DATA
EXTRN _n:word
.CODE
PUBLIC @factorial$qv
@factorial$qv PROC
mov cx,_n
mov ax,1
cmp cx,2
jb L3
L2: mul cx
loop L2
L3: ret
@factorial$qv ENDP
END
Then, I use this command in to compile the codes:
\Compiler\BIN\TCC -ml -I\Compiler\INCLUDE -L\Compiler\LIB factorial1.cpp factorial2.asm
I got the .obj files but dosbox show the error:
no DOS extensions in the DPMI server
how can I fix that error?
I'm using tcc 3.0, tasm version 4.1 and tlink version 7.0
EDIT 2
I tried TLINK 3.01 and 5.0 now I got this

EDIT 3
I changed extern int factorial(); to extern "C" int factorial(); in cpp file and @factorial$qv to _factorial in asm file. I compiled it with no error now. But when I use TLINK to link 2 obj file, I got this error:

