当链接我的hdf5代码时,我会得到以下错误。我做错了什么。
我正在使用的命令:
-I/opt/software/OpenFOAM/OpenFOAM-v1712/src/finiteVolume/lnInclude -I/opt/software/OpenFOAM/OpenFOAM-v1712/src/sampling/lnInclude -I/opt/software/OpenFOAM/OpenFOAM-v1712/src/meshTools/lnInclude -IlnInclude -I. g++ -std=c++11 -m64 -DOPENFOAM_PLUS=1712 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold样式-cast-Wnon-虚拟-Wno-未使用-参数-Wno-无效-抵消-Wno-attributes -O3 -DNoRepository -ftemplate-深度-100 g++-I/opt/software/OpenFOAM/OpenFOAM-v1712/src/meshTools/lnInclude-IlnInclude-I。-I/opt/software/OpenFOAM/OpenFOAM-v1712/src/OpenFOAM/lnInclude -I/opt/software/OpenFOAM/OpenFOAM-v1712/src/OSspecific/POSIX/lnInclude -fPIC -Xlinker -需要添加的-Xlinker -不需要的Make/linux64GccDPInt32Opt/3 3DIBicoFoam_2 o -L/opt/software/OpenFOAM/OpenFOAM-v1712/platforms/linux64GccDPInt32Opt/lib \ -lfiniteVolume -lsampling -L/local/hulfeldl /hdf5 5/lib/libhdf5 5_hl_cpp.a-L/local/hulfeldl/hdf5 5/lib/libhdf5 5_cpp.a-L/ -lhdf5_hl_cpp /hulfeldl/hdf5 5/hdf5 5/lib/libhdf5_hl.a-L/local/hulfeldl/hdf5 5/lib/libhdf5.a-lhdf5_hl_cpp -lhdf5_cpp -lhdf5_hl -lhdf5 -lsz -lz -ldl -lm -lOpenFOAM -ldl \ -lm -o -lm-o-lOpenFOAM-ldl\-lm-o-o
错误:
Make/linux64GccDPInt32Opt/3DIBicoFoam_2.o: In function `main':
3DIBicoFoam_2.C:(.text.startup+0x107b): undefined reference to
`H5::H5Location::openDataSet(std::string const&) const'
3DIBicoFoam_2.C:(.text.startup+0x17de): undefined reference to
`H5::H5Location::openDataSet(std::string const&) const'
3DIBicoFoam_2.C:(.text.startup+0x189e): undefined reference to
`H5::H5Location::openDataSet(std::string const&) const'
3DIBicoFoam_2.C:(.text.startup+0x1919): undefined reference to
`H5::H5Location::openDataSet(std::string const&) const'
3DIBicoFoam_2.C:(.text.startup+0x19d0): undefined reference to
`H5::H5Location::openDataSet(std::string const&) const'发布于 2018-04-26 13:43:41
请删除所有开始使用的-L/...a。添加一个-L/local/hulfeldl/hdf5/lib,将所有-lhdf...保留在命令中。再试一次。
对于运行时,请在运行程序之前运行以下命令。
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/local/hulfeldl/hdf5/libhttps://stackoverflow.com/questions/50042814
复制相似问题