Page 1 of 1

Setting up MS Visual C++ Express to target for 64-bit (x64)

PostPosted: 22 Apr 2011, 14:43
by wing
Haven't been able to set up MSVC++ Express to target for x64.
I installed all updates, including .Net Framework 4, and searched internet for more info on the error I keep getting:

The "ConfigurationGeneral" rule is missing from the project.

Win32 works OK.
Is there a way to download a C++ compiler that targets x64, and then use it from within the MSVC++ Express environment?

Re: Setting up MS Visual C++ Express to target for 64-bit (x

PostPosted: 22 Apr 2011, 22:13
by Dann Corbit

Re: Setting up MS Visual C++ Express to target for 64-bit (x

PostPosted: 23 Apr 2011, 00:41
by wing
Dann,
Thanks for helping. I know the post and tried it before, and get following message after selecting Windows7.1SDK as Platform Toolset:
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\Microsoft.Cpp.Win32.Targets(153,5): error : Required file "" is missing.
Probably need to find a forum where this belongs, it's not chess-related...
Stef

Re: Setting up MS Visual C++ Express to target for 64-bit (x

PostPosted: 26 Apr 2011, 12:28
by Kirill Kryukov
Hello, wing.

The simplest way to use 64-bit version of MS C/C++ compiler is this: Download and install the SDK, then use the compiler from the command line. Wrap it in a batch file, makefile, or another script of your choice. Also you'll need that script to set a proper environment. Example batch file:

Code: Select all
@call "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.Cmd" /Release /x64 /vista 2>nul
@cl.exe /nologo /Ot /Ox /Oi /Oy /Ob2 /MT /Foobj\4x4c_msvc_x64.obj /c /Tcsrc\solver.c
@cl.exe /nologo /Fe4x4c_msvc_x64.exe obj\4x4c_msvc_x64.obj

The luxury of calling the compiler from within the source editor is, IMHO, unnecessary. It may be possible to configure the most IDEs for this, but I prefer to know exactly what compiler and options are being used, to be in control, and to have no dependences on an IDE. I can easily switch an editor and not spend a minute thinking about compilation options or paths, as they will remain in the same batch file. For a large project you may prefer makefiles.

One good point of this approach is that it allows you to easily integrate another compiler (or several) into your building and testing workflow. For example it's good idea to keep compiling your code with GCC, to make sure you are not writing something unportable, also GCC gives some nice warnings.