I took an object file created using MS cl compiler. The original C code was just WinMain with no content. I tried to link it using subsystem windows and entry of winmain but I get a lnk2001 error unresolved symbol _winmain.

Adding a _winmain for the entry and I get the same error with __winmain.

I remember getting this same sort of error when I coded for masm but I can't remember how to fix this.
Posted on 2005-03-04 22:26:22 by drhowarddrfine
Never mind. (Emily)

I had thought the problem was linking to libraries. I was right. Because the Windows entry point was a blank WinMain function, the compiler didn't create any reference to it in the asm code. So there was nothing for the linker to reference, hence the error.

I put in an "int a=1;" statement and it links fine now.
Posted on 2005-03-04 22:42:47 by drhowarddrfine