Preparing to build GIS software using Visual C++ Express Edition 2008 and OSGeo4W components

Материал из GIS-Lab
Перейти к навигации Перейти к поиску
Эта страница опубликована в основном списке статей сайта
по адресу http://gis-lab.info/qa/build-env-eng.html


Initial setup of build environment.

This tutotial shows how to perform initial setup of the build environment and prepare for building GIS software on Windows XP Professional with Microsoft Visual C++ 2008 Express Edition using dependencies from OSGeo4W. Tutorial partially based on Florian Hillen post.

Microsoft Visual C++ 2008 Express Edition и Microsoft Platform SDK for Windows Server 2003 R2

Installing Microsoft Visual C++ 2008 Express

Download Microsoft Visual C++ 2008 Express installer: http://www.microsoft.com/express/download.The installation works by itself; MSDN and SQL Server isn't necessary.

Installing Microsoft Platform SDK for Windows Server 2003 R2

Download Microsoft Platform SDK for Windows Server 2003 R2 installer: http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=0baf2b35-c656-4969-ace8-e4c0c0716adb

Depending on the system type, choose relevant file out of these:

  • PSDK-amd64.exe
  • PSDK-ia64.exe
  • PSDK-x86.exe

During the installation please necessarily choose the standard directory and choose the following options:

Configuration Options
	+ Register Environmental Variables (Yes)
Microsoft Windows Core SDK
	+ Tools (Yes)
		+ Tools (AMD 64 Bit) (No unless this applies)
		+ Tools (Intel 64 Bit) (No unless this applies)
	+ Build Environment
		+ Build Environment (AMD 64 Bit) (No unless this applies)
		+ Build Environment (Intel 64 Bit) (No unless this applies)
		+ Build Environment (x86 32 Bit) (Yes)
	+ Documentation (No)
	+ Redistributable Components (Yes)
	+ Sample Code (No)
	+ Source Code (No)
		+ AMD 64 Source (No)
		+ Intel 64 Source (No)
Microsoft Web Workshop (Yes)
	+ Build Environment (Yes)
	+ Documentation (No)
	+ Sample Code (No)
	+ Tools (No)
Microsoft Internet Information Server (IIS) SDK (No)
Microsoft Data Access Services (MDAC) SDK (Yes)
	+ Tools
		+ Tools (AMD 64 Bit) (No)
		+ Tools (AMD 64 Bit) (No)
		+ Tools (x86 32 Bit) (Yes)
	+ Build Environment
		+ Tools (AMD 64 Bit) (No)
		+ Tools (AMD 64 Bit) (No)
		+ Tools (x86 32 Bit) (Yes)
	+ Documentation (No)
	+ Sample Code (No)
Microsoft Installer SDK (No)
Microsoft Table PC SDK (No)
Microsoft Windows Management Instrumentation (No)
Microsoft DirectShow SDK (No)
Microsoft Media Services SDK (No)
Debuggin Tools for Windows (Yes)

It is not recommended to install newer version of the SDK — Windows SDK for Windows Server 2008 and .NET Framework 3.5.

Configure Visual Studio

Open Microsoft Visual C++ Express and set following in "Tools → Options → Projects and Solutions → VC++ Directories" (IMPORTANT! We assume that OSGeo4W will be installed in default directory C:\OSGeo4W. If you install it in another directory please correct necessary path accordingly):

Vce-compile-01.gif
 Executable files
 c:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Bin
 
 Include files
 C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include
 C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include\atl
 C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include\mfc
 
 Library files
 c:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib\

Now you can close Microsoft Visual C++ Express an change to the following directory: C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools.

Edit the file vsvars32.bat and add the following lines after the last lines who starts with "@set":

@set PATH=C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Bin;%PATH%
@set INCLUDE=C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include;%INCLUDE%
@set INCLUDE=C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include\mfc;%INCLUDE%
@set LIB=C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib;%LIB%
@set LIB=%LIB%;C:\OSGeo4W\lib

Also check and create if necessary following environment variables:

 INCLUDE
 C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include\.
 
 LIB
 C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib\.
 
 LIB_DIR
 C:\OSGeo4W
 
 PATH
 C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Bin\.;C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Bin\WinNT\.;C:\Program Files\Microsoft Visual Studio 9.0\VC\bin;C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE;C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools;C:\OSGeo4W\bin

That's all. In some cases additional configuration required and this described in appropriate articles.

Additional links