Error In Encoding

Submitted by aviparde07 on Tue, 10/13/2020 - 07:42

I am running a sample code for encoding .BUFR file with command :

$ ifort -c encode_temperature.f90
$ ifort -o encodeT.exe encode_temperature.o -L -libbufr_i4r8.a

but the following error is coming
encode_temperature.o: In function `MAIN__':
encode_temperature.f90.text+0x108): undefined reference to `openbf_'
encode_temperature.f90.text+0x123): undefined reference to `openmb_'
encode_temperature.f90.text+0x159): undefined reference to `ufbint_'
encode_temperature.f90.text+0x169): undefined reference to `writsb_'
encode_temperature.f90.text+0x175): undefined reference to `closmg_'
encode_temperature.f90.text+0x181): undefined reference to `closbf_'

 
 

The problem comes from that the bufr library is not linked correctly. Here is an example to link the library:

ifort -o encodeT.exe encode_temperature.o -L../lib –lbufr_i4r8

Note: Need BUFR library under directory ./lib/libbufr_i4r8.a Use same compiler to compile BUFR lib and encode_temperature.f90