Hello all.
As always i have another problem with my Visual Studio 2008 Professional edition.
I am running it on windows vista ultimate x64 edition.
And i couldnt get my apps made here to work under any other xp machine (x32).
I have created an empty c++ project ( Framework 3.5).
After i have added main.c and made a hello world prog.
In the Configuration Manager i can see the next platforms :
Win32
Pocket PC 2003(ARMV4)
Smartphone 2003(ARMV4)
Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
Windows Mobile 5.0 Smartphone SDK (ARMV4I)
x64
I tryied to compile in both x64 and win32 and run it .
Both of them runned under x64 windows, but neither under x86.
How can i add x86 platform support ?
Thanks in advance.

Dani AI

Generated

A few focused checks and fixes that address the symptoms described by and the suggestions from .

First, confirm whether the executable really is 32-bit and whether any runtime DLLs are missing. From a Visual Studio 2008 Command Prompt run:

dumpbin /headers path\to\your.exe
dumpbin /dependents path\to\your.exe

Look for the machine type (x86 vs x64) in the /headers output and any missing CRT entries in /dependents. If the binary is 64-bit, it will show x64; if it is 32-bit but requires a debug CRT (msvcr90d.dll) that is not on the target PC, the app will fail on machines without Visual Studio installed.

If the build is 32-bit but only the Release configuration runs on the target (as found), the usual cause is the Debug CRT not being present on the target. Debug runtimes are not redistributable. Two practical fixes:

  • Distribute a Release build and install the Visual C++ 2008 Redistributable (vcredist_x86.exe) on the target, or
  • Link the CRT statically for the configuration you plan to ship: Project Properties -> C/C++ -> Code Generation -> Runtime Library -> choose Multi-threaded (/MT) for Release (caution: static linking increases binary size and has maintenance implications).

To force a true Win32 output if the project is incorrectly targeted: Project -> Properties -> Linker -> Advanced -> Target Machine -> set to MachineX86. Also verify Solution and Project platforms in Configuration Manager (create a new platform named Win32 if needed).

To reuse settings across projects, use the Property Manager (View -> Property Manager): create a property sheet for Debug|Win32 or Release|Win32 and attach it to other projects so platforms and runtime settings are consistent.

If uncertainty remains, run Dependency Walker (depends.exe) on the target machine to see missing modules and bitness mismatches.

Recommended Answers

All 13 Replies

Are you running Visual Studio 2008 64-bit version? If so, does it actually build 32-bit versions, or only 64-bit! (As 64-bit code will not run on Win32!)

I'm using Visual Studio 32 bit version .
Some time ago it built x84 code and had an option for it ,but not now.
And when i build win32 app it doesnt work under x32 version of windows.
I'm currently reinstalling the visual studio, hope it helps.

Sounds like time for a re-install. 32-bit Visual Studio should be building 32-bit applications.

Does it run in the debugger but not when just running the exe?

Nop, it says it cant execute it .
The error is diferent from the "x64 error" because when i try to build x64 and run on x86 machine ,it says that the app is not a valid 32 bit application.
On the other machine i currently have visual studio 2005. But the debugger is not launched when error occurs.

Multi-threaded application?
Project - Properties
Configuration Properties
Code Generation
DEBUG Configuration
Make sure it is Multi-threaded Debug /MTd NOT
Multi-threaded DEBUG DLL /MDd
Same for release.


Check to see if multi-threaded option is set in configuration. If so, change from DEBUG Multi

Even after reinstall i have the same problem .
And i dont have "Code generation" submenu in Configuration Properties. The ideia is not to be multithreaded app.
Is there a way you can send me the x86 "solution platform" ?

Doesn't work that way.
Find your application configuration. Find the multi-threaded single-threaded and make sure it is what you expected!

Cant really find that information anywhere... =(

I just ran vc8 which I have but don't use.
Menu: Project
SubMenu: Properties (last sub-menu item)
C/C++
Code Generation
Click on it

Runtime Library
Click on 2nd column then look at options.

Do for Debug configuration and Release configuration.

Ok ,changed the required option (for that i've created a new console aplication, because i couldnt find the option "code generation" with an empty project) but the problem is still the same ,works on x64 and not on x86 (win32 configuration).

So how can i put the VS to compile to x86 ?

Couldnt edit the post. So posting agai.
I've found a project that has x86 as a solution platform, is there a way to export it to other projects ?

I still have the same problem, but it can be suspassed when chosing the "Release" at the configuartion manager, dont know why does the debug doesnt want to work but whatever...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.