This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
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