kzampog / cilantro

A lean C++ library for working with point cloud data
MIT License
1.03k stars 208 forks source link

it sames I can not read ply file? #43

Closed HeXu1 closed 4 years ago

HeXu1 commented 4 years ago

coding: " std::string file_path="data/test.ply"; cilantro::PointCloud3f cloud(file_path);"

when I was building,the output is "/usr/local/include/cilantro/utilities/ply_io.hpp:11: undefined reference to tinyply::PlyFile::PlyFile()' /usr/local/include/cilantro/utilities/ply_io.hpp:12: undefined reference totinyply::PlyFile::parse_header(std::istream&)' /usr/local/include/cilantro/utilities/ply_io.hpp:11: undefined reference to `tinyply::PlyFile::~PlyFile()'...."

And when I try to use the visualizer,the output is : " undefined reference to cilantro::Visualizer::Visualizer(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' /home/cidi/learning_code/myLocalization1/src/jiqunLocalization.cc:569: undefined reference tocilantro::Visualizer::spinOnce()' /home/cidi/learning_code/myLocalization1/src/jiqunLocalization.cc:563: undefined reference to cilantro::Visualizer::~Visualizer()' /home/cidi/learning_code/myLocalization1/src/jiqunLocalization.cc:563: undefined reference tocilantro::Visualizer::~Visualizer()' "

the Pangolin is builded fine.

I can running your demo fine ,but it does not work in my project~ hope for you answer,thanks.

HeXu1 commented 4 years ago

and I just can run Kdtree example, it doesn't need read ply data or visualizer~

kzampog commented 4 years ago

Hi,

Apologies for the late reply. It seems you are not linking against the library. If you used the default CMake settings for building cilantro and also use CMake for your project, you could simply try a CMakeLists.txt that looks like:

cmake_minimum_required(VERSION 3.9)
project(my_project)

find_package(cilantro)

add_executable(test_app test_app.cpp)
target_link_libraries(test_app ${cilantro_LIBRARIES})

Let me know if you still run into issues!

HeXu1 commented 4 years ago

oh ,it works. thanks for your help.Wish everything goes well.

kzampog commented 4 years ago

Great! No problem :)