Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

Not a valid win32 application

Edwin_W_
Beginner
1,120 Views

Hi,

I need to write a program that will run on a intel atom d525 processor with windows xp installed. I am using Parallel Studio 2013 with Visual Studio 2012.

When I tried running my code on the machine with windows XP I got the following error:
... is not a valid win32 application.

After some initial research I found out that this was because the console application compiled with Visual C++ uses windows APIs that are not available in windows XP and it has provided a special compiler with which you can compile code that is compatible for windows XP.

This is all very well, and I got this to work. The problem is that I need to highly optimise the code, and I was planning on using the intel C++ compiler to do this. However I have not found a way to compile code with the Intel C++ compiler that is compatible on windows XP.

I tried using 
#include <WinSDKVer.h>
#define _WIN32_WINNT 0x0502
but maybe I did something wrong, because that did not seem to do anything.

I do not necessaraly  need to use a console application, just some way to start the program in windows XP.

Kind regards,
Edwin 

 

0 Kudos
6 Replies
TimP
Honored Contributor III
1,120 Views

You're probably aware that the service pack for VS2012 supports specific libraries and instructions

http://blogs.msdn.com/b/vcblog/archive/2012/10/08/10357555.aspx

on how to link them, in order to be able to run on XP.  I can't tell whether you tried to follow Microsoft's instructions about link dependencies for XP target when using Intel C++; it looks like maybe not.  The VS2010 libraries also may work.

0 Kudos
SergeyKostrov
Valued Contributor II
1,120 Views
>>I tried using >>#include >>#define _WIN32_WINNT 0x0502 >>but maybe I did something wrong, because that did not seem to do anything. For Windows XP platforms it needs to be defined as follows: #define _WIN32_WINNT 0x0501 Please try and let us know if application starts. Also, take a look at the article, web-link provided by TimP, because it has lots of important details for developers using Visual Studio 2012.
0 Kudos
SergeyKostrov
Valued Contributor II
1,120 Views
Here is an example of my standard block of definitions for Windows XP platforms: ... // Platform Version Section #ifndef WINVER // Specifies that the minimum required platform is Windows XP #define WINVER 0x0501 #endif #ifndef _WIN32_WINNT // Specifies that the minimum required platform is Windows XP #define _WIN32_WINNT 0x0501 #endif #ifndef _WIN32_WINDOWS // Specifies that the minimum required platform is Windows 98 #define _WIN32_WINDOWS 0x0410 #endif #ifndef _WIN32_IE // Specifies that the minimum required platform is Internet Explorer 6.0 #define _WIN32_IE 0x0600 #endif ...
0 Kudos
Edwin_W_
Beginner
1,120 Views

My apologies for the late reply. The Easter Holiday came in the way of working on this project.

I have checked the dependencies that Microsoft's instructions mention for visual studio while compiling with the Intel Compiler and did get it to work. One thing I noticed was that Visual Studio adds a comma on the line to define the version, and this comma causes the compilation to fail. I had previously removed the entire "version" line, which is why it did not work on the windows XP platform. Removing the comma made the compiler understand the command and then everything worked fine.

Thanks for the advice

0 Kudos
SergeyKostrov
Valued Contributor II
1,120 Views
>>... I noticed was that Visual Studio adds a comma on the line to define the version, and this comma causes the compilation to fail... Could you post that piece of code or a screenshot? Thanks in advance.
0 Kudos
Alex_G_1
Beginner
1,120 Views

I am late for the party... but I had a similar problem with running 32-bit Intel-compiled DLL on 64-bit Windows 7. I solved it by statically linking my DLL to libmmds.lib.See https://software.intel.com/en-us/forums/intel-c-compiler/topic/306546 for details...

0 Kudos
Reply