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

20040212: link problems



>From: "Serena Chew" <address@hidden>
>Organization: Desert Research Institute
>Keywords: 200402121924.i1CJOZp1017168 netCDF

Serena,

>I am writing a FORTRAN program that reads a file and then creates that =
>file into a netCDF file, then I generate a CDL file from the created =
>netCDF file using 'ncdump'. However, when I try to compile my program =
>using f77 compiler, I get this message:
>
>Undefined                       first referenced
> symbol                             in file
>nf_def_var_                         precip.new.o
>nf_strerror_                        precip.new.o
>nf_enddef_                          precip.new.o
>nf_close_                           precip.new.o
>nf_put_att_text_                    precip.new.o
>nf_put_vara_real_                   precip.new.o
>nf_create_                          precip.new.o
>nf_def_dim_                         precip.new.o
>ld: fatal: Symbol referencing errors. No output written to precip.new
>
>I have the INCLUDE 'netcdf.inc' at the beginning of the subroutine. I =
>even specified INTEGER nf_def_var, etc. CHARACTER*80 nf_strerror
>
>How do I fix this problem?

It looks like you are not including a reference to the netCDF library
in your link line.  The error being shown is saying that your module,
precip.new.o, references a number of netCDF library entry points
that can't be found by the linker.  The solution is to include the
'-L <wherever your netCDF library resides> -lnetcdf' sequence
on your compile/link line.  Of course, you must replace:

wherever your netCDF library resides

with the fully qualified directory path to the location of libnetcdf.a

>Sinicerely,
>Serena Chew

Cheers,

Tom Yoksas
--