-
Notifications
You must be signed in to change notification settings - Fork 21
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
Not compiling under Ubuntu #2
Comments
After removing the alpha, beta, preview and official references the code compiles. I get data from gimbal, but it's never moving. It even said that firmware version is not OK. After fixing this, also no moving of gimbal. Please fix this SDK! |
g++ (Ubuntu 5.4.0-6ubuntu1~16.04.12) 5.4.0 20160609 |
OPEN PORT START READ THREAD Found GOT GIMBAL SYSTEM ID: 68 HB: 0 Got message gimbal status FW Version: 0.5.6.1�I��^H��H���PTI��Н@
Got message gimbal status HB: 620816364 Got message gimbal status FW Version: 0.5.6.1�I��^H��H���PTI��Н@
Got message gimbal status Gimbal parameter VERSION_X timed out Got message gimbal status FW Version: 0.5.6.1�I��^H��H���PTI��Н@
Got message gimbal status HB: 680650255 Got message gimbal status FW Version: 0.5.6.1�I��^H��H���PTI��Н@
Got message gimbal status HB: 101144546 Got message gimbal status FW Version: 0.5.6.1�I��^H��H���PTI��Н@
Got message gimbal status Gimbal parameter VERSION_X timed out Got message gimbal status FW Version: 0.5.6.1�I��^H��H���PTI��Н@
Got message gimbal status HB: 19712190 Got message gimbal status FW Version: 0.5.6.1�I��^H��H���PTI��Н@
Got message gimbal status HB: 586761977 Got message gimbal status FW Version: 0.5.6.1�I��^H��H���PTI��Н@
Got message gimbal status HB: 167240288 Got message gimbal status FW Version: 0.5.6.1�I��^H��H���PTI��Н@
Got message gimbal status HB: 535271597 Got message gimbal status FW Version: 0.5.6.1�I��^H��H���PTI��Н@
Got message gimbal status HB: 146440179 Got message gimbal status FW Version: 0.5.6.1�I��^H��H���PTI��Н@
Got message gimbal status Gimbal parameter VERSION_X timed out Got message gimbal status FW Version: 0.5.6.1�I��^H��H���PTI��Н@
Got message gimbal status Gimbal parameter VERSION_X timed out Got message gimbal status FW Version: 0.5.6.1�I��^H��H���PTI��Н@
Got message gimbal status HB: 520955463 Got message gimbal status FW Version: 0.5.6.1�I��^H��H���PTI��Н@
Got message gimbal status HB: 22670721 Got message gimbal status FW Version: 0.5.6.1�I��^H��H���PTI��Н@
Got message gimbal status HB: 695743485 Got message gimbal status FW Version: 0.5.6.1�I��^H��H���PTI��Н@
Got message gimbal status Gimbal parameter VERSION_X timed out Got message gimbal status FW Version: 0.5.6.1�I��^H��H���PTI��Н@
Got message gimbal status HB: 521149204 Got message gimbal status FW Version: 0.5.6.1�I��^H��H���PTI��Н@
Got message gimbal status HB: 20821406 Got message gimbal status FW Version: 0.5.6.1�I��^H��H���PTI��Н@
Got message gimbal status HB: 656037916 Got message gimbal status FW Version: 0.5.6.1�I��^H��H���PTI��Н@
Got message gimbal status HB: 19601791 Got message gimbal status FW Version: 0.5.6.1�I��^H��H���PTI��Н@
Got message gimbal status HB: 518785436 Got message gimbal status FW Version: 0.5.6.1�I��^H��H���PTI��Н@
Got message gimbal status Gimbal parameter VERSION_X timed out Got message gimbal status FW Version: 0.5.6.1�I��^H��H���PTI��Н@
Got message gimbal status HB: 537690315 Got message gimbal status FW Version: 0.5.6.1�I��^H��H���PTI��Н@
Got message gimbal status HB: 21710931 CLOSE THREADS CLOSE PORT |
Same errors here...
|
This solved for me:
|
This error occurs because you are using C++ source code without enabling the C++11 or gnu++11 standard during compilation. You need to modify the Makefile to add the -std=c++11 option to CXXFLAGS or CFLAGS. Also, make sure you have the required compilers available. |
g++ -I mavlink/include/mavlink/v2.0 mavlink_control.cpp serial_port.cpp gimbal_interface.cpp -o gSDK -lpthread
In file included from mavlink_control.h:48:0,
from mavlink_control.cpp:32:
gimbal_interface.h:737:2: error: ‘constexpr’ does not name a type
constexpr static const char* alpha = "ALPHA";
^
gimbal_interface.h:737:2: note: C++11 ‘constexpr’ only available with -std=c++11 or -std=gnu++11
gimbal_interface.h:738:2: error: ‘constexpr’ does not name a type
constexpr static const char* beta = "BETA";
^
gimbal_interface.h:738:2: note: C++11 ‘constexpr’ only available with -std=c++11 or -std=gnu++11
gimbal_interface.h:739:2: error: ‘constexpr’ does not name a type
constexpr static const char* preview = "PREVIEW";
^
gimbal_interface.h:739:2: note: C++11 ‘constexpr’ only available with -std=c++11 or -std=gnu++11
gimbal_interface.h:740:2: error: ‘constexpr’ does not name a type
constexpr static const char* official = "OFFICIAL";
^
gimbal_interface.h:740:2: note: C++11 ‘constexpr’ only available with -std=c++11 or -std=gnu++11
gimbal_interface.h:764:41: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11
const uint32_t _time_lost_connection = 60000000;
^
gimbal_interface.h:765:34: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11
const uint32_t _retry_period = 100; //100ms
^
gimbal_interface.h:766:39: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11
const uint8_t _max_fetch_attempts = 5; // times
^
gimbal_interface.h:833:2: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11
};
^
gimbal_interface.h:833:2: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
gimbal_interface.h: In member function ‘fw_version_t Gimbal_Interface::get_gimbal_version()’:
gimbal_interface.h:567:20: error: ‘class Gimbal_Interface’ has no member named ‘alpha’
fw.type = this->alpha;
^
gimbal_interface.h:571:20: error: ‘class Gimbal_Interface’ has no member named ‘beta’
fw.type = this->beta;
^
gimbal_interface.h:575:20: error: ‘class Gimbal_Interface’ has no member named ‘preview’
fw.type = this->preview;
^
gimbal_interface.h:579:20: error: ‘class Gimbal_Interface’ has no member named ‘official’
fw.type = this->official;
^
mavlink_control.cpp: In function ‘void gGimbal_control_sample(Gimbal_Interface&)’:
mavlink_control.cpp:336:49: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
config = {DIR_CCW, 50, 50, 65, 50, 0};
^
mavlink_control.cpp:336:20: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
config = {DIR_CCW, 50, 50, 65, 50, 0};
^
mavlink_control.cpp:339:46: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
config = {DIR_CW, 50, 60, 0, 0, 0};
^
mavlink_control.cpp:339:20: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
config = {DIR_CW, 50, 60, 0, 0, 0};
^
mavlink_control.cpp:342:48: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
config = {DIR_CW, 50, 70, 87, 50, 0};
^
mavlink_control.cpp:342:20: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
config = {DIR_CW, 50, 70, 87, 50, 0};
^
In file included from gimbal_interface.cpp:32:0:
gimbal_interface.h:737:2: error: ‘constexpr’ does not name a type
constexpr static const char* alpha = "ALPHA";
^
gimbal_interface.h:737:2: note: C++11 ‘constexpr’ only available with -std=c++11 or -std=gnu++11
gimbal_interface.h:738:2: error: ‘constexpr’ does not name a type
constexpr static const char* beta = "BETA";
^
gimbal_interface.h:738:2: note: C++11 ‘constexpr’ only available with -std=c++11 or -std=gnu++11
gimbal_interface.h:739:2: error: ‘constexpr’ does not name a type
constexpr static const char* preview = "PREVIEW";
^
gimbal_interface.h:739:2: note: C++11 ‘constexpr’ only available with -std=c++11 or -std=gnu++11
gimbal_interface.h:740:2: error: ‘constexpr’ does not name a type
constexpr static const char* official = "OFFICIAL";
^
gimbal_interface.h:740:2: note: C++11 ‘constexpr’ only available with -std=c++11 or -std=gnu++11
gimbal_interface.h:764:41: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11
const uint32_t _time_lost_connection = 60000000;
^
gimbal_interface.h:765:34: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11
const uint32_t _retry_period = 100; //100ms
^
gimbal_interface.h:766:39: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11
const uint8_t _max_fetch_attempts = 5; // times
^
gimbal_interface.h:833:2: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11
};
^
gimbal_interface.h:833:2: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
gimbal_interface.h: In member function ‘fw_version_t Gimbal_Interface::get_gimbal_version()’:
gimbal_interface.h:567:20: error: ‘class Gimbal_Interface’ has no member named ‘alpha’
fw.type = this->alpha;
^
gimbal_interface.h:571:20: error: ‘class Gimbal_Interface’ has no member named ‘beta’
fw.type = this->beta;
^
gimbal_interface.h:575:20: error: ‘class Gimbal_Interface’ has no member named ‘preview’
fw.type = this->preview;
^
gimbal_interface.h:579:20: error: ‘class Gimbal_Interface’ has no member named ‘official’
fw.type = this->official;
^
makefile:4: recipe for target 'mavlink_control' failed
make: *** [mavlink_control] Error 1
The text was updated successfully, but these errors were encountered: