Hi,
I am getting a linker error like
error LNK2019: unresolved external symbol _GetLblAddress@0 referenced in function _callasm@0..
where GetLblAddress is defined in separate asm file.
I am using VS 2013 project and compiling it as win32 project ("/TC")
.asm code
-----------------------------------------------------------
.586
.model flat, c
.code
PUBLIC GetLblAddress
GetLblAddress PROC
//some assembly code
//some assembly code
ret
GetLblAddress ENDP
END
.C code
-----------------------------------------------------------
extern int GetLblAddress();
void callasm()
{
int lbl = GetLblAddress();
printf(...);
}
in compilation I am getting linker error.
I tried changing the name to _GetLblAddress but still getting same error.
Try extern int __stdcall GetLblAddress(void);
In C code define
extern int __cdecl GetLblAddress(void);
Because of your code.model flat, c
...
GetLblAddress PROC
GetLblAddress ENDP
oops, that's right: model flat, C
Hi,
__cdecl worked! :t
Thanks TWell.