Hi,I am trying to use some code from masm.So,I have put all routines to one file and cpmpiled as lib.I added this lib to my project link options.I have a proc like below
SearchSytem Proc uses ebx esi edi szPath:DWORD, szBuff:DWORD
xor eax,eax
ret
SearchSytem endp
Therefore I added following declaration to my c file.

extern "C" __stdcall SearchSystem (char, char);

When I compile project it says unresolved external symbol _SearchSystem@8

Any help is appreciated.Thanks
Posted on 2004-04-18 17:42:06 by LaptoniC

.586p
.model flat,stdcall
option casemap:none
option proc:private
...
PUBLIC SearchSystem
SearchSytem Proc STDCALL uses ebx esi edi szPath:DWORD, szBuff:DWORD
...


Btw, your asm proc is SearchSytem - it misses an 's' :)
Posted on 2004-04-18 17:48:31 by f0dder
I am gone shoot myself :).Thanks f0dder.However now it asks from the lib files I used ie /masm32/lib/comdlg32.lib .
Posted on 2004-04-18 18:03:45 by LaptoniC
Stop using the hardcoded \masm32\lib and \masm32\include paths - use proper relative syntax. Then, set up your INCLUDE and LIB environment variables (very easy in NT, under 9x you need to modify autoexec.bat which is easy enough, but requires a reboot before changes are global).

This saves you some typing when writing your assembly apps, and makes building+linking easier. Not to mention that it makes it possible to put your masm32 distribution wherever you want, and have sources on a different partition than masm32 was installed to :rolleyes:

Btw, this macro is pretty useful, I think it came from BitRAKE:


incAPI MACRO files:VARARG
FOR file, <files>
include file&.inc
includelib file&.lib
ENDM
ENDM


With this, you can do


include <windows.inc>
incAPI <kernel32,user32,advapi32>
Posted on 2004-04-18 18:07:52 by f0dder
Thanks I found myself too.In RadASM no need to define hardcoded paths.I appreciate the help.
Posted on 2004-04-18 18:25:42 by LaptoniC