horizon-research / Real-Time-Spatio-Temporal-LiDAR-Point-Cloud-Compression

This is a compression technique that targets for LiDAR-generated point cloud
126 stars 13 forks source link

OpenCV linking issue #2

Closed maipbui closed 3 years ago

maipbui commented 3 years ago

Hello,

Thanks for the great project! I think I have a linking issue and I am not very familiar with makefile and opencv. Could you please show me how to fix it? Thank you! Ubuntu: 18.04.05 LTS Opencv version: 4.5.1 Boost version: Version: 1.65.1.0ubuntu1

g++ -c -fPIC utils.cpp encoder.cpp pcc_module.cpp decoder.cpp io.cpp -std=c++11 -O3 -g -I/usr/local/include -I `pkg-config --cflags opencv4` -I/usr/include/boost -I.
g++ -o pcc_encoder pcc_encoder.cpp utils.o encoder.o decoder.o pcc_module.o io.cpp -lstdc++fs `pkg-config opencv4 --cflags --libs` -L/usr/local/lib -Wl,-rpath=/usr/local/lib -lboost_program_options -lboost_system -L. -Wl,-rpath=. -std=c++11 -O3 -g -I/usr/local/include -I `pkg-config --cflags opencv4` -I/usr/include/boost -I.
encoder.o: In function `encoder::export_mats(std::vector<cv::Mat*, std::allocator<cv::Mat*> >&, int)':
/home/mb18/Documents/Real-Time-Spatio-Temporal-LiDAR-Point-Cloud-Compression/src/encoder.cpp:257: undefined reference to `cv::imwrite(cv::String const&, cv::_InputArray const&, std::vector<int, std::allocator<int> > const&)'
encoder.o: In function `encoder::export_mats(std::vector<cv::Mat*, std::allocator<cv::Mat*> >&, int)':
/usr/include/opencv2/core/cvstd.hpp:664: undefined reference to `cv::String::deallocate()'
/usr/include/opencv2/core/cvstd.hpp:664: undefined reference to `cv::String::deallocate()'
encoder.o: In function `cv::String::String(char const*)':
/usr/include/opencv2/core/cvstd.hpp:622: undefined reference to `cv::String::allocate(unsigned long)'
pcc_module.o: In function `cvflann::anyimpl::big_any_policy<cv::String>::static_delete(void**)':
/usr/include/opencv2/core/cvstd.hpp:664: undefined reference to `cv::String::deallocate()'
pcc_module.o: In function `cvflann::anyimpl::big_any_policy<cv::String>::move(void* const*, void**)':
/usr/include/opencv2/core/cvstd.hpp:664: undefined reference to `cv::String::deallocate()'
/usr/include/opencv2/core/cvstd.hpp:672: undefined reference to `cv::String::deallocate()'
collect2: error: ld returned 1 exit status
Makefile:29: recipe for target 'pcc_encoder' failed
make: *** [pcc_encoder] Error 1

Updated: Reinstall OpenCV from source fix my issue