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

Re: 20000712: linux f77 undefined references (fwd)



------- Forwarded Message

Date:    Thu, 13 Jul 2000 14:30:04 -0400
From:    Edward Colon <address@hidden>
To:      Russ Rew <address@hidden>
Subject: Re: 20000712: linux f77 undefined references 

>To: Russ Rew <address@hidden>
>From: Edward Colon <address@hidden>
>Subject: Re: 20000712: linux f77 undefined references
>Keywords: 200007121602.e6CG2hT11473

...

> > which indicates that he netCDF entry points
> > nf_create__ and nf_close__ are not being found during the link. So I have 
> > tried to link the netcdf fortran libary explicitly using the compile 
> > statement
> > 
> > f77 -L/home/ecolon/epic/netcdf/lib/libnetcdf.a simple.f 
> > 
> > but this did not help and I received the same compiler errors. I
> > would greatly appreciate any assistance you can offer.
> 
> The above f77 line won't find the library because you have the library
> specification BEFORE the Fortran source-file.  Switch them and either
> just provide the library explicitly (without the -L which takes a
> directory argument):
> 
>   f77 simple.f /home/ecolon/epic/netcdf/lib/libnetcdf.a
> 
> or use the -L option with the directory and a -l option for the
> library name:
> 
>   f77 simple.f -L/home/ecolon/epic/netcdf/lib -lnetcdf
> 
> This might solve the first problem too.  You shouldn't have to add the
> netCDF library directory to your LD_LIBRARY_PATH to link executables
> with it.  
> 
> One way to see how to link executables is to go to the src/ directory
> of the original netCDF distribution after it has been compiled with
> "make all", delete a few of the executables such as fortran/nftest,
> and then try "make test" to see how the test program gets rebuilt and
> linked.
> 
> --Russ
> 


Thank you very much. I tended to place my links before the fortran code in
the compile statement when I used DEC fortran and the habit carried over.
That fixed the problem.





------- End of Forwarded Message