s-nakaoka / choreonoid

An integrated graphical robotics application framework
http://choreonoid.org
Other
94 stars 58 forks source link

CMake error while installing #217

Closed weiqiyang closed 5 years ago

weiqiyang commented 5 years ago

I get the following error when I was trying to do make install.

[  1%] Building CXX object src/Util/CMakeFiles/CnoidUtil.dir/SceneCameras.cpp.o
In file included from $Chorenoid_DIR$/src/Util/SceneCameras.cpp:6:0:
$Chorenoid_DIR$/src/Util/SceneCameras.h: In member function ‘double cnoid::SgCamera::nearDistance() const’:
$Chorenoid_DIR$/src/Util/SceneCameras.h:43:42: error: ‘nearDistance_’ was not declared in this scope
     double nearDistance() const { return nearDistance_; }
                                          ^
$Chorenoid_DIR$/src/Util/SceneCameras.h: In member function ‘void cnoid::SgCamera::setNearDistance(double)’:
$Chorenoid_DIR$/src/Util/SceneCameras.h:44:38: error: ‘nearDistance_’ was not declared in this scope
     void setNearDistance(double d) { nearDistance_ = d; }
                                      ^
$Chorenoid_DIR$/src/Util/SceneCameras.h: In member function ‘double cnoid::SgCamera::farDistance() const’:
$Chorenoid_DIR$/src/Util/SceneCameras.h:45:41: error: ‘farDistance_’ was not declared in this scope
     double farDistance() const { return farDistance_; }
                                         ^
$Chorenoid_DIR$/src/Util/SceneCameras.h: In member function ‘void cnoid::SgCamera::setFarDistance(double)’:
$Chorenoid_DIR$/src/Util/SceneCameras.h:46:37: error: ‘farDistance_’ was not declared in this scope
     void setFarDistance(double d) { farDistance_ = d; }
                                     ^
src/Util/CMakeFiles/CnoidUtil.dir/build.make:786: recipe for target 'src/Util/CMakeFiles/CnoidUtil.dir/SceneCameras.cpp.o' failed
make[2]: *** [src/Util/CMakeFiles/CnoidUtil.dir/SceneCameras.cpp.o] Error 1
CMakeFiles/Makefile2:329: recipe for target 'src/Util/CMakeFiles/CnoidUtil.dir/all' failed
make[1]: *** [src/Util/CMakeFiles/CnoidUtil.dir/all] Error 2
Makefile:149: recipe for target 'all' failed
make: *** [all] Error 2

I am working on ubuntu-16.04, with cmake 3.5.1. The configuration and generation were done before make install by cmake-gui.

s-nakaoka commented 5 years ago

Thank you for informing this. I have fixed this problem. https://github.com/s-nakaoka/choreonoid/commit/f7ceba6fdca9bf7dbdbed291d7fbeff1614ae7b1

The errors occur when CNOID_BACKWARD_COMPATIBILITY is enabled. I recommend you not to use deprecated functions by enabling this option.