# HDF-4.2.11 compile issue

**URL:** <https://forum.hdfgroup.org/t/hdf-4-2-11-compile-issue/11997>\
**Category:** HDF4\
**Created:** [February 5, 2024, 12:02pm UTC](https://forum.hdfgroup.org/t/hdf-4-2-11-compile-issue/11997 "2024-02-05T12:02:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![luolina1992](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/l/977dab/32.png) [@luolina1992](https://forum.hdfgroup.org/u/luolina1992)\
**Post date:** [February 5, 2024, 12:02pm UTC](https://forum.hdfgroup.org/t/hdf-4-2-11-compile-issue/11997/1 "2024-02-05T12:02:16Z")

</div>

When I compiled the HDF-4.2.11 and also the 4.2.14 and 4.2.15 versions, after successfully configuration, I failed the make step with the same problem related to ‘xdf’ and could not find a method to fix this.  
libtool: link: ar cru .libs/libxdr.a xdr.o xdrfloat.o xdrstdio.o xdrarray.o  
libtool: link: ranlib .libs/libxdr.a  
libtool: link: ( cd “.libs” && rm -f “libxdr.la” && ln -s “…/libxdr.la” “libxdr.la” )  
/opt/share/gcc/4.9.4/bin/gcc -DHAVE\_CONFIG\_H -I. -I…/…/hdf/src -I…/…/hdf/src -I/opt/share/jpeg/include -I/opt/share/zlib-1.2.11/include -I/opt/share/jpeg/include -I/opt/share/szip-2.1.1/include -I/opt/share/zlib-1.2.11/include -I/opt/share/jpeg/include -DSWAP -O3 -fomit-frame-pointer -MT xdrtest.o -MD -MP -MF .deps/xdrtest.Tpo -c -o xdrtest.o xdrtest.c  
mv -f .deps/xdrtest.Tpo .deps/xdrtest.Po  
/bin/sh …/…/libtool --tag=CC --mode=link /opt/share/gcc/4.9.4/bin/gcc -O3 -fomit-frame-pointer -L/opt/share/jpeg/lib -L/opt/share/zlib-1.2.11/lib -L/opt/share/szip-2.1.1/lib -L/opt/share/zlib-1.2.11/lib -L/opt/share/jpeg/lib -o xdrtest xdrtest.o -ljpeg -lz  
libtool: link: /opt/share/gcc/4.9.4/bin/gcc -O3 -fomit-frame-pointer -o xdrtest xdrtest.o -L/opt/share/jpeg/lib -L/opt/share/zlib-1.2.11/lib -L/opt/share/szip-2.1.1/lib /opt/share/jpeg/lib/libjpeg.so -lz -Wl,-rpath -Wl,/opt/share/jpeg/lib -Wl,-rpath -Wl,/opt/share/jpeg/lib  
xdrtest.o: In function `main': xdrtest.c:(.text.startup+0x83): undefined reference to `xdrstdio\_create’  
xdrtest.c:(.text.startup+0xd1): undefined reference to `xdr_opaque' xdrtest.c:(.text.startup+0x163): undefined reference to `xdr\_opaque’  
xdrtest.c:(.text.startup+0x18e): undefined reference to `xdr_int' xdrtest.c:(.text.startup+0x1a2): undefined reference to `xdr\_vector’  
xdrtest.c:(.text.startup+0x219): undefined reference to `xdr_u_int' xdrtest.c:(.text.startup+0x22d): undefined reference to `xdr\_vector’  
xdrtest.c:(.text.startup+0x2a8): undefined reference to `xdr_long' xdrtest.c:(.text.startup+0x31f): undefined reference to `xdr\_long’  
xdrtest.c:(.text.startup+0x333): undefined reference to `xdr_vector' xdrtest.c:(.text.startup+0x3aa): undefined reference to `xdr\_u\_long’  
xdrtest.c:(.text.startup+0x3be): undefined reference to `xdr_vector' xdrtest.c:(.text.startup+0x435): undefined reference to `xdr\_float’  
xdrtest.c:(.text.startup+0x449): undefined reference to `xdr_vector' xdrtest.c:(.text.startup+0x4c0): undefined reference to `xdr\_double’  
xdrtest.c:(.text.startup+0x4d4): undefined reference to `xdr_vector' xdrtest.c:(.text.startup+0x514): undefined reference to `xdr\_enum’  
xdrtest.c:(.text.startup+0x528): undefined reference to `xdr_vector' xdrtest.c:(.text.startup+0x5a8): undefined reference to `xdrstdio\_create’  
xdrtest.c:(.text.startup+0x612): undefined reference to `xdr_opaque' xdrtest.c:(.text.startup+0x6dc): undefined reference to `xdr\_opaque’  
xdrtest.c:(.text.startup+0x753): undefined reference to `xdr_int' xdrtest.c:(.text.startup+0x762): undefined reference to `xdr\_vector’  
xdrtest.c:(.text.startup+0x872): undefined reference to `xdr_u_int' xdrtest.c:(.text.startup+0x881): undefined reference to `xdr\_vector’  
xdrtest.c:(.text.startup+0x97a): undefined reference to `xdr_long' xdrtest.c:(.text.startup+0xa2a): undefined reference to `xdr\_long’  
xdrtest.c:(.text.startup+0xa39): undefined reference to `xdr_vector' xdrtest.c:(.text.startup+0xb3c): undefined reference to `xdr\_u\_long’  
xdrtest.c:(.text.startup+0xb4b): undefined reference to `xdr_vector' xdrtest.c:(.text.startup+0xc4b): undefined reference to `xdr\_float’  
xdrtest.c:(.text.startup+0xc5a): undefined reference to `xdr_vector' xdrtest.c:(.text.startup+0xd85): undefined reference to `xdr\_double’  
xdrtest.c:(.text.startup+0xd94): undefined reference to `xdr_vector' xdrtest.c:(.text.startup+0xe73): undefined reference to `xdr\_enum’  
xdrtest.c:(.text.startup+0xe82): undefined reference to `xdr\_vector’  
collect2: error: ld returned 1 exit status  
make[2]: \*\*\* [Makefile:658: xdrtest] Error 1  
make[2]: Leaving directory ‘/storage01/users/b159835/models/Spatial-Allocator/src/libs/hdf-4.2.11/mfhdf/xdr’  
make[1]: \*\*\* [Makefile:396: all-recursive] Error 1  
make[1]: Leaving directory ‘/storage01/users/b159835/models/Spatial-Allocator/src/libs/hdf-4.2.11/mfhdf’  
make: \*\*\* [Makefile:481: all-recursive] Error 1

---

<div class="post-metadata">

**Author:** ![bmribler](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/b/a6a055/32.png) [@bmribler](https://forum.hdfgroup.org/u/bmribler)\
**Post date:** [February 5, 2024, 6:24pm UTC](https://forum.hdfgroup.org/t/hdf-4-2-11-compile-issue/11997/2 "2024-02-05T18:24:43Z")

</div>

Please try the latest version: [HDF4](https://github.com/HDFGroup/hdf4/tree/hdf-4_2_16-2). Many improvements have been made. You’ll probably need --enable-hdf4-xdr and --disable-netcdf too.

---

<div class="post-metadata">

**Author:** ![derobins](https://forum.hdfgroup.org/user_avatar/forum.hdfgroup.org/derobins/32/1481_2.png) [@derobins](https://forum.hdfgroup.org/u/derobins)\
**Post date:** [February 6, 2024, 8:50pm UTC](https://forum.hdfgroup.org/t/hdf-4-2-11-compile-issue/11997/3 "2024-02-06T20:50:24Z")

</div>

You might also try the master branch of HDF4. That will be released as HDF 4.3.0 at the end of the month and removes the dependency on XDR.
