Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

Previous: Building the DLL with Visual Cplusplus NET, Up: Windows



4.5 Using netcdf.dll with VC++.NET

Load-time linking to the DLL is the most straightforward from C++. This means the netcdf.lib file has to end up on the compile command line. This being Windows, that's hidden by a GUI.

In Visual Studio 2003 this can be done by modifying three of the project's properties.

Open the project properties window from the project menu. Go to the linker folder and look at the general properties. Modify the property “Additional Library Directories” by adding the directory which contains the netcdf.dll and netcdf.lib files. Now go to the linker input properties and set the property “Additional Dependencies” to netcdf.lib.

Finally, still within the project properties window, go to the C/C++ folder, and look at the general properties. Modify “Additional Include Directories” to add the directory with the netcdf.h file.

Now use the netCDF functions in your C++ code. Of course any C or C++ file that wants to use the functions will need:

     #include <netcdf.h>
 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Office of Programs University Corporation for Atmospheric Research (UCAR)   Unidata is a member of the UCAR Office of Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690