0

Another "*.exe is not a valid win32 application" question. I have Visual Studio 2013. My C++ project works fine on Windows Server 2008, Windows 8, Windows 7. But not on Windows Server 2003.

I looked at all the other similar problems here at Stackoverflow but could not find an appropriated solution. I looked at this page and applied the fix by changing Configuration Properties > General page, change Platform Toolset to "(v120_xp)". I still have the issue. The file size also looks normal. I have compiled it with Mutli-thread(/MT) and Win32 Solution Platform.

My include files are:

#include "LoadController.h"
#include <iostream>
#include <chrono>
#include <thread>
#include <random>
#include <ctime>
#include <string>
#include <stdio.h>

I created the project by creating a plane "new project" (I do not know if this matters). I do not call any other application with it. The project contains only one class.

Thank you in advance.

Community
  • 1
  • 1
Incanus
  • 389
  • 1
  • 4
  • 16

1 Answers1

4

Just after I had posted this question I found the solution. Like the comment at xxxxxx.exe is not a valid Win32 application from Andrey Sorich states: I needed to add a subsystem.

So, if you have a blank in "Configuration Properties -> Linker -> System -> Subsystem" you will still get the "not valid Win32 app" error on XP and Win2003 while on Win7 it works without this annoying error. The error gone as soon as I've put subsystem:console.

Unfortunately his answer did not have any "Vote Ups". Since I cannot produce any "Vote Ups" with my current level at stackoverflow, I just would like to highlight this solution in my own question.

Incanus
  • 389
  • 1
  • 4
  • 16