Hopefully someone has a better answer, but I fixed in by installing MASM from this site. It puts the masm32 folder in the root directory (C:\ for most of us)
http://www.masm32.com/download.htm
Edit: Also, the .inc files are just a bunch of function prototypes. So you could just prototype whatever function you want and then use includelib to call it.
http://win32assembly.programminghorizon.com/tut2.html
In our example above, we call a function exported by kernel32.dll, so we need to include the function prototypes from kernel32.dll. That file is kernel32.inc. If you open it with a text editor, you will see that it's full of function prototypes for kernel32.dll. If you don't include kernel32.inc, you can still call ExitProcess but only with simple call syntax. You won't be able to invoke the function. The point here is that: in order to invoke a function, you have to put its function prototype somewhere in the source code. In the above example, if you don't include kernel32.inc, you can define the function prototype for ExitProcess anywhere in the source code above the invoke command and it will work. The include files are there to save you the work of typing out the prototypes yourself so use them whenever you can.
.386
.model flat, stdcall
option casemap:none
include C:\masm32\include\windows.inc
include C:\masm32\include\kernel32.inc
includelib C:\masm32\lib\kernel32.lib
.data
.code
start:
invoke ExitProcess,0
end start
But I could just as easily remove the includes:
.386
.model flat, stdcall
option casemap:none
includelib C:\masm32\lib\kernel32.lib
.data
.code
start:
ExitProcess PROTO STDCALL :DWORD
invoke ExitProcess,0
end start
includelib
? It seems that it is sufficent that any one source file useincludelib
without usingincludelib
in every source file. – Wintergreen