 
COMPILING A PROGRAM
                  
Following are instructions for compiling an application program on the 
window XP, using the pgstk library that we provide 
or you build HDF4 and HDF5.  

In general, you compile your program as shown below.  

C or Fortran program on Windows XP:
----------------------------------------

1. Using Microsoft Visual Studio .net 2003 or newer for C program.
   Using a Visual Fortran compiler for Fortran program.
	Note: in the following we assume that MS Visual Studio is
      installed in F:\Program Files\Microsoft Visual Studio .NET 2003
	directory.

2. Set up environment variable "PGSHOME"
       in "Control Panel" double clich on "System". In the "System Properties" window
		select "Advanced". Click "Environment Variables" and enter the new variable
	 	name as PGSHOME and value as <top-level PGSTK directory> may be F:\PGSTKHOME
   
	You may have done this also by Opening autoexec.bat file (if it exist)
		and adding 1 line at the end of file

	       Set PGSHOME=<top-level PGSTK directory>\TOOLKIT_MTD

	       where <top-level PGSTK directory> may be something like 
		 F:\PGSTKHOME if you have F:\PGSTKHOME as the parent directory
		 for  TOOLKIT_MTD directory.

3. Run MS Visual Studio. Select File -> New -> Project
   	Create a win32 project by selecting Win32 under "Visual C++ Projects" 
	and Win32Project under "Templates". Enter name for the project. The 
	project will be created in the directory shown in "Location:"

4. In the "Solution Explorer window remove all source and header files and add 
	your source code name by right clicking on "Source Files" -> Add -> "Add Existing Item.."and under TOOLKIT_MTD/test/test_MET or 
	then find the source fiule that you want to add in in the popped up window.
	Do the same for adding needed header files under " Header Files"
	Save the project by selecting File -> Save All

5. Under Tools-> Options-> Project", select "VC++ Directories".
            Under "Show directories for", select "Include files".

     No fortran support:
         Add the following directories:

            F:\Program Files\Microsoft Visual Studio\VC7\include
		F:\Program Files\Microsoft Visual Studio\SDK\v1.1\include
            <top-level HDF4 directory>\include
            <top-level HDF5 directory>\include
		<top-level jpeg>\include  or <top-level jpeg> if *.h files are there.
		<top-level zlib>\include
		<top-level szip>\include
		<top-level hdfeos5>\include
		<top-level hdfeos >\include
		<top-level hdfeos >\gctp\include
            <top-level PGSTK directory>\TOOLKIT_MTD\include 
            <top-level PGSTK directory>\TOOLKIT_MTD\include\CUC 
            <top-level PGSTK directory>\dev
 
     With Fortran support:
         Add the following directories:
		Add additional include directory corresponding to Fortran
		Compiler.

6. Under Tools-> Options-> Project", select "VC++ Directories".
            Under "Show directories for", select  "Library files".

     No fortran support:
         Add the following directories:
		F:\Program Files\Microsoft Visual Studio\Vc7\PlatformSDK\Lib
            F:\Program Files\Microsoft Visual Studio\VC7\lib
		F:\Program Files\Microsoft Visual Studio\SDK\v1.1\lib
            <top-level HDF4 directory>\release\lib
            <top-level HDF4 directory>\release\dll
            <top-level HDF5 directory>\release\lib
            <top-level HDF5 directory>\release\dll
		<top-level jpeg>\lib  or <top-level jpeg> where *.lib files are.
		<top-level zlib>\lib
		<top-level szip>\lib
		<top-level szip>\dll
		<top-level hdfeos5>\lib
		<top-level hdfeos >\lib
            <top-level PGSTK directory>\TOOLKIT_MTD\lib\nt_98
 		<top-level PGSTK directory>\dev\PGSTK\Release
	You may need also to include the following directories:
		F:\WINDOWS\system32
		F:\WINDOWS
		F:\WINDOWS\system32\wbem

    With Fortran support:
         Add the following directories:
		Add additional include directory corresponding to Fortran
		Compiler.

            where 
	    	<top-level PGSTK directory> may be
	    	F:\TOOLKIT_MTD5.2.19\with_Fortran\pgstk5.2.19r1full
	    	<top-level HDF4 directory> may be F:\4210-win\4210-win
	    	<top-level HDF5 directory> may be F:\5-1812-win\5-1812-win
	    	<top-level szip> may be F:\zlib128-windows
	    	<top-level hdfeos5> may be F:\hdfeos5_1_15b\hdfeos5
	    	<top-level hdfeos > may be F:\hdfeos2_19b\hdfeos
	    	<top-level szip> may be F:\szip21-win-xp-enc
	    	<top-level jpeg> may be F:\jpeg-6b


7. Under Project -> Properties Select "C/C++" --> Adavaced
		select "Compile as" and choose "Compile as C Code (/TC)" for
		C code compilation.

	Under Project -> Properties Select "Linker" --> Input Add the following
		libraries to the "Additional Dependencies" list:
		ws2_32.lib pgstk.lib hd4210.lib hm4210.lib libjpeg.lib zdll.lib 
		szlib.lib hdf5.lib

	Depending on the type of application some of the libraries may not be needed.
 
   	The following libraries may (or may not) need to be included: 
       	kernel32.lib user32.lib gdi32.lib winspool.lib comdig32.lib
       	advapi32lib shell32.lib ole32.lib oleaut32.lib uuid.lib
       	odbc32.lib odbccp32.lib
	Also under Project -> Properties Select "Linker" --> Advanced
		you may (or may not) need to add "main" to the "Entry Point" box.

8. Under Project -> Properties Select "C/C++" --> "Preprocessor" 
	and add "INTEL86,VISUAL_CPLUSPLUS" to "Preprocessor definitions" 
	if they do not show up in the list.
      	Add the following if they are not already there: WIN32,_CONSOLE
	
	build the Release version of the TOOLKIT_MTD library by selecting:
	Build -> <project Name>, then Build -> Project only -> Link

NOTE:
=========

Please note that when editing the filetable.temp for any application 
(as directed in the MTD_TOOLKIT Users Guide for setting the path of the files) 
one should use "\", instead of "/", in the directory structure for windows
applications such as:

10100|LogStatus|C:\PGSTKHOME\TOOLKIT_MTD\runtime\LogStatus
