Giter Site home page Giter Site logo

error: conversion from ‘boost::shared_ptr<pcl::PointIndices>’ to non-scalar type ‘pcl::PointIndicesPtr’ {aka ‘std::shared_ptr<pcl::PointIndices>’} requested about 3d-registration-with-maximal-cliques HOT 5 CLOSED

zhangxy0517 avatar zhangxy0517 commented on July 20, 2024
error: conversion from ‘boost::shared_ptr’ to non-scalar type ‘pcl::PointIndicesPtr’ {aka ‘std::shared_ptr’} requested

from 3d-registration-with-maximal-cliques.

Comments (5)

ttsesm avatar ttsesm commented on July 20, 2024 1

well, I've managed to resolve the latest issues by declaring the following includes in the PCR.cpp and funcs.cpp respectively:

#include <boost/random.hpp>
#include <boost/random/seed_seq.hpp>
#include <boost/random/uniform_int.hpp>

and

#include <boost/random.hpp>
#include <boost/random/seed_seq.hpp>

for the pcl::PointIndicesPtr Idx = boost::shared_ptr<pcl::PointIndices>(); I've tried to include the following header #include <boost/shared_ptr.hpp> but it didnt' work 🤔

Is using the std::make_shared<pcl::PointIndices>() instead of boost::shared_ptr<pcl::PointIndices>() would make any big difference, if any at all?

from 3d-registration-with-maximal-cliques.

zhangxy0517 avatar zhangxy0517 commented on July 20, 2024 1

It will make no difference. You can even annotate the two functions in desc_dec.cpp

from 3d-registration-with-maximal-cliques.

ttsesm avatar ttsesm commented on July 20, 2024

Ok, I've noticed that you had commented the following line pcl::PointIndicesPtr Idx = std::make_shared<pcl::PointIndices>(); under the position where I got the second error. Thus, I've replaced the pcl::PointIndicesPtr Idx = boost::shared_ptr<pcl::PointIndices>(); in both cases with the above and this seems to be resolving the issues. However, now I am getting the following errors:

[ 14%] Building CXX object CMakeFiles/MAC.dir/desc_dec.cpp.o
In file included from /usr/include/boost/preprocessor/control/if.hpp:18,
                 from /usr/include/boost/preprocessor/punctuation/comma_if.hpp:18,
                 from /usr/include/boost/preprocessor/comma_if.hpp:15,
                 from /usr/include/boost/mpl/aux_/preprocessor/params.hpp:49,
                 from /usr/include/boost/mpl/aux_/na_spec.hpp:26,
                 from /usr/include/boost/mpl/not.hpp:20,
                 from /usr/include/boost/mpl/assert.hpp:17,
                 from /usr/include/pcl-1.13/pcl/point_struct_traits.h:40,
                 from /usr/include/pcl-1.13/pcl/type_traits.h:40,
                 from /usr/include/pcl-1.13/pcl/memory.h:46,
                 from /usr/include/pcl-1.13/pcl/impl/point_types.hpp:41,
                 from /usr/include/pcl-1.13/pcl/point_types.h:354,
                 from /home/ttsesm/Development/3D-Registration-with-Maximal-Cliques/Linux/desc_dec.cpp:6:
/usr/include/pcl-1.13/pcl/registration/transforms.h:42:1: note: ‘#pragma message: This header is deprecated. Please include pcl/common/transforms.h directly. (It will be removed in PCL 1.15)’
   42 | PCL_DEPRECATED_HEADER(1, 15, "Please include pcl/common/transforms.h directly.")
      | ^~~~~~~~~~~~~~~~~~~~~
[ 28%] Building CXX object CMakeFiles/MAC.dir/funcs.cpp.o
In file included from /usr/include/boost/preprocessor/control/if.hpp:18,
                 from /usr/include/boost/preprocessor/punctuation/comma_if.hpp:18,
                 from /usr/include/boost/preprocessor/comma_if.hpp:15,
                 from /usr/include/boost/mpl/aux_/preprocessor/params.hpp:49,
                 from /usr/include/boost/mpl/aux_/na_spec.hpp:26,
                 from /usr/include/boost/mpl/not.hpp:20,
                 from /usr/include/boost/mpl/assert.hpp:17,
                 from /usr/include/pcl-1.13/pcl/point_struct_traits.h:40,
                 from /usr/include/pcl-1.13/pcl/type_traits.h:40,
                 from /usr/include/pcl-1.13/pcl/memory.h:46,
                 from /usr/include/pcl-1.13/pcl/impl/point_types.hpp:41,
                 from /usr/include/pcl-1.13/pcl/point_types.h:354,
                 from /home/ttsesm/Development/3D-Registration-with-Maximal-Cliques/Linux/funcs.cpp:5:
/usr/include/pcl-1.13/pcl/registration/transforms.h:42:1: note: ‘#pragma message: This header is deprecated. Please include pcl/common/transforms.h directly. (It will be removed in PCL 1.15)’
   42 | PCL_DEPRECATED_HEADER(1, 15, "Please include pcl/common/transforms.h directly.")
      | ^~~~~~~~~~~~~~~~~~~~~
/home/ttsesm/Development/3D-Registration-with-Maximal-Cliques/Linux/funcs.cpp: In function ‘void Add_Gaussian_noise(float, pcl::PointCloud<pcl::PointXYZ>::Ptr&, pcl::PointCloud<pcl::PointXYZ>::Ptr&)’:
/home/ttsesm/Development/3D-Registration-with-Maximal-Cliques/Linux/funcs.cpp:379:16: error: ‘mt19937’ is not a member of ‘boost’; did you mean ‘std::mt19937’?
  379 |         boost::mt19937 rng; rng.seed(static_cast<unsigned int> (time(0)));
      |                ^~~~~~~
In file included from /usr/include/c++/13.1.1/random:51,
                 from /usr/include/pcl-1.13/pcl/surface/mls.h:44,
                 from /home/ttsesm/Development/3D-Registration-with-Maximal-Cliques/Linux/funcs.cpp:14:
/usr/include/c++/13.1.1/bits/random.h:1615:37: note: ‘std::mt19937’ declared here
 1615 |     0xefc60000UL, 18, 1812433253UL> mt19937;
      |                                     ^~~~~~~
/home/ttsesm/Development/3D-Registration-with-Maximal-Cliques/Linux/funcs.cpp:379:29: error: ‘rng’ was not declared in this scope
  379 |         boost::mt19937 rng; rng.seed(static_cast<unsigned int> (time(0)));
      |                             ^~~
/home/ttsesm/Development/3D-Registration-with-Maximal-Cliques/Linux/funcs.cpp:380:16: error: ‘normal_distribution’ is not a member of ‘boost’; did you mean ‘std::normal_distribution’?
  380 |         boost::normal_distribution<> nd(0, dev);
      |                ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/13.1.1/bits/random.h:2016:11: note: ‘std::normal_distribution’ declared here
 2016 |     class normal_distribution
      |           ^~~~~~~~~~~~~~~~~~~
/home/ttsesm/Development/3D-Registration-with-Maximal-Cliques/Linux/funcs.cpp:380:36: error: expected primary-expression before ‘>’ token
  380 |         boost::normal_distribution<> nd(0, dev);
      |                                    ^
/home/ttsesm/Development/3D-Registration-with-Maximal-Cliques/Linux/funcs.cpp:380:38: error: ‘nd’ was not declared in this scope
  380 |         boost::normal_distribution<> nd(0, dev);
      |                                      ^~
/home/ttsesm/Development/3D-Registration-with-Maximal-Cliques/Linux/funcs.cpp:381:16: error: ‘variate_generator’ is not a member of ‘boost’
  381 |         boost::variate_generator<boost::mt19937&, boost::normal_distribution<> > var_nor(rng, nd);
      |                ^~~~~~~~~~~~~~~~~
/home/ttsesm/Development/3D-Registration-with-Maximal-Cliques/Linux/funcs.cpp:381:41: error: ‘mt19937’ is not a member of ‘boost’; did you mean ‘std::mt19937’?
  381 |         boost::variate_generator<boost::mt19937&, boost::normal_distribution<> > var_nor(rng, nd);
      |                                         ^~~~~~~
/usr/include/c++/13.1.1/bits/random.h:1615:37: note: ‘std::mt19937’ declared here
 1615 |     0xefc60000UL, 18, 1812433253UL> mt19937;
      |                                     ^~~~~~~
/home/ttsesm/Development/3D-Registration-with-Maximal-Cliques/Linux/funcs.cpp:381:49: error: expected primary-expression before ‘,’ token
  381 |         boost::variate_generator<boost::mt19937&, boost::normal_distribution<> > var_nor(rng, nd);
      |                                                 ^
/home/ttsesm/Development/3D-Registration-with-Maximal-Cliques/Linux/funcs.cpp:381:58: error: ‘normal_distribution’ is not a member of ‘boost’; did you mean ‘std::normal_distribution’?
  381 |         boost::variate_generator<boost::mt19937&, boost::normal_distribution<> > var_nor(rng, nd);
      |                                                          ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/13.1.1/bits/random.h:2016:11: note: ‘std::normal_distribution’ declared here
 2016 |     class normal_distribution
      |           ^~~~~~~~~~~~~~~~~~~
/home/ttsesm/Development/3D-Registration-with-Maximal-Cliques/Linux/funcs.cpp:381:78: error: expected primary-expression before ‘>’ token
  381 |         boost::variate_generator<boost::mt19937&, boost::normal_distribution<> > var_nor(rng, nd);
      |                                                                              ^
/home/ttsesm/Development/3D-Registration-with-Maximal-Cliques/Linux/funcs.cpp:381:80: error: expected primary-expression before ‘>’ token
  381 |         boost::variate_generator<boost::mt19937&, boost::normal_distribution<> > var_nor(rng, nd);
      |                                                                                ^
/home/ttsesm/Development/3D-Registration-with-Maximal-Cliques/Linux/funcs.cpp:381:82: error: ‘var_nor’ was not declared in this scope
  381 |         boost::variate_generator<boost::mt19937&, boost::normal_distribution<> > var_nor(rng, nd);
      |                                                                                  ^~~~~~~
/home/ttsesm/Development/3D-Registration-with-Maximal-Cliques/Linux/funcs.cpp: In function ‘void boost_rand(int, int, int, int, std::vector<int, std::allocator<int> >&)’:
/home/ttsesm/Development/3D-Registration-with-Maximal-Cliques/Linux/funcs.cpp:582:16: error: ‘mt19937’ is not a member of ‘boost’; did you mean ‘std::mt19937’?
  582 |         boost::mt19937 engine(seed);
      |                ^~~~~~~
/usr/include/c++/13.1.1/bits/random.h:1615:37: note: ‘std::mt19937’ declared here
 1615 |     0xefc60000UL, 18, 1812433253UL> mt19937;
      |                                     ^~~~~~~
/home/ttsesm/Development/3D-Registration-with-Maximal-Cliques/Linux/funcs.cpp:583:16: error: ‘uniform_int’ is not a member of ‘boost’
  583 |         boost::uniform_int<> distribution(start, end);
      |                ^~~~~~~~~~~
/home/ttsesm/Development/3D-Registration-with-Maximal-Cliques/Linux/funcs.cpp:583:28: error: expected primary-expression before ‘>’ token
  583 |         boost::uniform_int<> distribution(start, end);
      |                            ^
/home/ttsesm/Development/3D-Registration-with-Maximal-Cliques/Linux/funcs.cpp:583:30: error: ‘distribution’ was not declared in this scope
  583 |         boost::uniform_int<> distribution(start, end);
      |                              ^~~~~~~~~~~~
/home/ttsesm/Development/3D-Registration-with-Maximal-Cliques/Linux/funcs.cpp:584:16: error: ‘variate_generator’ is not a member of ‘boost’
  584 |         boost::variate_generator<boost::mt19937, boost::uniform_int<> > myrandom(engine, distribution);
      |                ^~~~~~~~~~~~~~~~~
/home/ttsesm/Development/3D-Registration-with-Maximal-Cliques/Linux/funcs.cpp:584:41: error: ‘mt19937’ is not a member of ‘boost’; did you mean ‘std::mt19937’?
  584 |         boost::variate_generator<boost::mt19937, boost::uniform_int<> > myrandom(engine, distribution);
      |                                         ^~~~~~~
/usr/include/c++/13.1.1/bits/random.h:1615:37: note: ‘std::mt19937’ declared here
 1615 |     0xefc60000UL, 18, 1812433253UL> mt19937;
      |                                     ^~~~~~~
/home/ttsesm/Development/3D-Registration-with-Maximal-Cliques/Linux/funcs.cpp:584:57: error: ‘uniform_int’ is not a member of ‘boost’
  584 |         boost::variate_generator<boost::mt19937, boost::uniform_int<> > myrandom(engine, distribution);
      |                                                         ^~~~~~~~~~~
/home/ttsesm/Development/3D-Registration-with-Maximal-Cliques/Linux/funcs.cpp:584:69: error: expected primary-expression before ‘>’ token
  584 |         boost::variate_generator<boost::mt19937, boost::uniform_int<> > myrandom(engine, distribution);
      |                                                                     ^
/home/ttsesm/Development/3D-Registration-with-Maximal-Cliques/Linux/funcs.cpp:584:71: error: expected primary-expression before ‘>’ token
  584 |         boost::variate_generator<boost::mt19937, boost::uniform_int<> > myrandom(engine, distribution);
      |                                                                       ^
/home/ttsesm/Development/3D-Registration-with-Maximal-Cliques/Linux/funcs.cpp:584:82: error: ‘engine’ was not declared in this scope; did you mean ‘inline’?
  584 |         boost::variate_generator<boost::mt19937, boost::uniform_int<> > myrandom(engine, distribution);
      |                                                                                  ^~~~~~
      |                                                                                  inline
/home/ttsesm/Development/3D-Registration-with-Maximal-Cliques/Linux/funcs.cpp:584:73: error: ‘myrandom’ was not declared in this scope; did you mean ‘srandom’?
  584 |         boost::variate_generator<boost::mt19937, boost::uniform_int<> > myrandom(engine, distribution);
      |                                                                         ^~~~~~~~
      |                                                                         srandom
make[2]: *** [CMakeFiles/MAC.dir/build.make:104: CMakeFiles/MAC.dir/funcs.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/MAC.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

It seems to be something with the boost library 🤔

from 3d-registration-with-maximal-cliques.

zhangxy0517 avatar zhangxy0517 commented on July 20, 2024

It seems that the versions of PCL and Boost are incompatible. I suggest installing PCL 1.10.1 and Boost 1.74

from 3d-registration-with-maximal-cliques.

ttsesm avatar ttsesm commented on July 20, 2024

Thanks ;-)

from 3d-registration-with-maximal-cliques.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.