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

[netCDF #ORV-791255]: libsz.so.2 linking problem



Hi Matthew,

Does it work if you add "-lsz" to the end of the compile line, as in:

  cc -o test test.o -L/home/mb/netcdf/lib -L/home/mb/hdf/lib 
-L/home/mb/szip/lib -lnetcdf -lhdf5_hl -lhdf5 -lz -lsz

--Russ

> Does anybody know how I can get the libsz.so.2 file which is
> required by the error below?
> 
> I downloaded the szip stuff from
> http://hdf.ncsa.uiuc.edu/release4/obtain.html but it does not contain
> a .so.2 file, it only has .a and .la files.
> 
> The test.c program is just:
> #include <netcdf.h>
> int main ()  {
> printf("%s\n", nc_inq_libvers());
> }
> 
> root@mb-laptop:/home/mb/netcdf/mbexample# cc -c -I/home/mb/netcdf/include 
> test.c
> test.c: In function ‘main’:
> test.c:3: warning: incompatible implicit declaration of built-in
> function ‘printf’
> 
> root@mb-laptop:/home/mb/netcdf/mbexample# cc -o test test.o
> -L/home/mb/netcdf/lib -L/home/mb/hdf/lib -L/home/mb/szip/lib  -lnetcdf
> -lhdf5_hl -lhdf5 -lz
> /usr/bin/ld: warning: libsz.so.2, needed by
> /home/mb/hdf/lib/libhdf5_hl.so, not found (try using -rpath or
> -rpath-link)
> /home/mb/hdf/lib/libhdf5.so: undefined reference to `SZ_encoder_enabled'
> /home/mb/hdf/lib/libhdf5.so: undefined reference to `SZ_BufftoBuffCompress'
> /home/mb/hdf/lib/libhdf5.so: undefined reference to `SZ_BufftoBuffDecompress'
> collect2: ld returned 1 exit status
> 
> root@mb-laptop:/home/mb/netcdf/mbexample# ls -lh /home/mb/szip/lib/
> total 52K
> -rwxr-xr-x 1 mb mb 48K 2007-01-23 02:10 libsz.a
> -rwxr-xr-x 1 mb mb 775 2007-01-23 02:10 libsz.la
> 
> Thanks,
> Matthew.
> 
> 

Russ Rew                                         UCAR Unidata Program
address@hidden                     http://www.unidata.ucar.edu



Ticket Details
===================
Ticket ID: ORV-791255
Department: Support netCDF
Priority: Normal
Status: Closed