hello everybody welcome to a tutorial
that I probably should have done a long
long time ago and sorry if any viewers
were confused by my first x64 and C++
tutorial people that were using Visual
Studio Express simply didn't have the
option to change to x64 and at that time
I had Visual Studio Pro installed so
that's why I had that option but I
wanted to make a tutorial to go through
the exact steps to get Visual C++ 2010
Express up and running in 64 bits it's
not too difficult once you know what you
don't so we'll just run through it
step-by-step I'm using a virtual machine
here just to make sure that I've got
nothing extra installed it's got a few
things on there's got c-sharp Express
but and that's not gonna make a
difference
pretty much what we want to do is after
you've installed Visual C++ 2010 Express
you want to get the windows 7 SDK for
net 4 I'm actually downloading this as
we speak and I'm recording this a little
out of order but let's just close that
down so this is what I typed into Google
anyway Windows 7 SDK for net 4 and it
was the top result there so this one
here this is the one that we're after
version 7.1 and yeah just download that
and double click it to run it and you
should be right alright so I'll cut
there I think ok so this is the Windows
7 SDK version 7.1 I think and you've got
heaps of options here for different
components to install but the most
important one that we're looking for is
this one here the Visual C++ compilers
and this is what includes the x64
compiler and it also includes Masum I
believe or ML 64 the 64 bit version of
Masum so make sure that that's checked
and I'm not sure which of the others you
need
but if you just leave it on the default
you should be fine or you can probably
uncheck some of these things like the
Microsoft help system or you know some
things that you know you don't need
anyway I'm gonna leave it on default in
just go next click Next to begin your
install ya off you go okay so this is
going to take a while okay
so I'll finish downloading took a really
long time let's see uh yeah that thing
the dotnet framework or whatever it is
he uh no sorry the Windows 7 SDK
okay so we'll run Visual C++ Express and
we'll make a new project empty project
thanks might call it Troy why not okay
so I don't like the Explorer over there
I'll put it over here and I put my
toolbox over here that's irrelevant
okay so let's add a new add a new item
and we'll make it a C++ file I'll just
call it main this would be pretty much
exactly what we did in the first shoot
so include iostream and using namespace
STD main a couple of those things
returns zero and see apps stop sup sup
awesome said get value Oh awesome
okay so that's basically what we had in
the original tutorial I think to get
value from Assam isn't written yet and
at the moment we've got a 32-bit program
so I might do this in well the order
does matter actually so one of the first
things that you should do is add your
build customization so Masum the masam
target stop props and we click okay and
next you can change your project over to
64 bits so let's see the configuration
manager just there or you can go up to
project and you can't has it gone no I
don't know that's there okay so you can
right-click on your solution as well I
don't know I usually go through here so
we click configuration manager and after
you've installed that SDK if you go here
and new in the active solution platform
you should see Itanium and x64 if you
don't see that there's something wrong
and I don't know what the problem is but
you know you'll have to reinstall visual
c plus plus 2010 Express or reinstall
the SDK I don't know but I didn't even
reset after after installing that SDK
and Visual C++ 2010 I didn't do any
reset or anything so you know that's not
the problem
leave that on win32 copy settings from
and leave the create new project
platforms checked you know then we close
and now we might add our prototype so X
times C int get value on awesome
okay so we're compiling 64 bits now and
we've got our build customizations set
up we want to add our assembly file so
if we just go in to add a new item and
we select the C++ file but down the
bottom we give it the dot 8sm extension
awesome - awesome
okay and let's go code and get the value
from awesome it's a prop ret over time
get going on awesome and P and the
procedure and the file and I'm here all
we've got to do is mold our ax some
value will say 23 783 good number wonder
if its prime okay so then if we hit run
don't show this dialog again we do like
the bill yes the builders build it it's
in say something about kernel32 okay
there we go there we go a fatal error
I don't know what kernel32 is well as it
happens Visual C + + 2010 Express I know
we're kernel32 is what's happened is
that the library paths aren't set up
properly for 64-bit compiles in Visual
C++ Express they were set up properly in
Visual Studio Pro but all we got to do
pretty much is tell C++ 2010 Express
where kernel32 Lube is and we do that by
going into project and once called Troy
properties but yours be whatever you
whatever you named it now we come to
configuration properties if we come down
a bit you'll see linker over here linker
and one of these options here is
additional library directories so this
is additional directories that you want
a visual studio to look into find your
library files and this file to stare
kernel32 dot Lib that's that's the
Windows kernel that's a library file um
yeah a library file with all of the sort
of standard functions at window
uses so if we click on the little
drop-down icon there and then we click
Edit we click on the new folder button
and then you click dot to browse and
it's probably going to be in the same
place on your machine as it is on mine
if you didn't change the install
directory for your Windows 7 SDK it will
be on the C Drive and Program Files
Microsoft SDKs Windows V 7.1 and Lib and
then x64 you don't to go into ia-64
that's the Itanium library I think but
x64 so once you've chosen that directory
you should be able to click select
folder then click OK and click apply and
finally ok ok so now in addition to
wherever Visual Studio was looking for
library director files it's also going
to look in that directory and there is
something really confusing about this
file just here kernel32 Lib there's a
32-bit version of this file and it's
also a 64-bit version of this file but
get this they called exactly the same
thing so that kernel32 that we just
selected in the x64 directory is
actually the 64-bit kernel 32 Lib and if
you get them confused
the program won't compile so make sure
you've selected the x64 kernel32 lib
anyway actually I might add something
that yeah let's not let's just run it ok
yeah I should have added something and
see you get King yet just to stop the
window from closing there we go there we
see folks 27 23 783 so that
is hopefully helpful to people using
Visual Studio Express and sorry it took
me so long to get this up but I hope now
you can follow the rest of the tutorial
series it's almost exactly the same
setup as what I'm doing in the tutorial
series from here on in the only
difference is that you'll also have to
specify where kernel32 dot live is okay
good stuff well thank you for listening
and good luck with it all folks
adios