Hmm, what do you mean by "undercoating"? (I couldn't find the word in the dictionary)
After adding the underscore in various places in the code, VS still yields an error.
Also, I don't know if I'm looking on the right kernel32.inc file (I don't know what the file contains actually) (the kernel32.inc file from MASM?), but if I do, it fails to give me any clues on how the proper syntax should be. Here is how the file looks inside:
OpenSemaphoreA PROTO STDCALL :DWORD,:DWORD,:DWORD
IFNDEF __UNICODE__
OpenSemaphore equ <OpenSemaphoreA>
ENDIF
OpenSemaphoreW PROTO STDCALL :DWORD,:DWORD,:DWORD
IFDEF __UNICODE__
OpenSemaphore equ <OpenSemaphoreW>
ENDIF
OpenThread PROTO STDCALL :DWORD,:DWORD,:DWORD
OpenWaitableTimerA PROTO STDCALL :DWORD,:DWORD,:DWORD
IFNDEF __UNICODE__
OpenWaitableTimer equ <OpenWaitableTimerA>
ENDIF
OpenWaitableTimerW PROTO STDCALL :DWORD,:DWORD,:DWORD
IFDEF __UNICODE__
OpenWaitableTimer equ <OpenWaitableTimerW>
ENDIF
//edit:
This is definitely a linker issue. When I change the name of either of the files (sum.cpp or sum.asm), then inside "c:\Documents and Settings\ddd\My Documents\Visual Studio 2008\Projects\20120604\sum\sum\Debug\sum.obj" directory, two *.obj files are created (sum.obj and sum1.obj). So if those two files (sum.cpp and sum.asm) have the same name, the linker creates two *.obj files with the same name. Hence the error. The workaround is to remember to name the *.asm uniquely within the VS project files (uniquely == no file in VS project can have the same filename as the *.asm file).
Also, I don't know why, but now changing the name of _either_ file (instead of only changing the *.asm file name) compiles the project correctly.
The other thing I've thought about is that maybe VS has a built-in sum() function and this sum() function somehow interferes with the file of the same name. But this is probably not the case.