undefined reference using netcdf library

Yair suari yairsuari at gmail.com
Fri Feb 2 08:10:40 MST 2007


i dont think its finding the library but when i look at the netcdf.a  (using
nm command) i can see the functions which could not be found.
during my googling i found two things related to such problems one has
something to do with added underscore to function names during compilation
and the other with the -i switch but i could stil not solve the problem.
thanks alot for your help
yair

On 2/2/07, Jeff Whitaker <jswhit at fastmail.fm> wrote:
>
> Yair Suari wrote:
> > Jeff thanks for your help
> > I tried to link the compiler to the netcdf.mod file but it did not help
> > (before I had a link to that file in the compiling folder)
> > The massages I get are not from not seeing netcdf.mod
> > I did see people use the -I switch but did not understand where do they
> > point it to.
> > Thanks again
> > yair
> >
> > -----Original Message-----
> > From: Jeff Whitaker [mailto:jswhit at fastmail.fm]
> > Sent: Thursday, February 01, 2007 5:47 AM
> > To: Yair suari
> > Cc: netcdfgroup at unidata.ucar.edu
> > Subject: Re: undefined reference using netcdf library
> >
> > Yair suari wrote:
> >
> >> i an a new user to netcdf,unix,fortran so this will probably be easy
> >> to most of you but i cant get to start using the netcdf interface.
> >> when trying to compile i get the following massages:
> >>
> >> yair at yairsuari:~/fortran/cdfdata$ ifort create.f90 -g -o create.o
> >> /tmp/ifortmAdSAz.o: In function
> >> `cdfcreate':/home/yair/fortran/cdfdata/create.f90:5: undefined
> >> reference to `netcdf_mp_nf90_create_'
> >> /tmp/ifortmAdSAz.o: In function
> >> `handle_err':/home/yair/fortran/cdfdata/create.f90:12: undefined
> >> reference to `netcdf_mp_nf90_strerror_'
> >>
> >> i am using ubuntu (debian based linux) on x86 machine and intel
> >> fortran compiler 9.1
> >>
> >> when googling around for this i saw a similar problem created when
> >> using a different compiler for your programs and for the netcdf
> >> compilation but this is not the case, i have always used intel.
> >>
> >> please HELP
> >> yair
> >>
> >> --
> >> Yair Suari
> >> Hamafteach 23 Michmoret Israel 40297
> >> Phone-0528-524520, 09-8664245
> >>
> >
> > Yair:  You need to use pass ifort (or any fortran compiler) the location
> > of 'netcdf.mod', via '-I/path/to/module' and the library via
> > '-L/path/to/netcdf/library -lnetcdf'.
> >
> > -Jeff
> >
> >
>
> Yair:  What about the -L flag?  It must not be finding the library then.
>
> -Jeff
>
> --
> Jeffrey S. Whitaker         Phone : (303)497-6313
> NOAA/OAR/CDC  R/PSD1        FAX   : (303)497-6449
> 325 Broadway                Boulder, CO, USA 80305-3328
>
>


-- 
Yair Suari
Hamafteach 23 Michmoret Israel 40297
Phone-0528-524520, 09-8664245


More information about the netcdfgroup mailing list