Can gFortran Link Against Cygwin netCDF Library?

John Kim
Mon Nov 24 21:59:00 GMT 2014


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 library, like this:

   gfortran *.o libfortran.a -L"/cygdrive/c/Program Files (x86)/netCDF" -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....



Problem reports:
Unsubscribe info:

More information about the Cygwin mailing list