Discussion:
How to change the default project type to x64?
(too old to reply)
JiiPee
2016-01-22 15:34:09 UTC
Permalink
If I start a new project, it gives by default 32 bit project. I can
change it from the combobox after, but how can I get so that all project
are by default 64 bit projects, x64?
Geoff
2016-01-25 02:30:08 UTC
Permalink
Post by JiiPee
If I start a new project, it gives by default 32 bit project. I can
change it from the combobox after, but how can I get so that all project
are by default 64 bit projects, x64?
Close all instances of Visual Studio.
Explore Visual Studio folder under "Program Files (x86)"

Make a backup copy of VC\VCWizards\default.vcxproj

Edit:
VC\VCWizards\default.vcxproj

Change all "Win32" to "x64"

Now all your new projects will be x64.
JiiPee
2016-01-26 20:47:04 UTC
Permalink
Post by Geoff
Post by JiiPee
If I start a new project, it gives by default 32 bit project. I can
change it from the combobox after, but how can I get so that all project
are by default 64 bit projects, x64?
Close all instances of Visual Studio.
Explore Visual Studio folder under "Program Files (x86)"
Make a backup copy of VC\VCWizards\default.vcxproj
VC\VCWizards\default.vcxproj
Change all "Win32" to "x64"
Now all your new projects will be x64.
All... but does that prevent using Win32 (86) then? I would like to have
both there (in the selection combobox) but x64 as a first choice and
default for projects. I do not want to totally delete Win32/86
Geoff
2016-01-27 06:35:17 UTC
Permalink
Post by JiiPee
Post by Geoff
Post by JiiPee
If I start a new project, it gives by default 32 bit project. I can
change it from the combobox after, but how can I get so that all project
are by default 64 bit projects, x64?
Close all instances of Visual Studio.
Explore Visual Studio folder under "Program Files (x86)"
Make a backup copy of VC\VCWizards\default.vcxproj
VC\VCWizards\default.vcxproj
Change all "Win32" to "x64"
Now all your new projects will be x64.
All... but does that prevent using Win32 (86) then? I would like to have
both there (in the selection combobox) but x64 as a first choice and
default for projects. I do not want to totally delete Win32/86
No, you'll have an x64 platform from which you can later create a
Win32 platform target. This is exactly the converse of starting with
Win32 and creating an x64 with the configuration manager.
JiiPee
2016-01-27 12:58:56 UTC
Permalink
Post by Geoff
Post by JiiPee
Post by Geoff
Post by JiiPee
If I start a new project, it gives by default 32 bit project. I can
change it from the combobox after, but how can I get so that all project
are by default 64 bit projects, x64?
Close all instances of Visual Studio.
Explore Visual Studio folder under "Program Files (x86)"
Make a backup copy of VC\VCWizards\default.vcxproj
VC\VCWizards\default.vcxproj
Change all "Win32" to "x64"
Now all your new projects will be x64.
All... but does that prevent using Win32 (86) then? I would like to have
both there (in the selection combobox) but x64 as a first choice and
default for projects. I do not want to totally delete Win32/86
No, you'll have an x64 platform from which you can later create a
Win32 platform target. This is exactly the converse of starting with
Win32 and creating an x64 with the configuration manager.
oh ok, so after that I have to just add Win32 manually and it becomes
the second choice.
To be honest, imo this should be a tick in the settings to easily select
the default type.
Stephen Wolstenholme
2016-01-27 14:00:34 UTC
Permalink
Post by JiiPee
Post by Geoff
Post by JiiPee
Post by Geoff
Post by JiiPee
If I start a new project, it gives by default 32 bit project. I can
change it from the combobox after, but how can I get so that all project
are by default 64 bit projects, x64?
Close all instances of Visual Studio.
Explore Visual Studio folder under "Program Files (x86)"
Make a backup copy of VC\VCWizards\default.vcxproj
VC\VCWizards\default.vcxproj
Change all "Win32" to "x64"
Now all your new projects will be x64.
All... but does that prevent using Win32 (86) then? I would like to have
both there (in the selection combobox) but x64 as a first choice and
default for projects. I do not want to totally delete Win32/86
No, you'll have an x64 platform from which you can later create a
Win32 platform target. This is exactly the converse of starting with
Win32 and creating an x64 with the configuration manager.
oh ok, so after that I have to just add Win32 manually and it becomes
the second choice.
To be honest, imo this should be a tick in the settings to easily select
the default type.
I set things up to create x64 applications. After resolving all the
pointer warnings and timer errors I got it to build. I then discovered
that most of my users could not run it. The ones that could found it
was slower than the 32 bit version. I decided to revert to Win32 for
another few years.

Steve
--
Neural Network Software for Windows http://www.npsnn.com
JiiPee
2016-01-27 14:17:42 UTC
Permalink
Post by Stephen Wolstenholme
Post by JiiPee
oh ok, so after that I have to just add Win32 manually and it
becomes the second choice. To be honest, imo this should be a tick
in the settings to easily select the default type.
I set things up to create x64 applications. After resolving all the
pointer warnings and timer errors I got it to build. I then discovered
that most of my users could not run it. The ones that could found it
was slower than the 32 bit version. I decided to revert to Win32 for
another few years.
maybe there was still some 32 bit stuff not properly converted to 64
bit? thats why it did not work?
Stephen Wolstenholme
2016-01-27 15:32:13 UTC
Permalink
Post by JiiPee
Post by Stephen Wolstenholme
Post by JiiPee
oh ok, so after that I have to just add Win32 manually and it
becomes the second choice. To be honest, imo this should be a tick
in the settings to easily select the default type.
I set things up to create x64 applications. After resolving all the
pointer warnings and timer errors I got it to build. I then discovered
that most of my users could not run it. The ones that could found it
was slower than the 32 bit version. I decided to revert to Win32 for
another few years.
maybe there was still some 32 bit stuff not properly converted to 64
bit? thats why it did not work?
Not very likely as it is all in one executable with no drivers, dlls
and such. It did work once I had fixed all the pointer warnings and
WM_TIMER errors. The show stopper was it would not run reliably on
user platforms and even when it worked there was no speed advantage.
Another stopper for me is the price of the upgrade!

Steve
--
Neural Network Software for Windows http://www.npsnn.com
JiiPee
2016-01-27 14:19:25 UTC
Permalink
this

http://www.npsnn.com

is your company?
Stephen Wolstenholme
2016-01-27 15:33:25 UTC
Permalink
Post by Stephen Wolstenholme
this
http://www.npsnn.com
is your company?
Yes.
--
Neural Network Software for Windows http://www.npsnn.com
Gunnar
2016-01-28 16:31:07 UTC
Permalink
Steve,

Price of the upgrade? Given that VS2015 community edition is free, not sure what that could mean.

I'm also confused why you thought it would speed up? The good reason to provide a 64 bit version of your software would be if you have customers using 64bit machines that would like to access more than 2 GB of memory.
Geoff
2016-01-28 05:13:55 UTC
Permalink
On Wed, 27 Jan 2016 14:00:34 +0000, Stephen Wolstenholme
Post by Stephen Wolstenholme
Post by JiiPee
Post by Geoff
Post by JiiPee
Post by Geoff
Post by JiiPee
If I start a new project, it gives by default 32 bit project. I can
change it from the combobox after, but how can I get so that all project
are by default 64 bit projects, x64?
Close all instances of Visual Studio.
Explore Visual Studio folder under "Program Files (x86)"
Make a backup copy of VC\VCWizards\default.vcxproj
VC\VCWizards\default.vcxproj
Change all "Win32" to "x64"
Now all your new projects will be x64.
All... but does that prevent using Win32 (86) then? I would like to have
both there (in the selection combobox) but x64 as a first choice and
default for projects. I do not want to totally delete Win32/86
No, you'll have an x64 platform from which you can later create a
Win32 platform target. This is exactly the converse of starting with
Win32 and creating an x64 with the configuration manager.
oh ok, so after that I have to just add Win32 manually and it becomes
the second choice.
To be honest, imo this should be a tick in the settings to easily select
the default type.
I set things up to create x64 applications. After resolving all the
pointer warnings and timer errors I got it to build. I then discovered
that most of my users could not run it. The ones that could found it
was slower than the 32 bit version. I decided to revert to Win32 for
another few years.
Steve
I suppose there are all kinds of architectural reasons why an x64 app
might be slower than the same code targeted to Win32. Just memory
access for a 64 bit pointer on a 32-bit optimized motherboard would
slow the thing down and if the upper 32 bits of that pointer are
unused, it's wasted bus cycles.

Advantages
Use and access more then 2GiB of virtual memory

Access to more CPU registers (but this is transparent in compiled
code) the compiler might have more freedom to optimize.

Systems running your application should support SSE2 (and something
like 99.89% support also SSE3)

SSE2 automatic optimizations by visual studio.

Disadvantages

Some legacy 3rd party libraries simply don't support x64

Pointers are 64 bit length instead of 32 (more memory needed and
potential issues with bad coding, for example, storing pointer values
into integers or vice versa)

Portability issues (LLP64 vs LP64)

Not providing a 32-bit build, you restrict your user base but this is
less of an issue these days as more users upgrade their hardware.

When migrating from Win32 to x64 you should have good reasons to do
so, the need for larger objects or memory space for your data being
primary, if you're only using 2GB at a time you don't need the extra
cycles. If the system itself chokes with swapping because it can't
support your heavy resource usage, you impaired your application.

Measure and test, prove the change was worth it. Specify the minimum
platform requirements for the x64 version vs the Win32.
JiiPee
2016-02-12 10:07:26 UTC
Permalink
I tried this and it does give only x64 projects after that. If I try to
add a Win32 project after that it only remain in that project but does
not remain there if I start a new project (then only x64 is there). How
to add Win32 after this globally?
Post by Geoff
Post by JiiPee
If I start a new project, it gives by default 32 bit project. I can
change it from the combobox after, but how can I get so that all project
are by default 64 bit projects, x64?
Close all instances of Visual Studio.
Explore Visual Studio folder under "Program Files (x86)"
Make a backup copy of VC\VCWizards\default.vcxproj
VC\VCWizards\default.vcxproj
Change all "Win32" to "x64"
Now all your new projects will be x64.
Geoff
2016-02-13 16:32:26 UTC
Permalink
Post by JiiPee
I tried this and it does give only x64 projects after that. If I try to
add a Win32 project after that it only remain in that project but does
not remain there if I start a new project (then only x64 is there). How
to add Win32 after this globally?
Post by Geoff
Post by JiiPee
If I start a new project, it gives by default 32 bit project. I can
change it from the combobox after, but how can I get so that all project
are by default 64 bit projects, x64?
Close all instances of Visual Studio.
Explore Visual Studio folder under "Program Files (x86)"
Make a backup copy of VC\VCWizards\default.vcxproj
VC\VCWizards\default.vcxproj
Change all "Win32" to "x64"
Now all your new projects will be x64.
In the default.vcxproj file, change:

<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>

to read:

<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>

This will create both x86 and x64 configurations at creation of the
project. There may be some other edits you'll need to perform in this
file but I'm sure you can figure it out.

VS2015 does this out of the box.
JiiPee
2016-02-15 00:47:06 UTC
Permalink
Post by Geoff
Post by JiiPee
I tried this and it does give only x64 projects after that. If I try to
add a Win32 project after that it only remain in that project but does
not remain there if I start a new project (then only x64 is there). How
to add Win32 after this globally?
Post by Geoff
Post by JiiPee
If I start a new project, it gives by default 32 bit project. I can
change it from the combobox after, but how can I get so that all project
are by default 64 bit projects, x64?
Close all instances of Visual Studio.
Explore Visual Studio folder under "Program Files (x86)"
Make a backup copy of VC\VCWizards\default.vcxproj
VC\VCWizards\default.vcxproj
Change all "Win32" to "x64"
Now all your new projects will be x64.
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
This will create both x86 and x64 configurations at creation of the
project. There may be some other edits you'll need to perform in this
file but I'm sure you can figure it out.
VS2015 does this out of the box.
Yes I know, and out of the box there are both. But the issue is that
win32 is selected to be the *default* of these two. Meaning, if I create
a new project and compile it straight away, it will be win32
application. I have to manually change it to x64 to get x64. But I would
like this to be the other way around, as I always do x64 nowadays...
Gunnar
2016-02-13 13:54:47 UTC
Permalink
Post by JiiPee
If I start a new project, it gives by default 32 bit project. I can
change it from the combobox after, but how can I get so that all project
are by default 64 bit projects, x64?
JiiPee,

Simple procedure:

a) VS2015->Configuration Manager
b) For the project in question, click on Platform drop down
c) Select "New"
d) Select x64, copy settings from win32, uncheck "Create new sln platforms"

You will now have a 64bit build config.
JiiPee
2016-02-13 16:17:22 UTC
Permalink
Post by Gunnar
Post by JiiPee
If I start a new project, it gives by default 32 bit project. I can
change it from the combobox after, but how can I get so that all project
are by default 64 bit projects, x64?
JiiPee,
a) VS2015->Configuration Manager
b) For the project in question, click on Platform drop down
c) Select "New"
d) Select x64, copy settings from win32, uncheck "Create new sln platforms"
You will now have a 64bit build config.
I know, but the question was that how can we get this *globally* set in
VS so that in a new project x64 is selected by default.
Continue reading on narkive:
Loading...