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

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

sluijten
Posts: 44
Joined: Wed Apr 13, 2011 12:43 pm

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

Post by sluijten »

Tried this a while ago, it doesn't work for me, probably because it's meant for the 2008 version
Sven
Posts: 4052
Joined: Thu May 15, 2008 9:57 pm
Location: Berlin, Germany
Full name: Sven Schüle

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

Post by Sven »

sluijten wrote:Tried this a while ago, it doesn't work for me, probably because it's meant for the 2008 version
In fact it seems that most or all of the registry keys mentioned in the document linked to above are not present for VS 2010 Express.

I have no further idea at the moment.

Sven
sluijten
Posts: 44
Joined: Wed Apr 13, 2011 12:43 pm

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

Post by sluijten »

I have also posted this in the MSDN VC++ forum, hopefully we'll get an answer from there.
TonyJH
Posts: 183
Joined: Tue Jun 20, 2006 4:41 am
Location: USA

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

Post by TonyJH »

TonyJH wrote:These steps seemed to work for me with MSVC++ 2010 Express. (I think 2008 and 2005 versions work differently.)

1. Install "Visual C++ 2010 Express"
2. Install "Microsoft Windows SDK 7.1"
3. In your VC++ Project, go to "Properties" > "Configuration Properties" > "General" and change "Platform Toolset" from the default "v100" to "Windows7.1SDK".
4. In the configuration manager for your project, you should be able to add a new platform "x64". Details here: http://msdn.microsoft.com/en-us/library/9yb4317s.aspx
I'm not an expert so I don't know if this will help. Just in case anything I did differently matters at all, since x64 target works for me, some other things I did besides the steps I mentioned above:

I created my project as a new project from existing code: File -> New -> Project from Existing Code
Then I chose nearly all default options for creating the project.
Project type set to console application project.
I haven't been using the Debug configurations, just Release. I only added x64 for Release.
brianr
Posts: 536
Joined: Thu Mar 09, 2006 3:01 pm

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

Post by brianr »

This works for the 2008 MSVC Express Edition (plus the SDK), but might also work for 2010:

http://social.msdn.microsoft.com/forums ... 124152801/

Tools -> Options -> Projects and Solutions -> VC++ Directories

Make new paths at the begin of the list:

Executable files:
$(VCInstallDir)bin\x86_amd64

Library files:
$(VCInstallDir)lib\amd64
$(WindowsSdkDir)\lib\x64

To swith back to x86 code generation just move these lines to the end of the directories list. Unfortunately the Express Edition does not allow using of Win64 platform in your projects, so you may add a configuration only.

Project option for x64 builds:

Linker -> Advanced -> Target Machine : MachineX64 (/MACHINE:X64)

Using these modifications Visual Studio will call x64 cross compilers from Windows SDK
Sven
Posts: 4052
Joined: Thu May 15, 2008 9:57 pm
Location: Berlin, Germany
Full name: Sven Schüle

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

Post by Sven »

The link above does not help here, unfortunately, for VS 2010 Express.
VC++ Directories editing in Tools > Options has been deprecrated.

VC++ Directories are now available as a user property sheet that is added by default to all projects. Please click '?' for more information.
But the property sheets remain empty, that's the main problem, see posts above.

There must be a dam*** way ...

Sven
User avatar
Desperado
Posts: 879
Joined: Mon Dec 15, 2008 11:45 am

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

Post by Desperado »

Because i was curious what is going on with vs 2010 i googled in the morning what can go wrong and found sth. intersting about problems
with service packs and win7 sdk. (unfortunatelly i cannot find the site
again :( )

But it was about problems with the installation order of the service packs
and the win7 sdk. the SPs seem to delete c++ compiler and other components!!

So the last 30 minutes i tried to find the link with no success, but 2 other
sites which may help to fix the problem...

http://blog.kalmbach-software.de/de/ ... (german)

http://www.microsoft.com/downloads/en/d ... 547e637b70

Although it refers not to the express editions, the problem might
also occur there. hope it helps, or at least gives a good direction what to try next.

Michael

(edit...maybe you look first at this...)
http://msdn.microsoft.com/en-us/visualc/gg697159
sluijten
Posts: 44
Joined: Wed Apr 13, 2011 12:43 pm

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

Post by sluijten »

Problem solved.
I can target for x64 from Visual Studio 2010 Express.
It seems to be an issue with Visual Studio 2010 Service Pack 1.
I uninstalled SP1 and reinstalled (not repair!) Windows SDK 7.1
See this link for more info.
Repairing the SDK will not install missing components, that's why you have to re-install SDK.
Microsoft was advicing to buy the VS Pro version, because express does not support 64 bit ($1200, LOL)