It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center




7年前关闭。




我按照指南在eclipse(https://code.google.com/p/ardupilot-mega/wiki/Eclipse)中导入Ardupilot项目

第一次可以构建项目,但之后总是会遇到以下两个错误:
autogenerated:1:33: error: operator '&&' has no right operand

[...]
make: *** [/tmp/ArduPilotMega.build/ArduPilotMega.o] Error 1

更多细节:
**** Build of configuration Default for project ArduPilot-mega ****

make apm1
make: ../sketchbook/Tools/scripts/arduino_version.sh: Command not found
../mk//Arduino.mk:537: warning: overriding recipe for target `clean'
../libraries/AP_Common/Arduino.mk:324: warning: ignoring old recipe for target `clean'
../mk//Arduino.mk:555: warning: overriding recipe for target `/tmp/ArduPilotMega.build/ArduPilotMega.elf'
../libraries/AP_Common/Arduino.mk:341: warning: ignoring old recipe for target `/tmp/ArduPilotMega.build/ArduPilotMega.elf'
../mk//Arduino.mk:560: warning: overriding recipe for target `/tmp/ArduPilotMega.build/ArduPilotMega.hex'
../libraries/AP_Common/Arduino.mk:346: warning: ignoring old recipe for target `/tmp/ArduPilotMega.build/ArduPilotMega.hex'
../mk//Arduino.mk:565: warning: overriding recipe for target `/tmp/ArduPilotMega.build/ArduPilotMega.eep'
../libraries/AP_Common/Arduino.mk:351: warning: ignoring old recipe for target `/tmp/ArduPilotMega.build/ArduPilotMega.eep'
../mk//Arduino.mk:642: warning: overriding recipe for target `/tmp/ArduPilotMega.build/arduino/core.a'
../libraries/AP_Common/Arduino.mk:428: warning: ignoring old recipe for target `/tmp/ArduPilotMega.build/arduino/core.a'
../mk//Arduino.mk:663: warning: overriding recipe for target `/tmp/ArduPilotMega.build/ArduPilotMega.cpp'
../libraries/AP_Common/Arduino.mk:449: warning: ignoring old recipe for target `/tmp/ArduPilotMega.build/ArduPilotMega.cpp'
../mk/targets.mk:65: warning: overriding recipe for target `etags'
%% ArduPilotMega.o
../mk//targets.mk:65: warning: ignoring old recipe for target `etags'
In file included from ../sketchbook/libraries/AP_GPS/AP_GPS.h:7:0,
                 from ../sketchbook/ArduPilotMega/ArduPilotMega.pde:30:
../sketchbook/libraries/AP_GPS/AP_GPS_SIRF.h:26:0: warning: ignoring #pragma pack
../sketchbook/libraries/AP_GPS/AP_GPS_SIRF.h:64:0: warning: ignoring #pragma pack
In file included from ../sketchbook/libraries/AP_GPS/AP_GPS.h:9:0,
                 from ../sketchbook/ArduPilotMega/ArduPilotMega.pde:30:
../sketchbook/libraries/AP_GPS/AP_GPS_UBLOX.h:28:0: warning: ignoring #pragma pack
../sketchbook/libraries/AP_GPS/AP_GPS_UBLOX.h:77:0: warning: ignoring #pragma pack
In file included from ../sketchbook/libraries/AP_GPS/AP_GPS.h:10:0,
                 from ../sketchbook/ArduPilotMega/ArduPilotMega.pde:30:
../sketchbook/libraries/AP_GPS/AP_GPS_MTK.h:28:0: warning: ignoring #pragma pack
../sketchbook/libraries/AP_GPS/AP_GPS_MTK.h:39:0: warning: ignoring #pragma pack
In file included from ../sketchbook/libraries/AP_GPS/AP_GPS.h:11:0,
                 from ../sketchbook/ArduPilotMega/ArduPilotMega.pde:30:
../sketchbook/libraries/AP_GPS/AP_GPS_MTK16.h:27:0: warning: ignoring #pragma pack
../sketchbook/libraries/AP_GPS/AP_GPS_MTK16.h:41:0: warning: ignoring #pragma pack
autogenerated:1:33: error: operator '&&' has no right operand
In file included from ../sketchbook/libraries/AP_GPS/AP_GPS.h:15:0,
                 from ../sketchbook/ArduPilotMega/ArduPilotMega.pde:30:
../sketchbook/libraries/AP_GPS/AP_GPS_Shim.h: In member function 'virtual bool AP_GPS_Shim::read()':
../sketchbook/libraries/AP_GPS/AP_GPS_Shim.h:24:8: warning: unused variable 'updated'
In file included from ../sketchbook/ArduPilotMega/ArduPilotMega.pde:39:0:
../sketchbook/libraries/PID/PID.h: In member function 'void PID::operator()(float, float, float, int16_t)':
../sketchbook/libraries/PID/PID.h:107:39: warning: declaration of 'imax' shadows a member of 'this'
In file included from ../sketchbook/ArduPilotMega/ArduPilotMega.pde:44:0:
../sketchbook/libraries/GCS_MAVLink/GCS_MAVLink.h: In function 'void comm_send_ch(mavlink_channel_t, uint8_t)':
../sketchbook/libraries/GCS_MAVLink/GCS_MAVLink.h:28:11: warning: enumeration value 'MAVLINK_COMM_2' not handled in switch
../sketchbook/libraries/GCS_MAVLink/GCS_MAVLink.h:28:11: warning: enumeration value 'MAVLINK_COMM_3' not handled in switch
../sketchbook/libraries/GCS_MAVLink/GCS_MAVLink.h:28:11: warning: enumeration value 'MAVLINK_COMM_NB' not handled in switch
../sketchbook/libraries/GCS_MAVLink/GCS_MAVLink.h:28:11: warning: enumeration value 'MAVLINK_COMM_NB_HIGH' not handled in switch
../sketchbook/libraries/GCS_MAVLink/GCS_MAVLink.h: In function 'uint8_t comm_receive_ch(mavlink_channel_t)':
../sketchbook/libraries/GCS_MAVLink/GCS_MAVLink.h:47:11: warning: enumeration value 'MAVLINK_COMM_2' not handled in switch
../sketchbook/libraries/GCS_MAVLink/GCS_MAVLink.h:47:11: warning: enumeration value 'MAVLINK_COMM_3' not handled in switch
../sketchbook/libraries/GCS_MAVLink/GCS_MAVLink.h:47:11: warning: enumeration value 'MAVLINK_COMM_NB' not handled in switch
../sketchbook/libraries/GCS_MAVLink/GCS_MAVLink.h:47:11: warning: enumeration value 'MAVLINK_COMM_NB_HIGH' not handled in switch
../sketchbook/libraries/GCS_MAVLink/GCS_MAVLink.h: In function 'uint16_t comm_get_available(mavlink_channel_t)':
../sketchbook/libraries/GCS_MAVLink/GCS_MAVLink.h:65:11: warning: enumeration value 'MAVLINK_COMM_2' not handled in switch
../sketchbook/libraries/GCS_MAVLink/GCS_MAVLink.h:65:11: warning: enumeration value 'MAVLINK_COMM_3' not handled in switch
../sketchbook/libraries/GCS_MAVLink/GCS_MAVLink.h:65:11: warning: enumeration value 'MAVLINK_COMM_NB' not handled in switch
../sketchbook/libraries/GCS_MAVLink/GCS_MAVLink.h:65:11: warning: enumeration value 'MAVLINK_COMM_NB_HIGH' not handled in switch
../sketchbook/ArduPilotMega/ArduPilotMega.pde: In function 'void __vector_25()':
../sketchbook/ArduPilotMega/ArduPilotMega.pde:63:1: warning: comparison between signed and unsigned integer expressions
../sketchbook/ArduPilotMega/ArduPilotMega.pde: In function 'void __vector_36()':
../sketchbook/ArduPilotMega/ArduPilotMega.pde:64:1: warning: comparison between signed and unsigned integer expressions
../sketchbook/ArduPilotMega/ArduPilotMega.pde: In function 'void __vector_54()':
../sketchbook/ArduPilotMega/ArduPilotMega.pde:65:1: warning: comparison between signed and unsigned integer expressions
../sketchbook/ArduPilotMega/Attitude.pde: In function 'void stabilize()':
../sketchbook/ArduPilotMega/Attitude.pde:9:14: warning: unused variable 'temp'
../sketchbook/ArduPilotMega/GCS_Mavlink.pde: In member function 'void GCS_MAVLINK::handleMessage(mavlink_message_t*)':
../sketchbook/ArduPilotMega/GCS_Mavlink.pde:469:21: warning: unused variable 'type'
../sketchbook/ArduPilotMega/GCS_Mavlink.pde:564:21: warning: unused variable 'loadAction'
../sketchbook/ArduPilotMega/Log.pde: In function 'int8_t help_log(uint8_t, const Menu::arg*)':
../sketchbook/ArduPilotMega/Log.pde:30:1: warning: no return statement in function returning non-void
../sketchbook/ArduPilotMega/Log.pde: In function 'int8_t erase_logs(uint8_t, const Menu::arg*)':
../sketchbook/ArduPilotMega/Log.pde:136:1: warning: no return statement in function returning non-void
../sketchbook/ArduPilotMega/Log.pde: In function 'int8_t select_logs(uint8_t, const Menu::arg*)':
../sketchbook/ArduPilotMega/Log.pde:157:21: warning: operation on 'bits' may be undefined
../sketchbook/ArduPilotMega/Log.pde: In function 'int8_t process_logs(uint8_t, const Menu::arg*)':
../sketchbook/ArduPilotMega/Log.pde:185:1: warning: no return statement in function returning non-void
../sketchbook/ArduPilotMega/Log.pde: In function 'void start_new_log(byte)':
../sketchbook/ArduPilotMega/Log.pde:225:6: warning: unused variable 'page'
../sketchbook/ArduPilotMega/Log.pde:228:7: warning: unused variable 'data'
../sketchbook/ArduPilotMega/Log.pde: In function 'void get_log_boundaries(byte, byte, int&, int&)':
../sketchbook/ArduPilotMega/Log.pde:283:11: warning: declaration of 'byte num_logs' shadows a parameter
../sketchbook/ArduPilotMega/Log.pde:260:30: warning: shadowed declaration is here
../sketchbook/ArduPilotMega/Log.pde: In function 'int find_last_log_page(int)':
../sketchbook/ArduPilotMega/Log.pde:312:15: warning: comparison between signed and unsigned integer expressions
../sketchbook/ArduPilotMega/climb_rate.pde: In function 'void add_altitude_data(long unsigned int, long int)':
../sketchbook/ArduPilotMega/climb_rate.pde:21:16: warning: unused variable 'i'
../sketchbook/ArduPilotMega/climb_rate.pde:22:6: warning: unused variable 'dx'
../sketchbook/ArduPilotMega/commands_process.pde: In function 'void change_command(uint8_t)':
../sketchbook/ArduPilotMega/commands_process.pde:5:34: warning: declaration of 'index' shadows a global declaration
../sketchbook/ArduPilotMega/climb_rate.pde:7:15: warning: shadowed declaration is here
../sketchbook/ArduPilotMega/planner.pde: In function 'int8_t planner_mode(uint8_t, const Menu::arg*)':
../sketchbook/ArduPilotMega/planner.pde:23:1: warning: no return statement in function returning non-void
../sketchbook/ArduPilotMega/planner.pde: In function 'int8_t planner_gcs(uint8_t, const Menu::arg*)':
../sketchbook/ArduPilotMega/planner.pde:47:1: warning: no return statement in function returning non-void
../sketchbook/ArduPilotMega/radio.pde: In function 'void throttle_failsafe(uint16_t)':
../sketchbook/ArduPilotMega/radio.pde:116:14: warning: comparison between signed and unsigned integer expressions
../sketchbook/ArduPilotMega/setup.pde: In function 'int8_t setup_mode(uint8_t, const Menu::arg*)':
../sketchbook/ArduPilotMega/setup.pde:44:1: warning: no return statement in function returning non-void
../sketchbook/ArduPilotMega/setup.pde: In function 'int8_t setup_show(uint8_t, const Menu::arg*)':
../sketchbook/ArduPilotMega/setup.pde:51:11: warning: unused variable 'i'
../sketchbook/ArduPilotMega/setup.pde: In function 'int8_t setup_factory(uint8_t, const Menu::arg*)':
../sketchbook/ArduPilotMega/setup.pde:77:11: warning: unused variable 'i'
../sketchbook/ArduPilotMega/setup.pde: In function 'int8_t setup_flightmodes(uint8_t, const Menu::arg*)':
../sketchbook/ArduPilotMega/setup.pde:188:23: warning: declaration of 'oldSwitchPosition' shadows a global declaration
../sketchbook/ArduPilotMega/ArduPilotMega.pde:180:9: warning: shadowed declaration is here
../sketchbook/ArduPilotMega/setup.pde: In function 'int8_t setup_declination(uint8_t, const Menu::arg*)':
../sketchbook/ArduPilotMega/setup.pde:270:1: warning: no return statement in function returning non-void
../sketchbook/ArduPilotMega/setup.pde: In function 'int8_t setup_erase(uint8_t, const Menu::arg*)':
../sketchbook/ArduPilotMega/setup.pde:276:11: warning: unused variable 'i'
../sketchbook/ArduPilotMega/setup.pde: In function 'int8_t setup_compass(uint8_t, const Menu::arg*)':
../sketchbook/ArduPilotMega/setup.pde:296:8: warning: unused variable 'junkbool'
../sketchbook/ArduPilotMega/system.pde: In function 'void init_ardupilot()':
../sketchbook/ArduPilotMega/system.pde:143:8: warning: unused variable 'junkbool'
../sketchbook/ArduPilotMega/system.pde:48:6: warning: unused variable 'last_log_start'
../sketchbook/ArduPilotMega/system.pde:49:6: warning: unused variable 'last_log_end'
../sketchbook/ArduPilotMega/system.pde: In function 'void startup_IMU_ground()':
../sketchbook/ArduPilotMega/system.pde:433:11: warning: unused variable 'store'
../sketchbook/ArduPilotMega/test.pde: In function 'int8_t test_mode(uint8_t, const Menu::arg*)':
../sketchbook/ArduPilotMega/test.pde:72:1: warning: no return statement in function returning non-void
../sketchbook/ArduPilotMega/test.pde: In function 'void test_wp_print(Location*, byte)':
../sketchbook/ArduPilotMega/test.pde:319:47: warning: declaration of 'index' shadows a global declaration
../sketchbook/ArduPilotMega/climb_rate.pde:7:15: warning: shadowed declaration is here
In file included from ../sketchbook/libraries/FastSerial/../AP_Common/AP_Common.h:37:0,
                 from ../sketchbook/libraries/FastSerial/BetterStream.h:16,
                 from ../sketchbook/libraries/FastSerial/FastSerial.h:56,
                 from ../sketchbook/ArduPilotMega/ArduPilotMega.pde:27:
../sketchbook/libraries/FastSerial/../AP_Common/AP_Var.h: In constructor 'AP_VarT<T>::AP_VarT(AP_Var_group*, AP_Var::Key, T, const prog_char_t*, AP_Var::Flags) [with T = float, AP_Var::Key = unsigned int, AP_Var::Flags = unsigned char]':
../sketchbook/libraries/FastSerial/../AP_Common/AP_Var.h:870:63:   instantiated from here
../sketchbook/libraries/FastSerial/../AP_Common/AP_Var.h:514:5: warning: declaration of 'index' shadows a global declaration
../sketchbook/ArduPilotMega/climb_rate.pde:7:15: warning: shadowed declaration is here
In file included from ../sketchbook/libraries/AP_Compass/../AP_Math/AP_Math.h:6:0,
                 from ../sketchbook/libraries/AP_Compass/AP_Compass_HMC5843.h:5,
                 from ../sketchbook/libraries/AP_Compass/AP_Compass.h:6,
                 from ../sketchbook/ArduPilotMega/ArduPilotMega.pde:35:
../sketchbook/libraries/AP_Compass/../AP_Math/vector3.h: In constructor 'Vector3<T>::Vector3() [with T = float]':
../sketchbook/libraries/AP_IMU/IMU.h:18:8:   instantiated from here
../sketchbook/libraries/AP_Compass/../AP_Math/vector3.h:54:17: warning: operation on '((Vector3<float>*)this)->Vector3<float>::x' may be undefined
In file included from ../sketchbook/libraries/FastSerial/../AP_Common/AP_Common.h:37:0,
                 from ../sketchbook/libraries/FastSerial/BetterStream.h:16,
                 from ../sketchbook/libraries/FastSerial/FastSerial.h:56,
                 from ../sketchbook/ArduPilotMega/ArduPilotMega.pde:27:
../sketchbook/libraries/FastSerial/../AP_Common/AP_Var.h: In constructor 'AP_VarT<T>::AP_VarT(AP_Var_group*, AP_Var::Key, T, const prog_char_t*, AP_Var::Flags) [with T = int, AP_Var::Key = unsigned int, AP_Var::Flags = unsigned char]':
../sketchbook/libraries/PID/PID.h:43:47:   instantiated from here
../sketchbook/libraries/FastSerial/../AP_Common/AP_Var.h:514:5: warning: declaration of 'index' shadows a global declaration
../sketchbook/ArduPilotMega/climb_rate.pde:7:15: warning: shadowed declaration is here
../sketchbook/ArduPilotMega/Log.pde: In function 'int8_t dump_log(uint8_t, const Menu::arg*)':
../sketchbook/ArduPilotMega/Log.pde:116:1: warning: control reaches end of non-void function
../sketchbook/ArduPilotMega/commands_logic.pde: In function 'bool verify_may()':
../sketchbook/ArduPilotMega/commands_logic.pde:201:1: warning: control reaches end of non-void function
../sketchbook/ArduPilotMega/Log.pde: At global scope:
../sketchbook/ArduPilotMega/Log.pde:13:15: warning: 'int8_t print_log_menu(uint8_t, const Menu::arg*)' declared 'static' but never defined
make: *** [/tmp/ArduPilotMega.build/ArduPilotMega.o] Error 1

**** Build Finished ****

最佳答案

对于某些构建环境,这似乎是ArduPilot的最新版本的已知问题。

Issue reported Jan 2, 2013

07-26 03:19