source: trunk/README.WIN32 @ 1822

Revision 185, 3.9 KB checked in by faa, 10 years ago (diff)

Add comment about wsock32.lib

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1If you wish to build using Microsoft Visual studio, there are workspace and
2project files in the WIN32_VS directory - just open "nexus.dsw"
3
4For 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
19Due to the availability of different calling conventions
20on the PC, it may be necessary to edit "napi.h" and
21manually select the appropriate form of the MANGLE() function.
22
23Please refer to the "WINDOWS SPECIFIC CONFIGURATION" section of
24"napi.h" for further instructions.
25
26If you get a LINK error saying the function _htons@4 is undefined,
27add "wsock32.lib" to the list of libraries you link against
28
29*** Building a Dynamic Link Library (NEXUS.DLL) ***
30
31These instructions are for Visual Studio 97 ... later versions should
32be similar, but menu/item names may have changed slightly
33
34If you wish to build "nexus.dll", you need to do the following:
35
361. 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
402. Create a WIN32 DLL project in Visual Studio called "NEXUS" and add to it "napi.c" and "napi.h"
413. 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
454. 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
535. In "Project", "Setting", "C/C++" "code generation", select "Multithreaded DLL" for the "run-time library" to use
546. 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
567. In "Project", "Setting", "Link" add the following to the start of the "Object/library modules" line
57
58        /nodefaultlib:"libcmt.lib" msvcrt.lib
59
608. 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
661. Create a WIN32 console project
672. Go to "Build", "Set Active Configuration" and choose "Release" rather than "Debug"
683. In "Project", "Setting", "C/C++" "code generation", select "Multithreaded DLL" for the "run-time library" to use
694. Select "Project" "Add to project" "Files" and add nexus.lib, hd413m.lib and hm413m.lib to the project
705. In "Project", "Setting", "C/C++", "Preprocessor" add the directory for napi.h and the HDF include files
716. Build
72
73*** Running the Example Programs with NEXUS.DLL ***
74
75When the example programs start running, they need be able to locate NEXUS.DLL, HD413M.DLL and HM413M.DLL
76A quick solution is to copy these DLL files into the same directory as the program executable,
77but as a longer term solution you may want to add a directory to the PATH environment variable
78and put the DLL files there
79
80Freddie Akeroyd <Freddie.Akeroyd@rl.ac.uk>
81ISIS Facility
82Rutherford Appleton Laboratory
83GB
84
85$Id$
Note: See TracBrowser for help on using the repository browser.