Skip to content
This repository has been archived by the owner on Aug 5, 2022. It is now read-only.

building error: ‘status’ is not a class, namespace, or enumeration #46

Closed
gzhang8 opened this issue Apr 10, 2017 · 6 comments
Closed

Comments

@gzhang8
Copy link

gzhang8 commented Apr 10, 2017

When I build using cmake and make I get this error message. Any idea? Thanks in advance.

/home/gzhang8/course/UAV/code/gazebo-sitl/gzsitl/gzsitl_plugin.cc: In member function ‘void gazebo::GZSitlPlugin::OnUpdate()’:
/home/gzhang8/course/UAV/code/gazebo-sitl/gzsitl/gzsitl_plugin.cc:140:23: error: ‘status’ is not a class, namespace, or enumeration
         if (status == status::STANDBY) {
                       ^
/home/gzhang8/course/UAV/code/gazebo-sitl/gzsitl/gzsitl_plugin.cc:143:30: error: ‘status’ is not a class, namespace, or enumeration
         } else if (status == status::ACTIVE) {
                              ^
/home/gzhang8/course/UAV/code/gazebo-sitl/gzsitl/gzsitl_plugin.cc:173:23: error: ‘status’ is not a class, namespace, or enumeration
         if (status != status::ACTIVE) {
                       ^
/home/gzhang8/course/UAV/code/gazebo-sitl/gzsitl/gzsitl_plugin.cc:193:23: error: ‘status’ is not a class, namespace, or enumeration
         if (status == status::ACTIVE) {
                       ^
gzsitl/CMakeFiles/gzsitl_plugin.dir/build.make:62: recipe for target 'gzsitl/CMakeFiles/gzsitl_plugin.dir/gzsitl_plugin.cc.o' failed
make[2]: *** [gzsitl/CMakeFiles/gzsitl_plugin.dir/gzsitl_plugin.cc.o] Error 1
CMakeFiles/Makefile2:214: recipe for target 'gzsitl/CMakeFiles/gzsitl_plugin.dir/all' failed
make[1]: *** [gzsitl/CMakeFiles/gzsitl_plugin.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
@mbelluzzo
Copy link

That is odd. Here is compiling ok. It is defined on mavlink_vehicles.hh which is indirectly included via gzsitl_plugin.hh.

Care to share how did you issue your cmake command and gcc version? Was you following the steps listed here?

@rchiossi
Copy link

Just cloned and build a fresh repo and was unable to reproduce the issue. Could to share your cmake output?

@gzhang8
Copy link
Author

gzhang8 commented Apr 11, 2017

Thanks for your @mbelluzzo @rchiossi reply. I am using Ubuntu16.04 (GCC 5.4.0). Here is how I build.
First, I build and install https://github.com/ArduPilot/MAVProxy.git using

sudo python setup.py install

Second, I build Ardupilot using

./waf configure
sudo ./waf install

From my current understanding, mavproxy and Ardupilot are both runtime dependence, not building depenence. Please correct me if I am wrong.

Third, I run

git submodule update --init --recursive
cd build
cmake ..
make

Then I get that error. Confirmed on another close to fresh install Ubuntu 16.04 machine

Here is the cmake .. output. It has some warnings inside. After that is gcc -v output (gcc 5.4.0)

-- Boost version: 1.58.0
-- Found the following Boost libraries:
--   thread
--   signals
--   system
--   filesystem
--   program_options
--   regex
--   iostreams
--   date_time
--   chrono
--   atomic
-- Boost version: 1.58.0
-- Looking for OGRE...
-- Found Ogre Ghadamon (1.9.0)
-- Found OGRE: optimized;/usr/lib/x86_64-linux-gnu/libOgreMain.so;debug;/usr/lib/x86_64-linux-gnu/libOgreMain.so
-- Looking for OGRE_Paging...
-- Found OGRE_Paging: optimized;/usr/lib/x86_64-linux-gnu/libOgrePaging.so;debug;/usr/lib/x86_64-linux-gnu/libOgrePaging.so
-- Looking for OGRE_Terrain...
-- Found OGRE_Terrain: optimized;/usr/lib/x86_64-linux-gnu/libOgreTerrain.so;debug;/usr/lib/x86_64-linux-gnu/libOgreTerrain.so
-- Looking for OGRE_Property...
-- Found OGRE_Property: optimized;/usr/lib/x86_64-linux-gnu/libOgreProperty.so;debug;/usr/lib/x86_64-linux-gnu/libOgreProperty.so
-- Looking for OGRE_RTShaderSystem...
-- Found OGRE_RTShaderSystem: optimized;/usr/lib/x86_64-linux-gnu/libOgreRTShaderSystem.so;debug;/usr/lib/x86_64-linux-gnu/libOgreRTShaderSystem.so
-- Looking for OGRE_Volume...
-- Found OGRE_Volume: optimized;/usr/lib/x86_64-linux-gnu/libOgreVolume.so;debug;/usr/lib/x86_64-linux-gnu/libOgreVolume.so
-- Looking for OGRE_Overlay...
-- Found OGRE_Overlay: optimized;/usr/lib/x86_64-linux-gnu/libOgreOverlay.so;debug;/usr/lib/x86_64-linux-gnu/libOgreOverlay.so
-- Looking for ignition-msgs - found
Validating /home/gzhang8/course/UAV/code/gazebo-sitl/modules/mavlink_vehicles/modules/mavlink/message_definitions/v1.0/common.xml
Parsing /home/gzhang8/course/UAV/code/gazebo-sitl/modules/mavlink_vehicles/modules/mavlink/message_definitions/v1.0/common.xml
Note: message GPS_STATUS is longer than 64 bytes long (109 bytes), which can cause fragmentation since many radio modems use 64 bytes as maximum air transfer unit.
Note: message ATTITUDE_QUATERNION_COV is longer than 64 bytes long (80 bytes), which can cause fragmentation since many radio modems use 64 bytes as maximum air transfer unit.
Note: message GLOBAL_POSITION_INT_COV is longer than 64 bytes long (189 bytes), which can cause fragmentation since many radio modems use 64 bytes as maximum air transfer unit.
Note: message LOCAL_POSITION_NED_COV is longer than 64 bytes long (233 bytes), which can cause fragmentation since many radio modems use 64 bytes as maximum air transfer unit.
Note: message HIL_ACTUATOR_CONTROLS is longer than 64 bytes long (89 bytes), which can cause fragmentation since many radio modems use 64 bytes as maximum air transfer unit.
Note: message HIGHRES_IMU is longer than 64 bytes long (70 bytes), which can cause fragmentation since many radio modems use 64 bytes as maximum air transfer unit.
Note: message HIL_SENSOR is longer than 64 bytes long (72 bytes), which can cause fragmentation since many radio modems use 64 bytes as maximum air transfer unit.
Note: message SIM_STATE is longer than 64 bytes long (92 bytes), which can cause fragmentation since many radio modems use 64 bytes as maximum air transfer unit.
Note: message FILE_TRANSFER_PROTOCOL is longer than 64 bytes long (262 bytes), which can cause fragmentation since many radio modems use 64 bytes as maximum air transfer unit.
Note: message HIL_STATE_QUATERNION is longer than 64 bytes long (72 bytes), which can cause fragmentation since many radio modems use 64 bytes as maximum air transfer unit.
Note: message LOG_DATA is longer than 64 bytes long (105 bytes), which can cause fragmentation since many radio modems use 64 bytes as maximum air transfer unit.
Note: message GPS_INJECT_DATA is longer than 64 bytes long (121 bytes), which can cause fragmentation since many radio modems use 64 bytes as maximum air transfer unit.
Note: message SERIAL_CONTROL is longer than 64 bytes long (87 bytes), which can cause fragmentation since many radio modems use 64 bytes as maximum air transfer unit.
Note: message ENCAPSULATED_DATA is longer than 64 bytes long (263 bytes), which can cause fragmentation since many radio modems use 64 bytes as maximum air transfer unit.
Note: message RESOURCE_REQUEST is longer than 64 bytes long (251 bytes), which can cause fragmentation since many radio modems use 64 bytes as maximum air transfer unit.
Note: message FOLLOW_TARGET is longer than 64 bytes long (101 bytes), which can cause fragmentation since many radio modems use 64 bytes as maximum air transfer unit.
Note: message CONTROL_SYSTEM_STATE is longer than 64 bytes long (108 bytes), which can cause fragmentation since many radio modems use 64 bytes as maximum air transfer unit.
Note: message AUTOPILOT_VERSION is longer than 64 bytes long (68 bytes), which can cause fragmentation since many radio modems use 64 bytes as maximum air transfer unit.
Note: message GPS_INPUT is longer than 64 bytes long (71 bytes), which can cause fragmentation since many radio modems use 64 bytes as maximum air transfer unit.
Note: message GPS_RTCM_DATA is longer than 64 bytes long (190 bytes), which can cause fragmentation since many radio modems use 64 bytes as maximum air transfer unit.
Note: message V2_EXTENSION is longer than 64 bytes long (262 bytes), which can cause fragmentation since many radio modems use 64 bytes as maximum air transfer unit.
Note: message CAMERA_INFORMATION is longer than 64 bytes long (94 bytes), which can cause fragmentation since many radio modems use 64 bytes as maximum air transfer unit.
Note: message CAMERA_IMAGE_CAPTURED is longer than 64 bytes long (263 bytes), which can cause fragmentation since many radio modems use 64 bytes as maximum air transfer unit.
Note: message LOGGING_DATA is longer than 64 bytes long (263 bytes), which can cause fragmentation since many radio modems use 64 bytes as maximum air transfer unit.
Note: message LOGGING_DATA_ACKED is longer than 64 bytes long (263 bytes), which can cause fragmentation since many radio modems use 64 bytes as maximum air transfer unit.
Found 149 MAVLink message types in 1 XML files
Generating C implementation in directory /home/gzhang8/course/UAV/code/gazebo-sitl/build/modules/mavlink_vehicles/include/mavlink/common
Copying fixed headers for protocol 2.0 to /home/gzhang8/course/UAV/code/gazebo-sitl/build/modules/mavlink_vehicles/include/mavlink
-- Configuring done
-- Generating done
-- Build files have been written to: /home/gzhang8/course/UAV/code/gazebo-sitl/build

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1~16.04.4' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 

@rchiossi
Copy link

cmake seems ok. I checked on a fresh install from ubuntu 16.10 that I had in a new machine and it worked fine. I'll try to get a fresh install of 16.04 to see if I can reproduce the issue.

@gzhang8
Copy link
Author

gzhang8 commented Apr 12, 2017

Thank you @rchiossi.

Here is the error message from the first warning

[ 62%] Building CXX object gzsitl/CMakeFiles/gzsitl_plugin.dir/gzsitl_plugin.cc.o
In file included from /usr/include/ignition/math3/ignition/math/Angle.hh:21:0,
                 from /usr/include/ignition/math3/ignition/math.hh:3,
                 from /usr/include/sdformat-5.1/sdf/Param.hh:35,
                 from /usr/include/sdformat-5.1/sdf/Element.hh:25,
                 from /usr/include/sdformat-5.1/sdf/sdf.hh:4,
                 from /usr/include/gazebo-8/gazebo/common/Battery.hh:25,
                 from /usr/include/gazebo-8/gazebo/common/common.hh:8,
                 from /home/gzhang8/course/UAV/code/gazebo-sitl/gzsitl/gzsitl_plugin.hh:20,
                 from /home/gzhang8/course/UAV/code/gazebo-sitl/gzsitl/gzsitl_plugin.cc:20:
/usr/include/ignition/math3/ignition/math/Helpers.hh:33:37: warning: ‘ignition::math::DPRCT_MAX_D’ is deprecated [-Wdeprecated-declarations]
 #define IGN_DBL_MAX ignition::math::DPRCT_MAX_D
                                     ^
/usr/include/gazebo-8/gazebo/common/MaterialDensity.hh:119:43: note: in expansion of macro ‘IGN_DBL_MAX’
                   const double _epsilon = IGN_DBL_MAX);
                                           ^
/usr/include/ignition/math3/ignition/math/Helpers.hh:354:43: note: declared here
     static const double IGN_DEPRECATED(2) DPRCT_MAX_D = MAX_D;
                                           ^
/usr/include/ignition/math3/ignition/math/Helpers.hh:33:37: warning: ‘ignition::math::DPRCT_MAX_D’ is deprecated [-Wdeprecated-declarations]
 #define IGN_DBL_MAX ignition::math::DPRCT_MAX_D
                                     ^
/usr/include/gazebo-8/gazebo/common/MaterialDensity.hh:119:43: note: in expansion of macro ‘IGN_DBL_MAX’
                   const double _epsilon = IGN_DBL_MAX);
                                           ^
/usr/include/ignition/math3/ignition/math/Helpers.hh:354:43: note: declared here
     static const double IGN_DEPRECATED(2) DPRCT_MAX_D = MAX_D;
                                           ^
/usr/include/ignition/math3/ignition/math/Helpers.hh:33:37: warning: ‘ignition::math::DPRCT_MAX_D’ is deprecated [-Wdeprecated-declarations]
 #define IGN_DBL_MAX ignition::math::DPRCT_MAX_D
                                     ^
/usr/include/gazebo-8/gazebo/common/MaterialDensity.hh:128:43: note: in expansion of macro ‘IGN_DBL_MAX’
                   const double _epsilon = IGN_DBL_MAX);
                                           ^
/usr/include/ignition/math3/ignition/math/Helpers.hh:354:43: note: declared here
     static const double IGN_DEPRECATED(2) DPRCT_MAX_D = MAX_D;
                                           ^
/usr/include/ignition/math3/ignition/math/Helpers.hh:33:37: warning: ‘ignition::math::DPRCT_MAX_D’ is deprecated [-Wdeprecated-declarations]
 #define IGN_DBL_MAX ignition::math::DPRCT_MAX_D
                                     ^
/usr/include/gazebo-8/gazebo/common/MaterialDensity.hh:128:43: note: in expansion of macro ‘IGN_DBL_MAX’
                   const double _epsilon = IGN_DBL_MAX);
                                           ^
/usr/include/ignition/math3/ignition/math/Helpers.hh:354:43: note: declared here
     static const double IGN_DEPRECATED(2) DPRCT_MAX_D = MAX_D;
                                           ^
/home/gzhang8/course/UAV/code/gazebo-sitl/gzsitl/gzsitl_plugin.cc: In member function ‘void gazebo::GZSitlPlugin::OnUpdate()’:
/home/gzhang8/course/UAV/code/gazebo-sitl/gzsitl/gzsitl_plugin.cc:140:23: error: ‘status’ is not a class, namespace, or enumeration
         if (status == status::STANDBY) {
                       ^
/home/gzhang8/course/UAV/code/gazebo-sitl/gzsitl/gzsitl_plugin.cc:143:30: error: ‘status’ is not a class, namespace, or enumeration
         } else if (status == status::ACTIVE) {
                              ^
/home/gzhang8/course/UAV/code/gazebo-sitl/gzsitl/gzsitl_plugin.cc:173:23: error: ‘status’ is not a class, namespace, or enumeration
         if (status != status::ACTIVE) {
                       ^
/home/gzhang8/course/UAV/code/gazebo-sitl/gzsitl/gzsitl_plugin.cc:193:23: error: ‘status’ is not a class, namespace, or enumeration
         if (status == status::ACTIVE) {
                       ^
gzsitl/CMakeFiles/gzsitl_plugin.dir/build.make:62: recipe for target 'gzsitl/CMakeFiles/gzsitl_plugin.dir/gzsitl_plugin.cc.o' failed
make[2]: *** [gzsitl/CMakeFiles/gzsitl_plugin.dir/gzsitl_plugin.cc.o] Error 1
CMakeFiles/Makefile2:214: recipe for target 'gzsitl/CMakeFiles/gzsitl_plugin.dir/all' failed
make[1]: *** [gzsitl/CMakeFiles/gzsitl_plugin.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

@rchiossi
Copy link

I was able to reproduce the issue on ubuntu 16.04. The problem comes from gcc version. Version 5 was getting confusing with the variable/class naming (it may be a good idea to rework that bit of code). PR #48 solves the issue. @mbelluzzo can you take a look later today at this PR?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants