| 1 | If you wish to build using Microsoft Visual studio, there are workspace and |
|---|
| 2 | project files in the WIN32_VS directory - just open "nexus.dsw" |
|---|
| 3 | |
|---|
| 4 | For more information see the README.TXT file in the WIN32_VS directory |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | -------------------------------------------------------------------------- |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | ************************************************************************** |
|---|
| 11 | *** below are my old notes for WIN32 compilation. These have hopefully *** |
|---|
| 12 | *** been superceded by the ones in WIN32_VS, but are left here in case *** |
|---|
| 13 | *** they are useful *** |
|---|
| 14 | ************************************************************************** |
|---|
| 15 | |
|---|
| 16 | |
|---|
| 17 | *** Notes Specific for Compilation on PC/Windows *** |
|---|
| 18 | |
|---|
| 19 | Due to the availability of different calling conventions |
|---|
| 20 | on the PC, it may be necessary to edit "napi.h" and |
|---|
| 21 | manually select the appropriate form of the MANGLE() function. |
|---|
| 22 | |
|---|
| 23 | Please refer to the "WINDOWS SPECIFIC CONFIGURATION" section of |
|---|
| 24 | "napi.h" for further instructions. |
|---|
| 25 | |
|---|
| 26 | If you get a LINK error saying the function _htons@4 is undefined, |
|---|
| 27 | add "wsock32.lib" to the list of libraries you link against |
|---|
| 28 | |
|---|
| 29 | *** Building a Dynamic Link Library (NEXUS.DLL) *** |
|---|
| 30 | |
|---|
| 31 | These instructions are for Visual Studio 97 ... later versions should |
|---|
| 32 | be similar, but menu/item names may have changed slightly |
|---|
| 33 | |
|---|
| 34 | If you wish to build "nexus.dll", you need to do the following: |
|---|
| 35 | |
|---|
| 36 | 1. Obtain the binary distribution of the HDF libraries for WinNT/95 from |
|---|
| 37 | ftp://ftp.ncsa.uiuc.edu/HDF/HDF/HDF_Current/zip/winNT95/HDF41r3.zip |
|---|
| 38 | (see http://hdf.ncsa.uiuc.edu/ for more information on HDF in general) |
|---|
| 39 | and unzip to e.g. C:\ to create e.g. C:\HDF4.1R3 |
|---|
| 40 | 2. Create a WIN32 DLL project in Visual Studio called "NEXUS" and add to it "napi.c" and "napi.h" |
|---|
| 41 | 3. Go to "Build", "Set Active Configuration" and choose "Release" rather than "Debug"; this |
|---|
| 42 | is because the above HDF binary distribution only include "Release" libraries, so |
|---|
| 43 | if you wish to use "Debug" libraries you must compile the HDF libraries yourself |
|---|
| 44 | from the supplied source |
|---|
| 45 | 4. In "Project", "Setting", "C/C++", "Preprocessor" add the following to "Preprocessor definitions" |
|---|
| 46 | |
|---|
| 47 | _HDFDLL_,NEXUS_LIBRARY |
|---|
| 48 | |
|---|
| 49 | Also in the "Additional Include directories" box put the HDF include directory e.g. |
|---|
| 50 | |
|---|
| 51 | C:\HDF4.1R3\INCLUDE |
|---|
| 52 | |
|---|
| 53 | 5. In "Project", "Setting", "C/C++" "code generation", select "Multithreaded DLL" for the "run-time library" to use |
|---|
| 54 | 6. Select "Project", "Add to project", "Files" and add the HDF DLL import libraries |
|---|
| 55 | (hd413m.lib and hm413m.lib) to the project - they are in e.g. C:\HDF4.1R3\DLLLIB |
|---|
| 56 | 7. In "Project", "Setting", "Link" add the following to the start of the "Object/library modules" line |
|---|
| 57 | |
|---|
| 58 | /nodefaultlib:"libcmt.lib" msvcrt.lib |
|---|
| 59 | |
|---|
| 60 | 8. Now build the library ... it will generate a "nexus.dll" and a "nexus.lib" file in |
|---|
| 61 | the "Release" directory. The "nexus.lib" import library contains information that is needed by |
|---|
| 62 | programs that need to link against the "nexus.dll" DLL; see "building examples" below |
|---|
| 63 | |
|---|
| 64 | *** Building the Example Programs to use NEXUS.DLL *** |
|---|
| 65 | |
|---|
| 66 | 1. Create a WIN32 console project |
|---|
| 67 | 2. Go to "Build", "Set Active Configuration" and choose "Release" rather than "Debug" |
|---|
| 68 | 3. In "Project", "Setting", "C/C++" "code generation", select "Multithreaded DLL" for the "run-time library" to use |
|---|
| 69 | 4. Select "Project" "Add to project" "Files" and add nexus.lib, hd413m.lib and hm413m.lib to the project |
|---|
| 70 | 5. In "Project", "Setting", "C/C++", "Preprocessor" add the directory for napi.h and the HDF include files |
|---|
| 71 | 6. Build |
|---|
| 72 | |
|---|
| 73 | *** Running the Example Programs with NEXUS.DLL *** |
|---|
| 74 | |
|---|
| 75 | When the example programs start running, they need be able to locate NEXUS.DLL, HD413M.DLL and HM413M.DLL |
|---|
| 76 | A quick solution is to copy these DLL files into the same directory as the program executable, |
|---|
| 77 | but as a longer term solution you may want to add a directory to the PATH environment variable |
|---|
| 78 | and put the DLL files there |
|---|
| 79 | |
|---|
| 80 | Freddie Akeroyd <Freddie.Akeroyd@rl.ac.uk> |
|---|
| 81 | ISIS Facility |
|---|
| 82 | Rutherford Appleton Laboratory |
|---|
| 83 | GB |
|---|
| 84 | |
|---|
| 85 | $Id$ |
|---|