I'm using Visual Studio for c++ programming, and after working and writing programs in x86 environment (32bit Mode) I tried to build my x86 project in x64 environment so I thought that I should create a win64 console project instead of win32 console project but there were not such as an option in VC2010 . so I want to ask that for building x64 projects I should also choose win32 project and change the settings for compiling in x64 inside the project using instruction in here?
I'm using windows 7 64bit.
if your answer is yes then why it is called win32?
"Win32" is the name of the OS API.
"Win32 Console Application" got its name from the API (not from bit-ness).
Win32 API can be used both by 32-bit and by 64-bit applications. So, a Win32 Console Application can be built both for 32-bit and for 64-bit. For the latter, create the "x64" configuration in the Configuration Manager.
The other answers pretty much have it covered, but I thought I might add the following clarifications:
X86 is for Intel/AMD's 32 bit chip set. Win32 can support other chipsets, such as ARM in a Windows Mobile project.
Furthermore, when building native c++ applications for x86, the platform will actually be called win32.
I think there is a confusion here, tell me if I am wrong, but you're basically have problems setting up your console program to the x64 platform.
If you're using the express version you will need to install a proper Microsoft Windows SDK for Windows 7 and .NET Framework 4 and SP1, as stated on the link you provided otherwise the x64 platform option won't be available. Have you already done this?
Once done this, switching to the x64 will be pretty easy, you will get the option on the dropdown list of the platforms, should compile fine (and no, you don't need to use the win32 configuration).
Related
I have the application that I was modifying and then I compiled it in Visual Studio 2012 (C++ app). When I tried it on 64bit windows, application worked, but when I´m trying to run it under 32bit windows xp I´m getting message like ".exe is not a valid win32 application". I have found several advices on the internet but nothing worked so now I don´t know where is the problem because I´ve been testing it on several win7 64bit OS.
In Visual Studio in Configuration manager window I have selected option win32 at project´s platform column.
You should review all the project settings.
"Win32" is just a name. For e.g., you can target Machine->X64 in linker setting despite the configuration name.
Without more information, I would say you are linking against 64-bit only libraries which are not available on the 32-bit platform. Check your linker settings and build again.
I have created an application using Qt 4.8.4, and now I have to distribute it on Windows 2000 machines, among the others. I have already tried searching over the Internet for a clear explanation about it, but I can't find a confirmation on what's the older Windows version actually supported by Qt.
The application runs fine on Windows XP (both 32 and 64 bit) and Windows 7 but, when I try to launch it on Windows 2000 I receive the well-known error "[Application name].exe is not a valid win32 application.", and I guess that the error relies on the unsupported Windows version.
The application is a "simple" one, it just need QtCore4.dll and QtGui4.dll as dependencies.
If it can help, I am developing on a Windows 7 64 bit machine, using Qt 4.8.4 and Qt Creator 2.7.1. If I go under Tools->Options->Build&Run->Kits->Manual->Desktop, I have "Microsoft Visual C++ Compiler 10.0 (x86)" as the compiler in use. Do I have to select a different one, maybe?
Thanks for any answer.
EDIT: What I've done after reading #vahancho's answer:
"Move" the project from Qt Creator to Visual Studio 2010, using CMake;
Install Visual Studio Express 2008 (enabling the V90 Platform Toolset, this way)
Open the project from VS2010, and go under Project Properties->Configuration Properties->General and change Platform Toolset to V90;
Recompile the project;
Now, I've tried to run the application compiled this way on a virtual machine, mounting Windows 2000, but I get another error, this time: "The procedure entry point DecodePointer could not be located in the dynamic link library KERNEL32.dll".
Well, after some investigations I found that running MSVC10 applications on Windows 2000 is not possible. You have to build it with at most MSVC9 (Visual Studio 2008), or use the VS2010 Multi Targetting feature to let VC++2010 use the VC++2008 compilers and libraries. Please also refer to this Microsoft Connect discussion.
OK, some time has passed, but I'd like to give a definitive answer to this question of mine. Unfortunately, what I was asking for it's not possible. #vahancho's answer is right, and the solution he pointed out is correct for the majority of situations. However, DecodePointer is "included" in Windows XP SP 2 kernel, and it's not possible to compile an application using it for an older Microsoft OS, even by choosing the VC++2008 compiler.
An additional reference is given by this post on CodeProject.
Fortunately for me, my application was simple enough to let me rewrite it using the good old VB6 :)
I'm using Visual Studio for c++ programming, and after working and writing programs in x86 environment (32bit Mode) I tried to build my x86 project in x64 environment so I thought that I should create a win64 console project instead of win32 console project but there were not such as an option in VC2010 . so I want to ask that for building x64 projects I should also choose win32 project and change the settings for compiling in x64 inside the project using instruction in here?
I'm using windows 7 64bit.
if your answer is yes then why it is called win32?
"Win32" is the name of the OS API.
"Win32 Console Application" got its name from the API (not from bit-ness).
Win32 API can be used both by 32-bit and by 64-bit applications. So, a Win32 Console Application can be built both for 32-bit and for 64-bit. For the latter, create the "x64" configuration in the Configuration Manager.
The other answers pretty much have it covered, but I thought I might add the following clarifications:
X86 is for Intel/AMD's 32 bit chip set. Win32 can support other chipsets, such as ARM in a Windows Mobile project.
Furthermore, when building native c++ applications for x86, the platform will actually be called win32.
I think there is a confusion here, tell me if I am wrong, but you're basically have problems setting up your console program to the x64 platform.
If you're using the express version you will need to install a proper Microsoft Windows SDK for Windows 7 and .NET Framework 4 and SP1, as stated on the link you provided otherwise the x64 platform option won't be available. Have you already done this?
Once done this, switching to the x64 will be pretty easy, you will get the option on the dropdown list of the platforms, should compile fine (and no, you don't need to use the win32 configuration).
Is there a simple way to compile a 64 bit app with the 32-bit edition of Visual C++ 2010 Express? What configurations, if any, are necessary?
Here are step by step instructions:
Download and install the Windows Software Development Kit version 7.1. Visual C++ 2010 Express does not include a 64 bit compiler, but the SDK does. A link to the SDK: http://msdn.microsoft.com/en-us/windowsserver/bb980924.aspx
Change your project configuration. Go to Properties of your project. On the top of the dialog box there will be a "Configuration" drop-down menu. Make sure that selects "All Configurations." There will also be a "Platform" drop-down that will read "Win32." Finally on the right there is a "Configuration Manager" button - press it. In the dialog that comes up, find your project, hit the Platform drop-down, select New, then select x64. Now change the "Active solution platform" drop-down menu to "x64." When you return to the Properties dialog box, the "Platform" drop-down should now read "x64."
Finally, change your toolset. In the Properties menu of your project, under Configuration Properties | General, change Platform Toolset from "v100" to "Windows7.1SDK".
These steps have worked for me, anyway. Some more details on step 2 can be found in a reference from Microsoft that a previous poster mentioned: http://msdn.microsoft.com/en-us/library/9yb4317s.aspx.
64-bit tools are not available on
Visual C++ Express by default. To
enable 64-bit tools on Visual C++
Express, install the Windows Software
Development Kit (SDK) in addition to
Visual C++ Express. Otherwise, an
error occurs when you attempt to
configure a project to target a 64-bit
platform using Visual C++ Express.
How to: Configure Visual C++ Projects to Target 64-Bit Platforms
Ref:
http://msdn.microsoft.com/en-us/library/9yb4317s.aspx
And make sure you download the Windows7.1 SDK, not just the Windows 7 one. That caused me a lot of head pounding.
I found an important step to add to this - after you've installed the SDK, go to your project properties and change Configuration Properties->General->Platform Toolset from v100 or whatever it is to Windows7.1SDK. This changes $(WindowsSdkDir) to the proper place and seemed to solve some other difficulties I was encountering as well.
Note that Visual C++ compilers are removed when you upgrade Visual Studio 2010 Professional or Visual Studio 2010 Express to Visual Studio 2010 SP1 if Windows SDK v7.1 is installed.
For instructions on resolving this, see KB2519277 on the Microsoft Support site.
Download the Windows SDK and then go to View->Properties->Configuration Manager->Active Solution Platform->New->x64.
Programming in a 64-bit environment is quite different than 32-bit environment.
Code generated has totally different assembly constitution in 32 & 64-bit code, even the protocols of communicating with functions change. So you can't generate 64-bit code using 32-bit compiler.
You might want to see an article on Microsoft's web site about targeting a 64-bit target but using a 32-bit development machine.
As what Jakob said: windows sdk 7.1 cannot be installed if MS VC++ x64 and x86 runtimes and redisrtibutables of version 10.0.40219 are present. after removing them win sdk install is okay, VS C++ SP1 can be installed fine again.
Kind regards
I am running VS Team System 2008 on WinXP. I make a new Win32 C++ project (Empty project). I go to Build Configuration to add a configuration for x64.
The only options I have are:
- Pocket PC 2003 (ARMV4)
- Smartphone 2003 (ARMV4)
I have no option for x64 (or Itanium). However, if I make a C# project within the same solution, I can create and select an x64 option for that project with no issues. But even then, when the x64 build configuration has been created, I still cannot select it for the C++ project - only for the C# project.
I have done this before on another system - creating an x64 config for a Win32 C++ project. But I can't do it now. Any ideas why? Something small/obvious no doubt, since google has offered no help. Thanks!
Maybe you didn't install the native x64 compiler.
Try to run setup again, and look if you selected the native x64 C++ compiler.