Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined reference to `LZ4_decompress_safe' for flann 1.9, ubuntu 18.04 #438

Open
jubaer145 opened this issue Jan 6, 2020 · 7 comments

Comments

@jubaer145
Copy link

while running the make command to compile point cloud program, this error shows CMakeFiles/pcd_read.dir/pcd_read.cpp.o: In function flann::serialization::SaveArchive::initBlock()':
pcd_read.cpp:(.text._ZN5flann13serialization11SaveArchive9initBlockEv[_ZN5flann13serialization11SaveArchive9initBlockEv]+0xc2): undefined reference to LZ4_resetStreamHC' CMakeFiles/pcd_read.dir/pcd_read.cpp.o: In function flann::serialization::SaveArchive::flushBlock()':
pcd_read.cpp:(.text._ZN5flann13serialization11SaveArchive10flushBlockEv[_ZN5flann13serialization11SaveArchive10flushBlockEv]+0xcb): undefined reference to LZ4_compress_HC_continue' pcd_read.cpp:(.text._ZN5flann13serialization11SaveArchive10flushBlockEv[_ZN5flann13serialization11SaveArchive10flushBlockEv]+0x19e): undefined reference to LZ4_compress_HC_continue'
CMakeFiles/pcd_read.dir/pcd_read.cpp.o: In function flann::serialization::LoadArchive::decompressAndLoadV10(_IO_FILE*)': pcd_read.cpp:(.text._ZN5flann13serialization11LoadArchive20decompressAndLoadV10EP8_IO_FILE[_ZN5flann13serialization11LoadArchive20decompressAndLoadV10EP8_IO_FILE]+0x255): undefined reference to LZ4_decompress_safe'
CMakeFiles/pcd_read.dir/pcd_read.cpp.o: In function flann::serialization::LoadArchive::initBlock(_IO_FILE*)': pcd_read.cpp:(.text._ZN5flann13serialization11LoadArchive9initBlockEP8_IO_FILE[_ZN5flann13serialization11LoadArchive9initBlockEP8_IO_FILE]+0x21b): undefined reference to LZ4_setStreamDecode'
CMakeFiles/pcd_read.dir/pcd_read.cpp.o: In function flann::serialization::LoadArchive::loadBlock(char*, unsigned long, _IO_FILE*)': pcd_read.cpp:(.text._ZN5flann13serialization11LoadArchive9loadBlockEPcmP8_IO_FILE[_ZN5flann13serialization11LoadArchive9loadBlockEPcmP8_IO_FILE]+0xe4): undefined reference to LZ4_decompress_safe_continue'
CMakeFiles/pcd_read.dir/pcd_read.cpp.o: In function pcl::VFHEstimation<pcl::PointXYZ, pcl::Normal, pcl::VFHSignature308>::computePointSPFHSignature(Eigen::Matrix<float, 4, 1, 0, 4, 1> const&, Eigen::Matrix<float, 4, 1, 0, 4, 1> const&, pcl::PointCloud<pcl::PointXYZ> const&, pcl::PointCloud<pcl::Normal> const&, std::vector<int, std::allocator<int> > const&)': pcd_read.cpp:(.text._ZN3pcl13VFHEstimationINS_8PointXYZENS_6NormalENS_15VFHSignature308EE25computePointSPFHSignatureERKN5Eigen6MatrixIfLi4ELi1ELi0ELi4ELi1EEES9_RKNS_10PointCloudIS1_EERKNSA_IS2_EERKSt6vectorIiSaIiEE[_ZN3pcl13VFHEstimationINS_8PointXYZENS_6NormalENS_15VFHSignature308EE25computePointSPFHSignatureERKN5Eigen6MatrixIfLi4ELi1ELi0ELi4ELi1EEES9_RKNS_10PointCloudIS1_EERKNSA_IS2_EERKSt6vectorIiSaIiEE]+0x385): undefined reference to pcl::computePairFeatures(Eigen::Matrix<float, 4, 1, 0, 4, 1> const&, Eigen::Matrix<float, 4, 1, 0, 4, 1> const&, Eigen::Matrix<float, 4, 1, 0, 4, 1> const&, Eigen::Matrix<float, 4, 1, 0, 4, 1> const&, float&, float&, float&, float&)'
collect2: error: ld returned 1 exit status
CMakeFiles/pcd_read.dir/build.make:329: recipe for target 'pcd_read' failed
make[2]: *** [pcd_read] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/pcd_read.dir/all' failed
make[1]: *** [CMakeFiles/pcd_read.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2`

OS: Ubuntu 18.04
PCL: latest
Flann: latest

@jrobichaud
Copy link

Did you install liblz4-dev?

apt-get update && apt-get install liblz4-dev

@rimmartin
Copy link

do you want lz4 compression?

@naikf
Copy link

naikf commented Oct 18, 2020

Any one fixed this issue -
undefined reference to symbol 'LZ4_decompress_safe_continue'

Environment: Its in ubuntu with [ libflann-dev is already the newest version (1.9.1+dfsg-2) ].

Build error occur when you use something like pcl::search::KdTree

@Akpool
Copy link

Akpool commented Dec 20, 2021

nobody else had this issue or fixed it?
Have the same in Ubuntu 20
liblz4-dev is installed
libflann-dev newest version

@Hexmagic
Copy link

Hexmagic commented Mar 3, 2022

nobody else had this issue or fixed it? Have the same in Ubuntu 20 liblz4-dev is installed libflann-dev newest version

add this in CMakeLists.txt

find_library(LZ4_LIBRARIES NAMES liblz4.so HINTS "lz4/lib")
link_libraries(${LZ4_LIBRARIES})

this solve my problem

@fwanderlingh
Copy link

Why is this issue still open? @Hexmagic suggestion solves the problem! :)

@DocZain
Copy link

DocZain commented Dec 8, 2023

nobody else had this issue or fixed it? Have the same in Ubuntu 20 liblz4-dev is installed libflann-dev newest version

add this in CMakeLists.txt

find_library(LZ4_LIBRARIES NAMES liblz4.so HINTS "lz4/lib")
link_libraries(${LZ4_LIBRARIES})

this solve my problem

This is my solution:

find_library(LZ4_LIBRARIES NAMES liblz4.so HINTS "lz4/lib")
link_libraries(${LZ4_LIBRARIES})
add_definitions(${LZ4_DEFINITIONS}) 
  • ubuntu 22.04
  • pcl 1.12.1
  • flann 1.9.2
  • ros2 humble

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants