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

Make bool conversion explicit #42

Open
mfinean opened this issue Feb 10, 2020 · 2 comments
Open

Make bool conversion explicit #42

mfinean opened this issue Feb 10, 2020 · 2 comments

Comments

@mfinean
Copy link

mfinean commented Feb 10, 2020

Error:
cpp:543:65: error: cannot convert ‘OpenRAVE::UserDataPtr {aka boost::shared_ptrOpenRAVE::UserData}’ to ‘bool’ in initialization

Line:

bool useTrimesh = trajopt::GetUserData(*body, "bt_use_trimesh");

Fix:
bool useTrimesh = bool(trajopt::GetUserData(*body, "bt_use_trimesh"));

@QAbot-zh
Copy link

Thank you so much! I got the same problem And your solution works.

@QAbot-zh
Copy link

@mfinean
Do you meet the problem as below?

In file included from /home/zxy/learning-code/trajopt-lfd/src/cloudproc/mesh_simplification.cpp:8:0:
/home/zxy/learning-code/trajopt-lfd/src/cloudproc/vtkQuadricDecimation2.h:64:49: error: expected initializer before ‘:’ token
 class VTK_GRAPHICS_EXPORT vtkQuadricDecimation2 : public vtkPolyDataAlgorithm
                                                 ^
In file included from /usr/include/boost/type_traits/has_operator.hpp:30:0,
                 from /usr/include/boost/type_traits.hpp:35,
                 from /usr/include/pcl-1.7/pcl/register_point_struct.h:65,
                 from /usr/include/pcl-1.7/pcl/point_types.h:44,
                 from /home/zxy/learning-code/trajopt-lfd/src/cloudproc/mesh_simplification.cpp:10:
/usr/include/boost/type_traits/has_logical_not.hpp:13:28: error: expected declaration before end of line
src/cloudproc/CMakeFiles/cloudproc.dir/build.make:110: recipe for target 'src/cloudproc/CMakeFiles/cloudproc.dir/mesh_simplification.cpp.o' failed
make[2]: *** [src/cloudproc/CMakeFiles/cloudproc.dir/mesh_simplification.cpp.o] Error 1
CMakeFiles/Makefile2:793: recipe for target 'src/cloudproc/CMakeFiles/cloudproc.dir/all' failed
make[1]: *** [src/cloudproc/CMakeFiles/cloudproc.dir/all] Error 2
Makefile:94: recipe for target 'all' failed
make: *** [all] Error 2

why the boost library will get the error?

cedriclmenard added a commit to cedriclmenard/trajopt that referenced this issue Mar 29, 2021
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

2 participants