This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Can gFortran Link Against Cygwin netCDF 4.3.1.1 Library?


On 11/24/2014 10:28 PM, John Kim wrote:
Hi,

I have a C program that uses a custom Fortran library and the netCDF
API. I'm trying to link the C and Fortran object files with the Cygwin
netCDF 4.3.1.1. library, like this:

    gfortran *.o libfortran.a -L"/cygdrive/c/Program Files (x86)/netCDF
4.3.1.1/lib" -lnetcdf

But it says "undefined reference" to all the netcdf API functions. The
netCDF installation I have is from the Cygwin Setup.exe installer. Do
I need to compile the netCDF source in a special way to make it
visible to the gfortran linker? Compiling netCDF is a major task so I
thought I'd ask before I give that a try....

Thanks,

-John


Questions:
1)  C API or Fortran API for NetCDF ?

2)  Have you installed libnetcdf-devel package and
    libnetcdf-fortran-devel ?

3)  why -L"/cygdrive/c/Program Files (x86)/netCDF 4.3.1.1/lib" ?
    The latest cygwin libnetcdf-devel package is 4.3.2-2
    and its library is:

    $ cygcheck -l libnetcdf-devel |grep dll
    /usr/lib/libnetcdf.dll.a



Regards
Marco



--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]