YuvalNirkin / face_swap

End-to-end, automatic face swapping pipeline
GNU General Public License v3.0
825 stars 203 forks source link

HDF5 compile error #23

Closed tjusxh closed 6 years ago

tjusxh commented 6 years ago

I come across the same question like #17. I changed references in CMakeLists.txt to libhdf5_cpp.so. But the error still exist. could you describe the detail how to change the CMakeList.txt?

Found HDF5: /usr/local/hdf5/lib/libhdf5_hl.so;/usr/local/hdf5/lib/libhdf5.so;/usr/lib/x86_64-linux-gnu/libz.so;/usr/lib/x86_64-linux-gnu/libdl.so;/usr/lib/x86_64-linux-gnu/libm.so (found version "1.8.20")

../face_swap/libface_swap.a(basel_3dmm.cpp.o): In function face_swap::readH5Dataset(H5::H5File const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)': basel_3dmm.cpp:(.text+0x604): undefined reference toH5::CommonFG::openDataSet(std::cxx11::basic_string<char, std::char_traits, std::allocator > const&) const' basel_3dmm.cpp:(.text+0x614): undefined reference to H5::AbstractDs::getTypeClass() const' basel_3dmm.cpp:(.text+0x62d): undefined reference toH5::DataSet::getSpace() const' basel_3dmm.cpp:(.text+0x645): undefined reference to H5::DataSpace::getSimpleExtentDims(unsigned long long*, unsigned long long*) const' basel_3dmm.cpp:(.text+0x67e): undefined reference toH5::DSetMemXferPropList::DEFAULT' basel_3dmm.cpp:(.text+0x69c): undefined reference to H5::DataSpace::DataSpace(int, unsigned long long const*, unsigned long long const*)' basel_3dmm.cpp:(.text+0x6a3): undefined reference toH5::PredType::NATIVE_FLOAT' basel_3dmm.cpp:(.text+0x6d4): undefined reference to H5::DataSet::read(void*, H5::DataType const&, H5::DataSpace const&, H5::DataSpace const&, H5::DSetMemXferPropList const&) const' basel_3dmm.cpp:(.text+0x6e0): undefined reference toH5::DataSpace::~DataSpace()' basel_3dmm.cpp:(.text+0x6ed): undefined reference to H5::DataSpace::~DataSpace()' basel_3dmm.cpp:(.text+0x6f9): undefined reference toH5::DataSet::~DataSet()' basel_3dmm.cpp:(.text+0x721): undefined reference to H5::DataSpace::~DataSpace()' basel_3dmm.cpp:(.text+0x732): undefined reference toH5::DataSpace::~DataSpace()' basel_3dmm.cpp:(.text+0x743): undefined reference to H5::DataSet::~DataSet()' ../face_swap/libface_swap.a(basel_3dmm.cpp.o): In functionface_swap::Basel3DMM::load(std::cxx11::basic_string<char, std::char_traits, std::allocator > const&)': basel_3dmm.cpp:(.text+0x135f): undefined reference to H5::Exception::dontPrint()' basel_3dmm.cpp:(.text+0x1366): undefined reference toH5::FileAccPropList::DEFAULT' basel_3dmm.cpp:(.text+0x1370): undefined reference to H5::FileCreatPropList::DEFAULT' basel_3dmm.cpp:(.text+0x13b3): undefined reference toH5::H5File::H5File(char const*, unsigned int, H5::FileCreatPropList const&, H5::FileAccPropList const&)' basel_3dmm.cpp:(.text+0x1a59): undefined reference to H5::H5File::~H5File()' basel_3dmm.cpp:(.text+0x1d5c): undefined reference toH5::H5File::~H5File()' basel_3dmm.cpp:(.text+0x1dc6): undefined reference to H5::Exception::getDetailMsg[abi:cxx11]() const' basel_3dmm.cpp:(.text+0x1e39): undefined reference toH5::DataSetIException::~DataSetIException()' ../face_swap/libface_swap.a(basel_3dmm.cpp.o): In function H5::DataSetIException::DataSetIException(H5::DataSetIException const&)': basel_3dmm.cpp:(.text._ZN2H517DataSetIExceptionC2ERKS0_[_ZN2H517DataSetIExceptionC5ERKS0_]+0x1f): undefined reference toH5::Exception::Exception(H5::Exception const&)' basel_3dmm.cpp:(.text.ZN2H517DataSetIExceptionC2ERKS0[ZN2H517DataSetIExceptionC5ERKS0]+0x26): undefined reference to vtable for H5::DataSetIException' ../face_swap/libface_swap.a(basel_3dmm.cpp.o):(.data.DW.ref._ZTIN2H517DataSetIExceptionE[DW.ref._ZTIN2H517DataSetIExceptionE]+0x0): undefined reference totypeinfo for H5::DataSetIException' collect2: error: ld returned 1 exit status face_swap_image/CMakeFiles/face_swap_image.dir/build.make:166: recipe for target 'face_swap_image/face_swap_image' failed make[2]: [face_swap_image/face_swap_image] Error 1 CMakeFiles/Makefile2:253: recipe for target 'face_swap_image/CMakeFiles/face_swap_image.dir/all' failed make[1]: [face_swap_image/CMakeFiles/face_swap_image.dir/all] Error 2 Makefile:127: recipe for target 'all' failed make: *** [all] Error 2

tjusxh commented 6 years ago

I fixed the question by add CXX to the command. find_package(HDF5 COMPONENTS CXX HL REQUIRED)

Qingcsai commented 4 years ago

I came across the same question! Could u plz describe how u dealt with it ? Thanks~