Discussion:
Creating a 64-bit build configuration
(too old to reply)
JY
2010-03-17 08:23:01 UTC
Permalink
Hi,

I need to build a 64-bit application (and cannot use a 32-bit one with WOW64
for certain reasons).
What are the configuration options (in Project Settings) that I need to use
when building such an application. Basically, how do I create a x64
configuration?

TIA,
Jy
Ulrich Eckhardt
2010-03-17 09:04:41 UTC
Permalink
Post by JY
I need to build a 64-bit application (and cannot use a 32-bit one with
WOW64 for certain reasons).
What are the configuration options (in Project Settings) that I need to
use when building such an application. Basically, how do I create a x64
configuration?
What VC are you using? I'll assume VC8 for now, simply becaus that's what I
have here...

In the "Build" menu, there is an entry "Configuration Manager". There, you
have the solution configuration and solution platform. In the platform
dropdown, you simply select "new" and chose the according target, for which
you must have an SDK installed.

Now it gets a bit hairy: Copying the settings from an existing one or using
empty settings is both not 100% what you want, though the difference
between vanilla win32 and MS Windows CE might be greater that between win32
and win64, so YMMV. In any case, if it fails, you can also create a new
project and import the existing sources. If that worked, you can lateron
merge the two vcproj files by hand, they are just XML files.

Good luck!

Uli
--
C++ FAQ: http://parashift.com/c++-faq-lite

Sator Laser GmbH
Geschäftsführer: Thorsten Föcking, Amtsgericht Hamburg HR B62 932
Nobody
2010-03-18 20:16:18 UTC
Permalink
Post by Ulrich Eckhardt
What VC are you using?
Ditto. Also, what edition? Express, Pro, etc.

David Lowndes
2010-03-17 09:20:34 UTC
Permalink
Post by JY
I need to build a 64-bit application (and cannot use a 32-bit one with WOW64
for certain reasons).
What are the configuration options (in Project Settings) that I need to use
when building such an application. Basically, how do I create a x64
configuration?
You need to ensure you have the x64 C++ compiler installed as part of
your VS installation. If you have that you usually create a new one
based on the 32-bit one, and (if necessary) change settings such as
the Linker Target Machine setting.

Dave
JY
2010-03-18 07:31:01 UTC
Permalink
Post by David Lowndes
Post by JY
I need to build a 64-bit application (and cannot use a 32-bit one with WOW64
for certain reasons).
What are the configuration options (in Project Settings) that I need to use
when building such an application. Basically, how do I create a x64
configuration?
You need to ensure you have the x64 C++ compiler installed as part of
your VS installation. If you have that you usually create a new one
based on the 32-bit one, and (if necessary) change settings such as
the Linker Target Machine setting.
Dave
.
Other than the Linker-> Target Machine setting, are there any other things
that need to change?

I see that 'WIN32' is defined in C/C++ -> Preprocessor ->Preprocessor
definitions.
Do I need to replace that with a 'WIN64' or the like?

Thanks,
Jy
David Lowndes
2010-03-18 08:09:00 UTC
Permalink
Post by JY
I see that 'WIN32' is defined in C/C++ -> Preprocessor ->Preprocessor
definitions.
Do I need to replace that with a 'WIN64' or the like?
No leave that as is.

Checking a couple of my projects, I don't have any explicit WIN64
(or_WIN64) defined - which begs the question, how does the
configuration know to invoke the 64-bit compiler - and I have to admit
that I'm now not sure how it's done!

Dave
Alex Blekhman
2010-03-18 09:03:49 UTC
Permalink
Post by David Lowndes
Checking a couple of my projects, I don't have any explicit WIN64
(or_WIN64) defined - which begs the question, how does the
configuration know to invoke the 64-bit compiler - and I have to admit
that I'm now not sure how it's done!
Well, the IDE invokes the 64-bit compiler because you told it so by
defining x64 platform configuration. In its own turn, 64-bit compiler
always defines _WIN64 (and _WIN32 for backcompat) for the code it compiles.

Alex
David Lowndes
2010-03-18 10:09:43 UTC
Permalink
Post by Alex Blekhman
Well, the IDE invokes the 64-bit compiler because you told it so by
defining x64 platform configuration.
Perhaps I should have been a bit more specific by saying that I don't
know how the tool does that (under the hood). Presumably something in
selecting the configuration causes the IDE to use the 64-bit compiler
and tools, but I don't know the details - which is I suppose is good
in that it's just worked for me and I've never needed to find out :)

Dave
Tom Walker
2010-03-18 18:01:33 UTC
Permalink
Post by David Lowndes
Perhaps I should have been a bit more specific by saying that I don't
know how the tool does that (under the hood). Presumably something in
selecting the configuration causes the IDE to use the 64-bit compiler
and tools, but I don't know the details - which is I suppose is good
in that it's just worked for me and I've never needed to find out :)
Visual Studio find the C++ compiler, linker, etc. by searching the path
specified in:
Tool | Options | Projects and Solutions | VC++ Directories | Executable
files

The different platforms (Win32, x64, etc. ) have different executable file
paths.
David Lowndes
2010-03-18 18:32:16 UTC
Permalink
Post by Tom Walker
Post by David Lowndes
Perhaps I should have been a bit more specific by saying that I don't
know how the tool does that (under the hood). Presumably something in
selecting the configuration causes the IDE to use the 64-bit compiler
and tools, but I don't know the details - which is I suppose is good
in that it's just worked for me and I've never needed to find out :)
Visual Studio find the C++ compiler, linker, etc. by searching the path
Tool | Options | Projects and Solutions | VC++ Directories | Executable
files
The different platforms (Win32, x64, etc. ) have different executable file
paths.
Doh, of course.

I probably only ever look there once or twice a year - in order to set
up special include paths.

Age related memory loss - eek! :(

Dave
Loading...