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

[netCDF #JZG-184834]: netCDF linking probelm: undefined reference to `check_'


It appears that your file, saver.f90, invokes a function, 'check_', that is not 
defined.  This is not part of the netCDF libraries, so I'm afraid I can't 
provide additional information.  It might be helpful if you're able to contact 
the maintainer of the software you are trying to link using libnetcdff, they 
might be able to provide additional information.

I'm sorry I can't provide more immediately useful help,


> Hi,
> I am using Ubuntu 18.04 and I have netCDF-Fortran 4.5.2 installed.
> I am trying to compile a fortran program using the make file:
> FC = gfortran
> FFLAGS = -c -O3 -mcmodel=medium -g -I/usr/local/include
> FLINK = -O3 -mcmodel=medium -g -L/usr/local/lib -lnetcdff -lnetcdf -lnetcdf
> -ldl -lm
> LINKER = $(FC) -o
> OBJS = initializer.o swe_rk4.o main.o parameters.o saver.o
> model:$(PROG)
> # Creates the model
> $(PROG):$(OBJS)
> @echo "-------------------------------------"
> @echo "Creating the executable for the model"
> @echo "-------------------------------------"
> I get the following error message during linking:
> saver.o: In function `data_saver_':
> /home/surya/Fortran/learnFortran/newPractice/shallowWaterEquations/src/saver.f90:53:
> undefined reference to `check_'
> /home/surya/Fortran/learnFortran/newPractice/shallowWaterEquations/src/saver.f90:57:
> undefined reference to `check_'
> /home/surya/Fortran/learnFortran/newPractice/shallowWaterEquations/src/saver.f90:58:
> undefined reference to `check_'
> /home/surya/Fortran/learnFortran/newPractice/shallowWaterEquations/src/saver.f90:59:
> undefined reference to `check_'
> /home/surya/Fortran/learnFortran/newPractice/shallowWaterEquations/src/saver.f90:62:
> undefined reference to `check_'
> saver.o:/home/surya/Fortran/learnFortran/newPractice/shallowWaterEquations/src/saver.f90:63:
> more undefined references to `check_' follow
> collect2: error: ld returned 1 exit status
> I tried compiling the program with the flags -Wl,-rpath suggested in
> https://www.unidata.ucar.edu/software/netcdf/docs/building_netcdf_fortran.html
> but the error still exists.
> I followed the same procedure provided in the above link for installing
> netCDF and the installation was successful. For you information, I am
> attaching the config.log file in this email.
> I am using Windows Subsystem for Linux (WSL) for accessing Ubuntu in a
> Windows system.
> Could you please help me overcome this problem?
> I am looking forward to hearing from you
> --
> Regards
> *Surya Bharathi Thangavelu*
> (MSc cand.) Power Engineering
> TU Munich
> Germany

Ticket Details
Ticket ID: JZG-184834
Department: Support netCDF
Priority: Normal
Status: Closed
NOTE: All email exchanges with Unidata User Support are recorded in the Unidata 
inquiry tracking system and then made publicly available through the web.  If 
you do not want to have your interactions made available in this way, you must 
let us know in each email you send to us.