[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 20021120: link error under Windows 2000



>To: address@hidden
>From: Jon Scott Pendergrass <address@hidden>
>Subject: link error under Windows 2000
>Organization: UCAR/Unidata
>Keywords: 200211202009.gAKK9w419839

Hi John,

Sorry to take so long to reply to your question, I'm just catching up
with email after being away from it for a week.

> I'm trying to use netCDF in my C++ application under Windows 2000. I 
> took the source of  cxx\example.cpp and made "main" into a function. I 
> added the header files and libraries (netcdf.lib and netcdf.dll) to my 
> MS Visual C++ project.
> 
> I get the following link errors when I try to make my executable. It 
> looks like the libraries are not being found, even though they're in the 
> same directory as my *.dsp, *.dsw and source files.
> 
> Suggestions?
> ...
>
> Linking...
> NetCDF.obj : error LNK2001: unresolved external symbol "public: unsigned 
> int __thiscall NcVar::put(float const *,long const *)" 
> (?put@NcVar@@QAEIPBMPBJ@Z)
> NetCDF.obj : error LNK2001: unresolved external symbol "public: long * 
> __thiscall NcVar::edges(void)const " (?edges@NcVar@@QBEPAJXZ)
> NetCDF.obj : error LNK2001: unresolved external symbol "public: unsigned 
> int __thiscall NcVar::put(char const *,long,long,long,long,long)" 
> (?put@NcVar@@QAEIPBDJJJJJ@Z)
 ...

You haven't said what version of netCDF you are using or where you got
the libraries.  Did you compile from source, or are you using the
pre-built Win32 binaries from 

  ftp://ftp.unidata.ucar.edu/pub/netcdf/contrib/win32/netcdf-3.5.0.win32bin.zip

If the latter, then those did not include the C++ interface, just the
C and Fortran-77 interfaces, so that would explain the problem you are
seeing.  If you compiled from source, you would need to explicitly
compile the C++ interface and include it when you make the .dll.  We
have only compiled the C++ interface on Unix platforms, and can't help
much with building it on Windows, but if you decide to do that, a more
nearly standard-conforming C++ interface is available in this source
distribution:

  ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-3.5.1-beta5.tar.Z

If you succeed in building the C++ interface, please let us know.
Thanks.

--Russ

_____________________________________________________________________

Russ Rew                                         UCAR Unidata Program
address@hidden                     http://www.unidata.ucar.edu