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

[netCDF #LPR-530788]: Undefined reference



 > This is the source code I used to compile;
 >
 > $ ifort -O3 deform_1.f /usr/lib/libnetcdf.a -o deform
 >
 > However, when I run the source code above and some errors come out like
 this;
 >
 > /tmp/ifortAxQu9r.o(.text+0x101d): in function 'MAIN__':
 > : undefined reference to `nf_open_'
    ...

I think you also need to reference the "include" directory if your "deform_1.f"
program has an "include netcdf.inc" statment in it, so depending on where you
installed netcdf, your command line should look something like:

  $ ifort -O3 -I/usr/include deform_1.f /usr/lib/libnetcdf.a -o deform

If you have a "use" staement referring to an installed netCDF module such as
netcdf.mod for the Fortran-90 interface, you will also need to indicate to
ifort where to find that, possible with a "-M" argument.

--Russ

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



Ticket Details
===================
Ticket ID: LPR-530788
Department: Support netCDF
Priority: Normal
Status: Closed