I try to use HDF under Cygwin. I have downloaded HDF 5 version 1.8.9, run configure, make, make install and now I try to link my program.
The make call builds only *.a files and I get the linker error:
/cygdrive/c/opt/library/hdf/5-1.8.9/lib/libhdf5_cpp.a(H5File.o):H5File.cpp:(.tex
t+0x2026): undefined reference to `_H5Rget_obj_type1'
/cygdrive/c/opt/library/hdf/5-1.8.9/lib/libhdf5_cpp.a(H5CommonFG.o):H5CommonFG.c
pp:(.text+0x576): undefined reference to `_H5Dcreate2'
/cygdrive/c/opt/library/hdf/5-1.8.9/lib/libhdf5_cpp.a(H5CommonFG.o):H5CommonFG.c
pp:(.text+0x6fd): undefined reference to `_H5Dopen2'
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld: /cygdrive/c
/opt/library/hdf/5-1.8.9/lib/libhdf5_cpp.a(H5CommonFG.o): bad reloc address 0x4
in section `.rdata$_ZTVN2H58CommonFGE[vtable for H5::CommonFG]'
On the linker command I have added the -lhdf5 and -lhdf5_cpp, the same calls under Linux and OSX works and the make script creates also dynamic libraries (*.so and *.dylib).
I try to use HDF under Cygwin. I have downloaded HDF 5 version 1.8.9, run configure, make, make install and now I try to link my program.
The make call builds only *.a files and I get the linker error:
hdf5-1.8.9 is already available as cygwin package, any reason
to not use it ?
/cygdrive/c/opt/library/hdf/5-1.8.9/lib/libhdf5_cpp.a(H5File.o):H5File.cpp:(.tex
t+0x2026): undefined reference to `_H5Rget_obj_type1'
/cygdrive/c/opt/library/hdf/5-1.8.9/lib/libhdf5_cpp.a(H5CommonFG.o):H5CommonFG.c
pp:(.text+0x576): undefined reference to `_H5Dcreate2'
/cygdrive/c/opt/library/hdf/5-1.8.9/lib/libhdf5_cpp.a(H5CommonFG.o):H5CommonFG.c
pp:(.text+0x6fd): undefined reference to `_H5Dopen2'
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld: /cygdrive/c
/opt/library/hdf/5-1.8.9/lib/libhdf5_cpp.a(H5CommonFG.o): bad reloc address 0x4
in section `.rdata$_ZTVN2H58CommonFGE[vtable for H5::CommonFG]'
On the linker command I have added the -lhdf5 and -lhdf5_cpp, the same calls under
Linux and OSX works and the make script creates also dynamic libraries (*.so and *.dylib).
Can me anybody help to solve the problem?
Thanks
Phil
undefined reference on windows platforms can be caused by the
order of linking, can you show the linking command ?
Please try putting -lhdf5_cpp and -lhdf5 in this order, if you haven't.
Binh-Minh
···
-----Original Message-----
From: hdf-forum-bounces@hdfgroup.org [mailto:hdf-forum-
bounces@hdfgroup.org] On Behalf Of Kraus Philipp
Sent: Saturday, June 23, 2012 3:31 PM
To: HDF Discussion List Users
Subject: [Hdf-forum] undefined reference during linking with 1.8.9
Hello,
I try to use HDF under Cygwin. I have downloaded HDF 5 version 1.8.9, run
configure, make, make install and now I try to link my program.
The make call builds only *.a files and I get the linker error:
/cygdrive/c/opt/library/hdf/5-
1.8.9/lib/libhdf5_cpp.a(H5File.o):H5File.cpp:(.tex
t+0x2026): undefined reference to `_H5Rget_obj_type1'
/cygdrive/c/opt/library/hdf/5-
1.8.9/lib/libhdf5_cpp.a(H5CommonFG.o):H5CommonFG.c
pp:(.text+0x576): undefined reference to `_H5Dcreate2'
/cygdrive/c/opt/library/hdf/5-
1.8.9/lib/libhdf5_cpp.a(H5CommonFG.o):H5CommonFG.c
pp:(.text+0x6fd): undefined reference to `_H5Dopen2'
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld:
/cygdrive/c
/opt/library/hdf/5-1.8.9/lib/libhdf5_cpp.a(H5CommonFG.o): bad reloc address
0x4
in section `.rdata$_ZTVN2H58CommonFGE[vtable for H5::CommonFG]'
On the linker command I have added the -lhdf5 and -lhdf5_cpp, the same
calls under Linux and OSX works and the make script creates also dynamic
libraries (*.so and *.dylib).
Currently, I think that configure will not build shared libs on cygwin, and should display a message. So first be sure that you are building static.
Allen
···
On Saturday, June 23, 2012 10:50:11 PM marco atzeri wrote:
On 6/23/2012 9:31 PM, Kraus Philipp wrote:
> Hello,
>
> I try to use HDF under Cygwin. I have downloaded HDF 5 version 1.8.9, run configure, make, make install and now I try to link my program.
> The make call builds only *.a files and I get the linker error:
hdf5-1.8.9 is already available as cygwin package, any reason
to not use it ?
>
> /cygdrive/c/opt/library/hdf/5-1.8.9/lib/libhdf5_cpp.a(H5File.o):H5File.cpp:(.tex
> t+0x2026): undefined reference to `_H5Rget_obj_type1'
>
> /cygdrive/c/opt/library/hdf/5-1.8.9/lib/libhdf5_cpp.a(H5CommonFG.o):H5CommonFG.c
> pp:(.text+0x576): undefined reference to `_H5Dcreate2'
>
> /cygdrive/c/opt/library/hdf/5-1.8.9/lib/libhdf5_cpp.a(H5CommonFG.o):H5CommonFG.c
> pp:(.text+0x6fd): undefined reference to `_H5Dopen2'
>
> /usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld: /cygdrive/c
> /opt/library/hdf/5-1.8.9/lib/libhdf5_cpp.a(H5CommonFG.o): bad reloc address 0x4
> in section `.rdata$_ZTVN2H58CommonFGE[vtable for H5::CommonFG]'
>
> On the linker command I have added the -lhdf5 and -lhdf5_cpp, the same calls under
Linux and OSX works and the make script creates also dynamic libraries
(*.so and *.dylib).
>
> Can me anybody help to solve the problem?
>
> Thanks
>
> Phil
>
undefined reference on windows platforms can be caused by the
order of linking, can you show the linking command ?
I agree with you. I just don't remember if the script was updated.
I need to double check the published configure script though, I am always willing to consider patches to the make systems.
Allen
···
On Monday, June 25, 2012 03:34:20 PM marco atzeri wrote:
On 6/25/2012 3:21 PM, Allen D Byrne wrote:
> Currently, I think that configure will not build shared libs on cygwin, and should display a message.
> So first be sure that you are building static.
>
> Allen
>
Hi Allen
as package maintainer for cygwin, I can assure you that shared
libs on cygwin are possible and are available by long time:
Hi Allen
starting from version 1.8.8, I have no need to patch the source anymore.
The cygwin binary package is build with
···
On 6/25/2012 4:23 PM, Allen D Byrne wrote:
Marco,
I agree with you. I just don't remember if the script was updated.
I need to double check the published configure script though, I am always willing to consider patches to the make systems.
Allen
On Monday, June 25, 2012 03:34:20 PM marco atzeri wrote:
On 6/25/2012 3:21 PM, Allen D Byrne wrote:
Currently, I think that configure will not build shared libs on cygwin, and should display a message.
> So first be sure that you are building static.
Allen
Hi Allen
as package maintainer for cygwin, I can assure you that shared
libs on cygwin are possible and are available by long time: