Compiling for 64-bit with VC++ 2008 Express

mikertx

Well-known member
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,
Code:
    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
 
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
 
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
 
Nocturnal said:
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
 
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 ;)
 
mikertx said:
Nocturnal said:
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.
 
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
 
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.
 
Carlos Milovic said:
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
 
Nocturnal said:
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.
 
Hi Mike,

Welcome aboard - and thanks for your opening contributions.

I am running a version of Vista64 that has NEVER had any of the MS Studio or SDK stuff loaded, so it will be a 'ceam' install as far as testing the procedure is concerned. However, I just started a major (non-astronomy-related) electronics project yesterday so I don't know when I will now get round to things. A couple of weeks, maybe.

But I will be sure to document all the steps that I needed to perform, assuming that I can follow everyone's suggestions, and assuming that a whole load of voodoo isn't needed to get everything to work together during the process :o

Thanks all.

Cheers,
 
Hello everybody. Please explain whats I doing wrong?
Code:
PixInsight Makefile Generator Script v1.5
Copyright (C) 2009 Pleiades Astrophoto

======================================================================

==> Finding files for project directory:
C:/PCL/src/modules/processes/ImageCalibration

C:/PCL/src/modules/processes/ImageCalibration/ImageCalibrationInstance.cpp
C:/PCL/src/modules/processes/ImageCalibration/ImageCalibrationInterface.cpp
C:/PCL/src/modules/processes/ImageCalibration/ImageCalibrationModule.cpp
C:/PCL/src/modules/processes/ImageCalibration/ImageCalibrationParameters.cpp
C:/PCL/src/modules/processes/ImageCalibration/ImageCalibrationProcess.cpp
C:/PCL/src/modules/processes/ImageCalibration/ImageCalibrationInstance.h
C:/PCL/src/modules/processes/ImageCalibration/ImageCalibrationInterface.h
C:/PCL/src/modules/processes/ImageCalibration/ImageCalibrationModule.h
C:/PCL/src/modules/processes/ImageCalibration/ImageCalibrationParameters.h
C:/PCL/src/modules/processes/ImageCalibration/ImageCalibrationProcess.h
C:/PCL/src/modules/processes/ImageCalibration/ImageCalibrationIcon.png
C:/PCL/src/modules/processes/ImageCalibration/graphics/ImageCalibrationIcons.svg

Source files       :     5
Header files       :     5
Resource files     :     0
Image files        :     2
Source directories :     3

==> Generating project file:
C:/PCL/src/modules/processes/ImageCalibration/windows/vc9/ImageCalibration.vcproj

MSVC 2008 Pro:
Code:
1>------ Build started: Project: ImageCalibration, Configuration: Release Win32 ------
1>Linking...
1>   Creating library Win32\Release\ImageCalibration.lib and object Win32\Release\ImageCalibration.exp
1>PCL-pxi.lib(ICCProfile.obj) : error LNK2001: unresolved external symbol __imp__cmsSetErrorHandler@4
1>PCL-pxi.lib(ICCProfile.obj) : error LNK2001: unresolved external symbol __imp__cmsCloseProfile@4
1>PCL-pxi.lib(ICCProfile.obj) : error LNK2001: unresolved external symbol __imp__cmsTakeProductDesc@4
1>PCL-pxi.lib(ICCProfile.obj) : error LNK2001: unresolved external symbol __imp__cmsOpenProfileFromMem@8
1>PCL-pxi.lib(ICCProfile.obj) : error LNK2001: unresolved external symbol __imp__cmsGetColorSpace@4
1>PCL-pxi.lib(ICCProfile.obj) : error LNK2001: unresolved external symbol __imp__cmsOpenProfileFromFile@8
1>PCL-pxi.lib(ICCProfile.obj) : error LNK2001: unresolved external symbol __imp__cmsGetDeviceClass@4
1>C:\PCL\bin\ImageCalibration-pxm.dll : fatal error LNK1120: 7 unresolved externals
1>Build log was saved at "file://c:\PCL\src\modules\processes\ImageCalibration\windows\vc9\Win32\Release\BuildLog.htm"
1>ImageCalibration - 8 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
 
Hi Nikolay,

Those errors are telling you that your project file is missing the LCMS library. Just enable the "Use the LCMS library" option on the MakefileGenerator script and all will be fine. Also please read the following bug report and its workaround as it applies to you:

http://pixinsight.com/forum/index.php?topic=1900.0

Fortunately with the next version of PCL linking against the LCMS library will no longer be necessary, as all color management functions will be implemented in the core application.

Good luck with your first PCL development adventures! ;)
 
Back
Top