compile 64 bit under visual studio 2010 - c++

I have a 32 bit operating system and i am under visual studion 2010. I was wondering if i can compile a 64-bit MFC application with VS2010 under my OS.
Thank you.

Yes, VS2010 has a cross-compiler in the vc/bin/x86_amd64 subdirectory. It is automatically used when you add the x64 platform to your solution. If you don't see it then re-run setup to add the 64-bit compilers.
You of course can't test it.

In the Configuration Manager, add a new solution platform. If you have the x64 compilers and tools installed, 'x64' should be listed as an available option.

Yes, you can compile the code, but you can not run it. In order to run the code, you need to specify the run-time environment.

Related

Visual Studio 2015 - missing 64 bit compiler

Currently I'm working with Visual Studio 2015 on a 32-Bit computer and create 32-bit applications in C++/CLI.
As far as I remember one could choose between creating 32 and 64-Bit applications in previous Visual Studio versions, if one has installed the 64-Bit compiler too.
Today I was trying to get the same functionality out of the 2015's version of Visual Studio, but I'm not able to find any option to install the 64-Bit compiler.
In the compiler-settings I can only choose between ARM and 32-Bit (no 64-Bit, no "any platform"). Running the Visual Studio Setup from the Windows system preferences also shows no possibility to install the 64-Bit compiler (or maybe i just don't know what to install).
QUESTION: How can I install the 64-Bit C++ compiler for Visual Studio 2015 on a 32-Bit computer?
#GSerg gave the aswer I needed in his first comment - thank you for your help!
The compiler seems to be installed by default. I just wasn't able to find the way to set the platform.

Deploy a c++ game to other windows machines

I have created a c++ game with the following libraries : SDL2 and SDL2_MIXER. I want to give the game to some friends who have no programming experience to play with. Now I don't really know how to do that.
What I have tried is to use installshield limited edition with visual studio. After giving the installation program to some friends they all had a common problem-error that a dll MVCsomething was missing.
What is the simplest way to give my friends the app? Since c++ is translated to assembly do I have to compile the source again each time I change a machine?
Given the way that you've tagged your question, it is unclear if you are using Visual Studio or CodeBlocks to compile the code.
I guessing that you're compiling it in Visual Studio, and therefore they're getting an error that they don't have the appropriate MSVCRT DLLs—in other words, the C runtime library that your code depends upon, having been compiled with Microsoft's compiler. Point them to download the version of the Visual C++ Redistributable matching the version of Visual Studio that you're using on your development computer. For example, if you have VS 2015, they'll need to install Visual C++ Redistributable for Visual Studio 2015.
Alternatively, you can bundle the required redistributable into your installer to make sure that it gets installed automatically, if it isn't already. In InstallShield, I believe that's done by marking the VC++ Redistributable as a "requirement". Make sure that it's set as a prerequisite. Although, judging from the answer to this question, it may be that InstallShield LE doesn't support this. If that's the case, my advice would be to ditch InstallShield altogether and use something like Inno Setup to build an installer. There is a moderate learning curve, but it is useful knowledge. That being said, I can't believe Microsoft would ship a mechanism for creating a setup program with Visual Studio that didn't support automated installation of the CRT. I have not kept up with what Visual Studio supports nowadays with respect to setup wizards.
Since c++ is translated to assembly do I have to compile the source again each time I change a machine?
No, no. Assuming that your friends are all running Windows (and not, say, Linux) and have x86-based machines (which they do if they're running Windows), your code will work fine. The only hitch would be if you are compiling 64-bit code that runs on your machine, but they only have 32-bit machines. Then you'll need to have a 32-bit and 64-bit version. (Or a single 32-bit version, which will run on both.)

Compile 64 bit application in MSVC 2010

We need to compile our libraries in MSVC++ 2010 with 64 bit support.
After reading answers on this question, I still don't understand why it's necessary to change the platform toolset from "v100" to "Windows7.1SDK".
Is it necessary only for MSVC Express, or also for full MSVC version?
What does it change? And what is the risk if you don't change the toolset?
I mean, I can successfully generate 64bit binaries with default v100 toolset, what's wrong with that?
It is a hack to work around Express edition limitations, somewhat south of its license restrictions. When you have the paid edition, you simply add the x64 configuration to get a 64-bit build of your app. Use Build + Configuration manager, upper right combobox box labeled "Active Solution Platform". Pick "New" from that combobox. Pick "x64" in the popup. Done.
If "x64" doesn't appear then re-run Setup and select the option to install the 64-bit compilers.
The setting is necessary for Visual Studio 2010 Express. That doesn't come with a 64 bits compiler, so you have to tell it to use the SDK compiler. With the paid-for versions, a 64 bit compiler is included.

Compile for x64 with Visual Studio?

Question:
Assume a C++ hello world program, non .NET.
With Visual Studio 2005/2008/2010, how can I compile a 64-Bit application ?
I have a 64 Bit Windows, but by default, VS seems to compile 32 bit executables...
On Linux with g++, I can use -m32 and -m64, but how can I compile a 64 bit solution with Windows ? Is it even possible with 2005 ? Or does one need 2008 or even 2010 Beta, or even some x64 SDK ?
There is a step-by-step instructions by Microsoft: http://msdn.microsoft.com/en-us/library/9yb4317s.aspx
It sounds like it may just be that you haven't set the correct target. It is possible to also build x64 applications on an x86 using the cross compiler tools.

Visual Studio 2008 sp1 vc++ project works in 32 bit mode, but not 64 bit

I have a project that runs perfectly well under windows 7, x86 installation. On the same machine, but in a different drive, I've installed windows 7, x64, and visual studio 2008 sp1 on both.
The project compiles and runs under win32. When I try to compile the project under x64, I get nothing, and everything gets 'skipped'. Furthermore, when I try to get the properties of anything under the 64 bit version, the operation fails with an 'unspecified error'. On the 64 bit side, I can switch to the win32 build target, watch it work, and then try to switch to the x64 bit side, and then clench my teeth in frustration. If I try to do a batch build for every configuration, again, total failure unless I just do win32 projects.
I've seen this project work on someone else's machine, so I know that it works in 64 bits, but for some strange reason, this project just doesn't work for me.
I've tried to run
devenv /resetskippkgs
as per this suggestion here, but there's no love.
Any help is appreciated...
EDIT from Pavel's suggestion, I tried to run using
vcbuild /platform:x64
and I get the error:
vcbuild.exe : warning VCBLG6001: Project 'project.proj' does not support platform
'x64', or the platform support DLL for this platform is not installed.
That help? Does visual studio not automatically Do The Right thing when installed?
The solution! Posted because I lost so much time to this, and I'd hope that someone else does not similarly lose time (otherwise, I'd just delete the question).
Apparently, the visual studio 2008 installer declined to install the x64 compiler tools by default on my machine. I don't know if that's because I'm on an AMD machine and there's some question about running on that processor, or just someone made a mistake, or what, but once I checked what had been installed by visual studio, I found the glaring red 'x' indicating that the x64 compiler was not installed. ARM, yes, x64, the processor I'm using, no.
So, adding that processor option back seems to have restored the universe to its rightful place.
I was using internet based setup (everything downloaded from internet). There is also the same issue here. Everything for x64 seems to be installed but I cannot compile or check properties while I select x64 release or debug solution.
This was because .NET framework 3.5 x64 is not available for Windows XP and it will not install on your Windows XP x64. And apparently you cannot compile any x64 code if you don't have this framework.