64bit compilation with visual studio express 2013 - visual-studio-2013

I have to compile a C++ project and make it run as 64bit application to avoid the 32bit memory limitation.
My IDE is Visual Studio 2013 Express for Windows Desktop
I couldn't find a clear answer on how to do this, anybody has a solution ?

From command line, load the cross-compiler :
call %VSDIR%\VC\vcvarsall.bat x86_amd64
Open solution
%VSDIR%\Common7\IDE\WDExpress.exe solution.sln
and that's it.
The x86_amd64 switch to a compiler (which happens to be a 32bit program) that produces 64bit code instructions. So the compiler itself is bound to 2Go memory, but the resulting program does not have this limitation.

Related

Use the 64-bit Visual C++ Toolset in Visual Studio 2017

My (quite large) C++ project has grown to a point where I get a C1060: compiler is out of heap space error when trying to compile my project.
I'm compiling on a 64-bit Windows 10 machine, but it seems that Visual Studio is compiling my project with the 32-bit toolset (see screenshot below).
The C1060 help page asks me to use the 64-bit toolset, but the link provided talks about how to enable it when compiling with the command line only.
Is there any way to set project properties or something else in Visual Studio 2017 to tell it to use the 64-bit compiler toolset (which is already installed on my machine)?
This is how I made Visual Studio 2017 use the x64 toolset, as per this answer:
Open the .vcxproj file with your favourite text editor, find this line:
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
Then add this immediately after it:
<PropertyGroup>
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
</PropertyGroup>
That answer was for Visual Studio 2013 but it works for 2017 too.
Additional Note: However, it turns out this didn't actually solve my problem. The 64-bit toolset ate up all the memory on my machine and forced me to need to reboot. When I rolled back the latest changes to the code, it compiles using ~2.8GB for the 32-bit compiler, and compiles using ~4.2GB for the 64-bit compiler (the latest code consumed ~6.4GB before freezing my task manager on my 8GB machine). I'll be looking through the new code and attempting to figure out why so much more memory was needed.

My program doesn't run on other computers

So, recently I've created a program in visual studio 2010 using c++/cli. But the problem is, everytime I try to run the debug file on other computer , it just doesn't start. I tried to create another program on another computer and it worked. Can the problem be in the fact, that I have visual studio 2015 installed in this computer ? And if so, how can I fix it?
The debug build uses a different C library than the release compile does. If you want to run your program on a different machine, make sure it's the release compile, and make sure the C++ runtime redistributable is installed.
Visual Studio 2010 SP1 x86 redistributable
Visual Studio 2010 SP1 x64 redistributable

Can i open a 32 bit visual studio project in a 64 bit enviroment?

Can i open a 32 bit visual studio project in a 64 bit environment?
I am running Visual Studio on a 32 bit Windows 7 version. My question is if someone with a 64 bit Windows version can open my project.
I have the Visual Studio 2012 ultimate edition.
I use Visual Studio for web development with C#.
Yes. Visual Studio project files are not tied to CPU architecture.
Executing that project is a different matter. If the project itself is a 64-bit C++ application, you will need a 64-bit machine on which to run it, but the machine will still be able to open the project, see the files and compile it.
Yes. Any project on 32bit can be run on 64bit windows. But you cant run a 64bit project on a 32bit windows. Hope you got the answer.

What is the minimum OS for a windows console app made with Visual C++ 2010?

I've created a console application using Visual C++ 2010. What is the earliest version of windows I can run the program on? I know that it can depend on what Windows API functions that you use in the program, so I only use the following functions in my program:
GetStdHandle()
SetConsoleTextAttribute()
Everything else in the program is standard C++. I know that console applications should be able to run on very early versions of Windows, but I do not know how VC++ 2010's compilation affects the minimum operating system requirement. So, would a console application compiled on Windows Vista with Visual C++ 2010 be able to run on, say, Windows 95, ect.?
According to Can I use Visual Studio 2010's C++ compiler with Visual Studio 2008's C++ Runtime Library?, VS C++ 2010 runtime depends on features from Windows XP SP2. So, unless you do some workarounds to avoid the C++ 2010 runtime, that is the oldest version you can target.

Installing Visual Studio 2012 on x64 machine: use x64 build?

I just got my new MSDN subscription up and running, and was wondering something about when I go to install all my dev tools: Is there any specific reason I should install Visual Studio x64 over x86? I'm on an x64 machine, but I can obviously compile to any platform I want no matter what architecture VS is compiled for. I can't think of any reason VS would be using more than 4GB of RAM. Is there some sort of special case that necessitates an x64 build of VS? All I can think is maybe some game development scenarios where the debugger is dealing with huge amounts of memory at once.
Keep in mind that there is no 64-bit Visual Studio as Rico Mariani explains. That should not be a big deal because you can specify 32-bit, 64-bit or Any CPU when creating your applications in Visual Studio.

Resources