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

[netCDF #GSR-922703]: netCDF General - Corrupt or Old Module file netcdf.mod



> 
> 
> -----Original Message-----
> From: Unidata netCDF Support
> [mailto:address@hidden]
> Sent: Monday, September 11, 2006 8:50 AM
> To: Dai,Mingrui [CIS]
> Cc: address@hidden
> Subject: [netCDF #GSR-922703]: netCDF General - Corrupt or Old Module
> file netcdf.mod
> 
> Hi Ed,
> 
> Thanks for the reply. I compiled my program like this:
> Pgf90 -c mytest.f
> Pgf90 -lnetcdf -o mytest.e mytest.o
> 
> Then I got the undefined reference to 'netcdf_nf90_open_' error.
> 
> I searched the archives on your site, and found someone put the -inetcdf
> at the very end. I tried and found that it works. It is weird, but I am
> happy I can get what I want.
> 
> Thanks,
> 
> Mingrui
> 

Yes, you must put the code that uses the library before the library on the link 
command line.

That's because when it encounters "-lnetcdf" it takes all the functions that it 
has seen that you want to use. If you have -lnetcdf first, then it doesn't 
think you want to use any functions from it.

GOod luck and keep on netCDFing!

Ed Hartnett

Ticket Details
===================
Ticket ID: GSR-922703
Department: Support netCDF
Priority: Normal
Status: Closed