1===============================================================================
2===============================================================================
3= NOTE:  This is the old version of the README.win32 file that was distributed
4= with CFITSIO up until version 3.35 in 2013.  These instruction may still work
5= with more recent versions of CFITSIO, however, users are strongly urged to
6= use the CMake procedures that are now documented in the new README.win32 file.
7===============================================================================
8===============================================================================
9
10     Instructions on using CFITSIO on Windows platforms for C programmers
11
12These instructions use a simple DOS-style command window. It is also possible
13to build and use CFITSIO within a GUI programming environment such as Visual
14Studio, but this is not supported here.
15
16===============================================================================
171.  Build the CFITSIO dll library
18
19This step will create the cfitsio.def, cfitsio.dll, and cfitsio.lib files.
20(If you downloaded the CFITSIO .zip file that contains the pre-built binary
21.dll file, then SKIP THIS STEP).
22
23  A. With Microsoft Visual C++:
24
25      1. Open a DOS command window and execute the vcvars32.bat file that
26         is distributed with older versions of Visual C++, or simply open
27         the Visual C++ command window (e.g., when using Visual Studio 2010).
28
29      2. Unpack the CFITSIO source files (cfitxxxx.zip) into a new empty directory
30
31      3. In the DOS command window, cd to that directory and enter the
32         following commands:
33
34		nmake winDumpExts.mak
35		nmake makefile.vcc
36			(ignore the compiler warning messages)
37
38  B: With  Borland C++:
39
40     First, follow the instructions provided by Borland to set up
41     the proper environment variables and configure files for the compiler.
42
43     Unpack the cfitsio.zip source file distribution into a suitable directory.
44
45     In a DOS command window, cd to that directory and then execute the
46     makepc.bat batch file on the command line to build the CFITSIO library,
47     and the testprog and cookbook sample programs.
48
49===============================================================================
502.  Test the CFITSIO library with Visual C++
51
52     Compile and link the testprog.c test program.  When using Visual Studio,
53     the command is:
54
55		cl /MD testprog.c cfitsio.lib
56
57
58     This will create the testprog.exe executable program.  Running this
59     program should print out a long series of diagnostic messages
60     that should end with "Status = 0; OK - no error"
61
62===============================================================================
633.  Compile and link an application program that calls CFITSIO routines
64    with Visual C++
65
66	Include the fitsio.h and longnam.h header files in the C source code.
67
68	Link the program with the cfitsio.lib file:
69
70		cl /MD your_program.c cfitsio.lib
71
72
73	NOTE: The /MD command line switch must be specified on the cl
74	command line to force the compiler/linker to use the
75	appropriete runtime library.   If this switch is omitted, then
76	the fits_report_error function in CFITSIO will likely crash.
77
78	When building programs in the Visual Studio environment, one
79	can force the equivalent of the /MD switch by selecting
80	'Settings...' under the 'Project' menu, then click on the C/C++
81	tab and select the 'Code Generator' category.  Then under 'User
82	Run-time Library' select 'Multithreaded DLL'.
83
84