Author Topic: Compiling for 64-bit with VC++ 2008 Express  (Read 23863 times)

Offline Mike Reid

  • Newcomer
  • Posts: 47
    • Mike's Astro
Compiling for 64-bit with VC++ 2008 Express
« on: 2010 May 08 00:00:11 »
I thought it best to start a new thread for this instead of leaving it buried in the StarStatistics/ReadPSF thread since it's more broadly useful.

I got 64-bit compiles working under Visual C++ 2008 Express Edition running on my 64-bit Windows 7 PC.

I'm going to summarize the process here for the benefit of others but I can't claim credit.  I just pieced it together from a few websites (listed at the end).

PROCEDURE

(1) Download and install,
    Microsoft Visual C++ 2008 Express Edition
    http://www.microsoft.com/express/downloads/#2008-Visual-CPP


(2) Download and install,
    Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 SP1
    http://www.microsoft.com/downloads/details.aspx?FamilyID=c17ba869-9671-4330-a63e-1fd44e0e2505&displaylang=en


(3) Microsoft has a website that is supposed to tell you how to enable 64-bit compiles by installing the SDK but it doesn't work.  In step 5 of their procedure it says to select 64-bit platform from the drop down list but it's not there.  Steps (4) and (5) below are necessary to get it working.
    http://msdn.microsoft.com/en-us/library/9yb4317s.aspx


(4) Register the v7.0 SDK as the system default.
    Run the "Windows SDK Configuration Tool", select v7.0 and click "Make Current".


(5) Run a cmd shell with Administrator privilege and run these command,

    regedit /s x64\VC_OBJECTS_PLATFORM_INFO.reg
    regedit /s x64\600dd186-2429-11d7-8bf6-00b0d03daa06.reg
    regedit /s x64\600dd187-2429-11d7-8bf6-00b0d03daa06.reg
    regedit /s x64\600dd188-2429-11d7-8bf6-00b0d03daa06.reg
    regedit /s x64\600dd189-2429-11d7-8bf6-00b0d03daa06.reg
    regedit /s x64\656d875f-2429-11d7-8bf6-00b0d03daa06.reg
    regedit /s x64\656d8760-2429-11d7-8bf6-00b0d03daa06.reg
    regedit /s x64\656d8763-2429-11d7-8bf6-00b0d03daa06.reg
    regedit /s x64\656d8766-2429-11d7-8bf6-00b0d03daa06.reg
    copy "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcpackages\AMD64.VCPlatform.config" "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcpackages\AMD64.VCPlatform.Express.config"
    copy "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcpackages\Itanium.VCPlatform.config" "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcpackages\Itanium.VCPlatform.Express.config"


After this I was able to follow the procedure in Microsofts webpage listed in step (3) and enable 64-bit compiles.  I successfully compiled Carlos' StarStatistics class and ReadPSF process module and tested them in 64-bit PI.


REFERENCES

    http://jenshuebel.wordpress.com/2009/02/12/visual-c-2008-express-edition-and-64-bit-targets/
    http://www.cppblog.com/xcpp/archive/2009/09/09/vc2008express_64bit_win7sdk.html
    http://msdn.microsoft.com/en-us/library/9yb4317s.aspx
    http://blogs.msdn.com/deeptanshuv/archive/2006/04/11/573795.aspx


Mike

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
Re: Compiling for 64-bit with VC++ 2008 Express
« Reply #1 on: 2010 May 08 06:33:53 »
Good stuff. I have the Enterprise edition but this will come in handy.
Best,

    Sander
---
Edge HD 1100
QHY-8 for imaging, IMG0H mono for guiding, video cameras for occulations
ASI224, QHY5L-IIc
HyperStar3
WO-M110ED+FR-III/TRF-2008
Takahashi EM-400
PIxInsight, DeepSkyStacker, PHD, Nebulosity

Offline budguinn

  • PixInsight Addict
  • ***
  • Posts: 106
Re: Compiling for 64-bit with VC++ 2008 Express
« Reply #2 on: 2010 May 08 06:54:24 »
Hi Mike,

is this pretty much the same for Vista Ultimate?
thanks Mike, I have the
    Microsoft Visual C++ 2008 Express Edition
and am now installing the SDK.

Can the command entries corrupt anything?...other programs?

and I'll probably have a few more questions.
This should make it nice to give some of the beta things that they are coming up with...a good trial.

bud
« Last Edit: 2010 May 08 07:12:15 by budguinn »

Offline budguinn

  • PixInsight Addict
  • ***
  • Posts: 106
Re: Compiling for 64-bit with VC++ 2008 Express
« Reply #3 on: 2010 May 08 07:35:54 »
Hi Mike,

Reading the release notes it looks like it should work on Vista.

So, now to figure out how to load everything into the VC++Express and define it as a project.
(a quick tutorial would be nice)

but first......GOLF....it is Saturday.

Oh, wait a minute....I'm retired, and every day is Saturday.

bud

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
Re: Compiling for 64-bit with VC++ 2008 Express
« Reply #4 on: 2010 May 08 08:17:22 »
Why are you guys fiddling with PCL? Got any exciting modules you plan to write?
Best,

    Sander
---
Edge HD 1100
QHY-8 for imaging, IMG0H mono for guiding, video cameras for occulations
ASI224, QHY5L-IIc
HyperStar3
WO-M110ED+FR-III/TRF-2008
Takahashi EM-400
PIxInsight, DeepSkyStacker, PHD, Nebulosity

Offline Mike Reid

  • Newcomer
  • Posts: 47
    • Mike's Astro
Re: Compiling for 64-bit with VC++ 2008 Express
« Reply #5 on: 2010 May 08 10:45:18 »
Why are you guys fiddling with PCL? Got any exciting modules you plan to write?

I wanted to try out Carlos' StarStatistics stuff and I just kinda got sucked into it.  No good reason really.

Mike

Offline Carlos Milovic

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2172
  • Join the dark side... we have cookies
    • http://www.astrophoto.cl
Re: Compiling for 64-bit with VC++ 2008 Express
« Reply #6 on: 2010 May 08 13:14:42 »
Thanks Mike for that info!!! I'm going to try this right now.

Bud, projects are generated by the "MakefileGenerator" script (under Script>Development). Run it, fill with the directory and project name, and then it will create those MSVC project files (as long with makefiles for linux and macos). Double click the project file and you are ready.
Just remember to define all environment variables before running the script, or it won't launch.

About the ReadPSF/StarStatistics pair... I'll work on a major change tomorrow. Anyway, I would love to hear comparisons between the current outputs (with both StarStatistics releases) with other softwares (don't pay attention to the intensity... this was not declared properly; just centroid coordinates and std deviations or fwhm).
I'm going to generate a test image, with artificial stars, and a list with the parameters used. This way, anyone wanting to change the code, and test the results, will have a standard reference to compare.


BTW. Wellcome aboard PCL programming ;) Even just for compiling and testing beta code, it is a start for future development projects ;)
Regards,

Carlos Milovic F.
--------------------------------
PixInsight Project Developer
http://www.pixinsight.com

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
Re: Compiling for 64-bit with VC++ 2008 Express
« Reply #7 on: 2010 May 08 14:23:49 »
Why are you guys fiddling with PCL? Got any exciting modules you plan to write?

I wanted to try out Carlos' StarStatistics stuff and I just kinda got sucked into it.  No good reason really.

Mike

Well that's an excellent reason :) I figured Carlos would provide at least windows binaries for his modules as he did in the past though.
Best,

    Sander
---
Edge HD 1100
QHY-8 for imaging, IMG0H mono for guiding, video cameras for occulations
ASI224, QHY5L-IIc
HyperStar3
WO-M110ED+FR-III/TRF-2008
Takahashi EM-400
PIxInsight, DeepSkyStacker, PHD, Nebulosity

Offline Carlos Milovic

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2172
  • Join the dark side... we have cookies
    • http://www.astrophoto.cl
Re: Compiling for 64-bit with VC++ 2008 Express
« Reply #8 on: 2010 May 08 17:10:27 »
I got stuck at the fourth step... it says that I don't have Visual Studio 2005 or 2008...
Regards,

Carlos Milovic F.
--------------------------------
PixInsight Project Developer
http://www.pixinsight.com

Offline Carlos Milovic

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2172
  • Join the dark side... we have cookies
    • http://www.astrophoto.cl
Re: Compiling for 64-bit with VC++ 2008 Express
« Reply #9 on: 2010 May 08 17:36:39 »
seems I solved by launching the command UI, and manually checking the system registry. :P Now launching MSVC :D cross your fingers!!!
Regards,

Carlos Milovic F.
--------------------------------
PixInsight Project Developer
http://www.pixinsight.com

Offline Carlos Milovic

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2172
  • Join the dark side... we have cookies
    • http://www.astrophoto.cl
Re: Compiling for 64-bit with VC++ 2008 Express
« Reply #10 on: 2010 May 08 17:45:47 »
Yes! After a short struggle, it submitted and now compiles! :D :D :D
Regards,

Carlos Milovic F.
--------------------------------
PixInsight Project Developer
http://www.pixinsight.com

Offline Mike Reid

  • Newcomer
  • Posts: 47
    • Mike's Astro
Re: Compiling for 64-bit with VC++ 2008 Express
« Reply #11 on: 2010 May 08 17:49:45 »
Carlos,

Interesting, it looks like this step might have worked for me because of my previous installation of Visual Studio 2005.  Try setting the default version with the command line tool like so,

1.       Launch the Windows SDK Command Window (Start, All Programs, Microsoft Windows SDK v7.0, Command Window)
2.       Type:  WindowsSdkVer.exe -version:v7.0

If this works we'll update my recipe.

Mike

Offline Carlos Milovic

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2172
  • Join the dark side... we have cookies
    • http://www.astrophoto.cl
Re: Compiling for 64-bit with VC++ 2008 Express
« Reply #12 on: 2010 May 08 17:55:57 »
Hi Mike

I had to did it the hard way... but now it works :) Thanks. I'm going to put this thread sticky, so it won't be missed by others.
Regards,

Carlos Milovic F.
--------------------------------
PixInsight Project Developer
http://www.pixinsight.com

Offline Mike Reid

  • Newcomer
  • Posts: 47
    • Mike's Astro
Re: Compiling for 64-bit with VC++ 2008 Express
« Reply #13 on: 2010 May 08 17:59:06 »
Hi Mike

I had to did it the hard way... but now it works :) Thanks. I'm going to put this thread sticky, so it won't be missed by others.

Great!  I'm glad it worked.

Mike

Offline budguinn

  • PixInsight Addict
  • ***
  • Posts: 106
Re: Compiling for 64-bit with VC++ 2008 Express
« Reply #14 on: 2010 May 08 18:36:39 »
Why are you guys fiddling with PCL? Got any exciting modules you plan to write?

Hi Sander,

I just want to be able to help beta test some of the stuff......and I like fooling with it.....but I don't think I ever want to learn the stuff that Mike and Nikolay seem to have devoted their lives to........I'm a very humble auto mechanic and that is tough enough for me.