The MASM Forum

General => The Campus => Topic started by: reconmax on January 18, 2013, 09:02:51 AM

Title: WinXP "Prog.exe is not a valid Win32 application."
Post by: reconmax on January 18, 2013, 09:02:51 AM
I wrote a program using Masm32. I compiled it on a Win7x64 box and it runs fine. But on WinXp it generates an error when it runs.
"Prog.exe is not a valid Win32 application."
I thought maybe it was a 64 vs 32 bit issue but when I look at project properties in Visual Studio it indicates  x86 for target machine.

Any ideas why this is happening? Here are my includes if it is helpful...


include \Masm32\Include\windows.inc
include \Masm32\Include\kernel32.inc
include \Masm32\Include\masm32.inc
include \Masm32\Include\masm32rt.inc


And the command line...


/OUT:"C:\Data\Prog\trunk\Debug\Prog.exe" /MANIFEST /NXCOMPAT /PDB:"C:\Data\Prog\trunk\Debug\Prog.pdb" /DYNAMICBASE
"kernel32.lib" "user32.lib" "gdi32.lib" "winspool.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib"
"odbc32.lib" "odbccp32.lib" /DEBUG /MACHINE:X86 /ENTRY:"start" /INCREMENTAL /PGD:"C:\Data\Prog\trunk\Debug\Prog.pgd"
/SUBSYSTEM:WINDOWS /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /ManifestFile:"Debug\Prog.exe.intermediate.manifest"
/ERRORREPORT:PROMPT /NOLOGO /TLBID:1



Title: Re: WinXP "Prog.exe is not a valid Win32 application."
Post by: dedndave on January 18, 2013, 09:19:42 AM
include \Masm32\Include\windows.inc
include \Masm32\Include\kernel32.inc
include \Masm32\Include\masm32.inc
include \Masm32\Include\masm32rt.inc


the last one takes care of the previous 3
but, that's not the problem
we need more info about the program source
Title: Re: WinXP "Prog.exe is not a valid Win32 application."
Post by: Greenhorn on January 18, 2013, 09:38:37 AM
Yes, and we need more info about which version of Visual Studio you use and which SP is installed on your XP.
Maybe this helpes you a little bit: VS2010-created EXE not a valid WIN32 app under W2000 (http://go4answers.webhost4life.com/Example/vs2010-created-exe-not-valid-win32-app-123210.aspx)
Title: Re: WinXP "Prog.exe is not a valid Win32 application."
Post by: Antariy on January 18, 2013, 05:34:23 PM
reconmax, could you post an EXE which generates this error?
Title: Re: WinXP "Prog.exe is not a valid Win32 application."
Post by: Dubby on January 22, 2013, 12:47:12 AM
QuoteI thought maybe it was a 64 vs 32 bit issue but when I look at project properties in Visual Studio it indicates  x86 for target machine

you need to define the minimum required version in

Linker -- System -- Minimum Required Version

also in

Linker  -- General -- Version

from properties of your project in visual studio..