Getting error in conversion from main(int, char**)::__lambda0’ to non-scalar type ‘boost in openni_grabber

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Getting error in conversion from main(int, char**)::__lambda0’ to non-scalar type ‘boost in openni_grabber

shaikh951
Hi everyone,

I am new to PCL and trying to run vlp_grabber/openni_grabber code , but i am facing some problem.
I am getting below error

user@user-BLRMIESPC-756:~/pcl/vlp_grabber/build$ make
Scanning dependencies of target project
[100%] Building CXX object CMakeFiles/project.dir/main.cpp.o
/home/user/pcl/vlp_grabber/main.cpp: In function ‘int main(int, char**)’:
/home/user/pcl/vlp_grabber/main.cpp:90:9: warning: lambda expressions only available with -std=c++11 or -std=gnu++11 [enabled by default]
         };
         ^
/home/user/pcl/vlp_grabber/main.cpp:90:9: error: conversion from ‘main(int, char**)::__lambda0’ to non-scalar type ‘boost::function<void(const boost::shared_ptr<const pcl::PointCloud<pcl::PointXYZI> >&)>’ requested
make[2]: *** [CMakeFiles/project.dir/main.cpp.o] Error 1
make[1]: *** [CMakeFiles/project.dir/all] Error 2
make: *** [all] Error 2

The code which I copied from Internet is giving error in following line

 boost::mutex mutex;
    boost::function<void( const pcl::PointCloud<PointType>::ConstPtr& )> function = [ &cloud, &mutex ]( const pcl::PointCloud<PointType>::ConstPtr& ptr ){
            boost::mutex::scoped_lock lock( mutex );

            // Point Cloud Processing

            cloud = ptr;
        };
Please provide me some solution.


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Getting error in conversion from main(int, char**)::__lambda0’ to non-scalar type ‘boost in openni_grabber

urvashi
if you are trying to connect to an openni camera try using the code at http://pointclouds.org/documentation/tutorials/openni_grabber.php 
and use openni2 instead of openni1 in the code.
i got the same error when i tried to use a similar code, but i couldnt figure out how to solve it.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Getting error in conversion from main(int, char**)::__lambda0’ to non-scalar type ‘boost in openni_grabber

shaikh951
Hi urvashi,
I am not trying to connect openni camera from this link  http://pointclouds.org/documentation/tutorials/openni_grabber.php.

I am trying to run the vlp_grabber code from this link \
https://gist.github.com/UnaNancyOwen/9f9459d3c10f7a6325ebebabda9865f7

Kindly check the code and help me
Thanks
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Getting error in conversion from main(int, char**)::__lambda0’ to non-scalar type ‘boost in openni_grabber

shaikh951
Hi,

I have resolved the problem just write below line into CMakeLists.txt file.

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

Thanks for helping.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Getting error in conversion from main(int, char**)::__lambda0’ to non-scalar type ‘boost in openni_grabber

urvashi
Thanks!!
Loading...