Issues compiling ArduPlane from Emlid repository

What am I doing wrong here?

pi@navio-rpi ~/ardupilot $ git branch
* master
pi@navio-rpi ~/ardupilot $ cd ArduPlane/
pi@navio-rpi ~/ardupilot/ArduPlane $ make configure
../mk/configure.mk:2: WARNING - A /home/pi/ardupilot/config.mk file has been written
../mk/configure.mk:2: Please edit the file to match your system configuration, if you use a different board or port
pi@navio-rpi ~/ardupilot/ArduPlane $ make navio
// BUILDROOT=/tmp/ArduPlane.build HAL_BOARD=HAL_BOARD_LINUX HAL_BOARD_SUBTYPE=HAL_BOARD_SUBTYPE_LINUX_NAVIO TOOLCHAIN=RPI EXTRAFLAGS=-DGIT_VERSION="405862bd"
building /tmp/ArduPlane.build/ArduPlane.cpp
%% ArduPlane.cpp
%% ArduPlane.o
autogenerated:103:14: warning: 'void Log_Write_Mode(uint8_t)' declared 'static' but never defined [-Wunused-function]
autogenerated:207:14: warning: 'bool create_mixer_file(const char*)' declared 'static' but never defined [-Wunused-function]
autogenerated:208:14: warning: 'bool setup_failsafe_mixing()' declared 'static' but never defined [-Wunused-function]
%% libraries/APM_Control/AP_AutoTune.o
%% libraries/APM_Control/AP_SteerController.o
%% libraries/APM_Control/AP_YawController.o
%% libraries/APM_Control/AP_RollController.o
%% libraries/APM_Control/AP_PitchController.o
%% libraries/APM_OBC/APM_OBC.o
%% libraries/AP_ADC/AP_ADC.o
%% libraries/AP_ADC/AP_ADC_ADS1115.o
/home/pi/ardupilot/libraries/AP_ADC/AP_ADC_ADS1115.h: In constructor 'AP_ADC_ADS1115::AP_ADC_ADS1115()':
/home/pi/ardupilot/libraries/AP_ADC/AP_ADC_ADS1115.h:38:25: warning: 'AP_ADC_ADS1115::_i2c_sem' will be initialized after [-Wreorder]
/home/pi/ardupilot/libraries/AP_ADC/AP_ADC_ADS1115.h:35:25: warning:   'int AP_ADC_ADS1115::_channel_to_read' [-Wreorder]
/home/pi/ardupilot/libraries/AP_ADC/AP_ADC_ADS1115.cpp:109:1: warning:   when initialized here [-Wreorder]
%% libraries/AP_ADC/AP_ADC_HIL.o
%% libraries/AP_ADC/AP_ADC_ADS7844.o
%% libraries/AP_ADC_AnalogSource/AP_ADC_AnalogSource.o
%% libraries/AP_AHRS/AP_AHRS_DCM.o
%% libraries/AP_AHRS/AP_AHRS.o
%% libraries/AP_AHRS/AP_AHRS_NavEKF.o
%% libraries/AP_Airspeed/AP_Airspeed_I2C.o
%% libraries/AP_Airspeed/Airspeed_Calibration.o
%% libraries/AP_Airspeed/AP_Airspeed_analog.o
%% libraries/AP_Airspeed/AP_Airspeed.o
%% libraries/AP_Airspeed/AP_Airspeed_PX4.o
%% libraries/AP_Arming/AP_Arming.o
%% libraries/AP_Baro/AP_Baro.o
%% libraries/AP_Baro/AP_Baro_HIL.o
%% libraries/AP_Baro/AP_Baro_PX4.o
%% libraries/AP_Baro/AP_Baro_MS5611.o
/home/pi/ardupilot/libraries/AP_Baro/AP_Baro_MS5611.h: In constructor 'AP_SerialBus_SPI::AP_SerialBus_SPI(AP_HAL::SPIDevice, AP_HAL::SPIDeviceDriver::bus_speed)':
/home/pi/ardupilot/libraries/AP_Baro/AP_Baro_MS5611.h:53:28: warning: 'AP_SerialBus_SPI::_device' will be initialized after [-Wreorder]
/home/pi/ardupilot/libraries/AP_Baro/AP_Baro_MS5611.h:52:45: warning:   'AP_HAL::SPIDeviceDriver::bus_speed AP_SerialBus_SPI::_speed' [-Wreorder]
/home/pi/ardupilot/libraries/AP_Baro/AP_Baro_MS5611.cpp:42:1: warning:   when initialized here [-Wreorder]
%% libraries/AP_Baro/AP_Baro_Backend.o
%% libraries/AP_Baro/AP_Baro_BMP085.o
%% libraries/AP_BattMonitor/AP_BattMonitor_Backend.o
%% libraries/AP_BattMonitor/AP_BattMonitor_SMBus_I2C.o
%% libraries/AP_BattMonitor/AP_BattMonitor_Analog.o
%% libraries/AP_BattMonitor/AP_BattMonitor.o
%% libraries/AP_BattMonitor/AP_BattMonitor_SMBus_PX4.o
%% libraries/AP_BoardConfig/AP_BoardConfig.o
%% libraries/AP_Camera/AP_Camera.o
%% libraries/AP_Common/AP_Common.o
%% libraries/AP_Common/c++.o
%% libraries/AP_Compass/Compass_learn.o
%% libraries/AP_Compass/AP_Compass_HIL.o
%% libraries/AP_Compass/AP_Compass_HMC5843.o
/home/pi/ardupilot/libraries/AP_Compass/AP_Compass_HMC5843.h: In constructor 'AP_Compass_HMC5843::AP_Compass_HMC5843(Compass&)':
/home/pi/ardupilot/libraries/AP_Compass/AP_Compass_HMC5843.h:34:25: warning: 'AP_Compass_HMC5843::_compass_instance' will be initialized after [-Wreorder]
/home/pi/ardupilot/libraries/AP_Compass/AP_Compass_HMC5843.h:22:25: warning:   'uint32_t AP_Compass_HMC5843::_retry_time' [-Wreorder]
/home/pi/ardupilot/libraries/AP_Compass/AP_Compass_HMC5843.cpp:61:1: warning:   when initialized here [-Wreorder]
%% libraries/AP_Compass/AP_Compass_PX4.o
%% libraries/AP_Compass/AP_Compass_Backend.o
%% libraries/AP_Compass/Compass.o
/home/pi/ardupilot/libraries/AP_Compass/Compass.h: In constructor 'Compass::Compass()':
/home/pi/ardupilot/libraries/AP_Compass/Compass.h:292:17: warning: 'Compass::_thr_or_curr' will be initialized after [-Wreorder]
/home/pi/ardupilot/libraries/AP_Compass/Compass.h:261:17: warning:   'uint8_t Compass::_backend_count' [-Wreorder]
/home/pi/ardupilot/libraries/AP_Compass/Compass.cpp:277:1: warning:   when initialized here [-Wreorder]
%% libraries/AP_Compass/AP_Compass_AK8963.o
%% libraries/AP_Declination/AP_Declination.o
%% libraries/AP_Frsky_Telem/AP_Frsky_Telem.o
%% libraries/AP_GPS/AP_GPS_UBLOX.o
%% libraries/AP_GPS/AP_GPS_NMEA.o
%% libraries/AP_GPS/AP_GPS_SIRF.o
%% libraries/AP_GPS/GPS_Backend.o
%% libraries/AP_GPS/AP_GPS_SBP.o
%% libraries/AP_GPS/AP_GPS.o
%% libraries/AP_GPS/AP_GPS_MTK19.o
%% libraries/AP_GPS/AP_GPS_MTK.o
%% libraries/AP_GPS/AP_GPS_PX4.o
%% libraries/AP_HAL/UARTDriver.o
%% libraries/AP_HAL/Util.o
%% libraries/AP_HAL_AVR/AnalogIn_ADC.o
%% libraries/AP_HAL_AVR/GPIO.o
%% libraries/AP_HAL_AVR/Semaphores.o
%% libraries/AP_HAL_AVR/SPIDevice_SPI2.o
%% libraries/AP_HAL_AVR/UARTDriver.o
%% libraries/AP_HAL_AVR/Storage.o
%% libraries/AP_HAL_AVR/I2CDriver.o
%% libraries/AP_HAL_AVR/RCOutput_APM2.o
%% libraries/AP_HAL_AVR/Scheduler_Timer.o
%% libraries/AP_HAL_AVR/SPIDevice_SPI0.o
%% libraries/AP_HAL_AVR/RCOutput_APM1.o
%% libraries/AP_HAL_AVR/HAL_AVR_APM1_Class.o
%% libraries/AP_HAL_AVR/HAL_AVR_APM2_Class.o
%% libraries/AP_HAL_AVR/RCInput_APM1.o
%% libraries/AP_HAL_AVR/RCInput_APM2.o
%% libraries/AP_HAL_AVR/memcheck.o
%% libraries/AP_HAL_AVR/SPIDeviceManager_APM2.o
%% libraries/AP_HAL_AVR/Scheduler.o
%% libraries/AP_HAL_AVR/SPIDevice_SPI3.o
%% libraries/AP_HAL_AVR/AnalogIn_Common.o
%% libraries/AP_HAL_AVR/SPIDeviceManager_APM1.o
%% libraries/AP_HAL_AVR_SITL/SITL_State.o
%% libraries/AP_HAL_AVR_SITL/UARTDriver.o
%% libraries/AP_HAL_AVR_SITL/Storage.o
%% libraries/AP_HAL_AVR_SITL/RCOutput.o
%% libraries/AP_HAL_AVR_SITL/sitl_ins.o
%% libraries/AP_HAL_AVR_SITL/Scheduler.o
%% libraries/AP_HAL_AVR_SITL/sitl_gps.o
%% libraries/AP_HAL_AVR_SITL/sitl_compass.o
%% libraries/AP_HAL_AVR_SITL/HAL_AVR_SITL_Class.o
%% libraries/AP_HAL_AVR_SITL/AnalogIn.o
%% libraries/AP_HAL_AVR_SITL/sitl_barometer.o
%% libraries/AP_HAL_AVR_SITL/RCInput.o
%% libraries/AP_HAL_AVR_SITL/sitl_optical_flow.o
%% libraries/AP_HAL_Empty/GPIO.o
%% libraries/AP_HAL_Empty/Semaphores.o
%% libraries/AP_HAL_Empty/UARTDriver.o
%% libraries/AP_HAL_Empty/Storage.o
%% libraries/AP_HAL_Empty/PrivateMember.o
%% libraries/AP_HAL_Empty/I2CDriver.o
%% libraries/AP_HAL_Empty/SPIDriver.o
%% libraries/AP_HAL_Empty/RCOutput.o
%% libraries/AP_HAL_Empty/Scheduler.o
%% libraries/AP_HAL_Empty/AnalogIn.o
%% libraries/AP_HAL_Empty/RCInput.o
%% libraries/AP_HAL_Empty/HAL_Empty_Class.o
%% libraries/AP_HAL_FLYMAPLE/GPIO.o
%% libraries/AP_HAL_FLYMAPLE/Semaphores.o
%% libraries/AP_HAL_FLYMAPLE/AnalogSource.o
%% libraries/AP_HAL_FLYMAPLE/UARTDriver.o
%% libraries/AP_HAL_FLYMAPLE/Storage.o
%% libraries/AP_HAL_FLYMAPLE/HAL_FLYMAPLE_Class.o
%% libraries/AP_HAL_FLYMAPLE/I2CDriver.o
%% libraries/AP_HAL_FLYMAPLE/SPIDriver.o
%% libraries/AP_HAL_FLYMAPLE/RCOutput.o
%% libraries/AP_HAL_FLYMAPLE/Scheduler.o
%% libraries/AP_HAL_FLYMAPLE/AnalogIn.o
%% libraries/AP_HAL_FLYMAPLE/RCInput.o
%% libraries/AP_HAL_Linux/GPIO.o
%% libraries/AP_HAL_Linux/Scheduler.o
/home/pi/ardupilot/libraries/AP_HAL_Linux/Scheduler.cpp: In member function 'void Linux::LinuxScheduler::_create_realtime_thread(pthread_t*, int, const char*, Linux::LinuxScheduler::pthread_startroutine_t)':
/home/pi/ardupilot/libraries/AP_HAL_Linux/Scheduler.cpp:37:34: error: expected primary-expression before '.' token
/home/pi/ardupilot/libraries/AP_HAL_Linux/Scheduler.cpp: In member function 'virtual void Linux::LinuxScheduler::init(void*)':
/home/pi/ardupilot/libraries/AP_HAL_Linux/Scheduler.cpp:71:34: error: expected primary-expression before '.' token
/home/pi/ardupilot/libraries/AP_HAL_Linux/Scheduler.cpp:80:11: error: expected primary-expression before '.' token
/home/pi/ardupilot/libraries/AP_HAL_Linux/Scheduler.cpp:81:11: error: expected primary-expression before '.' token
/home/pi/ardupilot/libraries/AP_HAL_Linux/Scheduler.cpp:82:11: error: expected primary-expression before '.' token
/home/pi/ardupilot/libraries/AP_HAL_Linux/Scheduler.cpp:83:11: error: expected primary-expression before '.' token
/home/pi/ardupilot/libraries/AP_HAL_Linux/Scheduler.cpp:85:11: error: expected primary-expression before '.' token
/home/pi/ardupilot/libraries/AP_HAL_Linux/Scheduler.cpp:86:11: error: expected primary-expression before '.' token
/home/pi/ardupilot/libraries/AP_HAL_Linux/Scheduler.cpp:87:11: error: expected primary-expression before '.' token
/home/pi/ardupilot/libraries/AP_HAL_Linux/Scheduler.cpp:88:11: error: expected primary-expression before '.' token
/home/pi/ardupilot/libraries/AP_HAL_Linux/Scheduler.cpp:90:11: error: expected primary-expression before '.' token
/home/pi/ardupilot/libraries/AP_HAL_Linux/Scheduler.cpp:91:11: error: expected primary-expression before '.' token
/home/pi/ardupilot/libraries/AP_HAL_Linux/Scheduler.cpp:92:11: error: expected primary-expression before '.' token
/home/pi/ardupilot/libraries/AP_HAL_Linux/Scheduler.cpp:93:11: error: expected primary-expression before '.' token
/home/pi/ardupilot/libraries/AP_HAL_Linux/Scheduler.cpp:95:11: error: expected primary-expression before '.' token
/home/pi/ardupilot/libraries/AP_HAL_Linux/Scheduler.cpp:96:11: error: expected primary-expression before '.' token
/home/pi/ardupilot/libraries/AP_HAL_Linux/Scheduler.cpp:97:11: error: expected primary-expression before '.' token
/home/pi/ardupilot/libraries/AP_HAL_Linux/Scheduler.cpp:98:11: error: expected primary-expression before '.' token
/home/pi/ardupilot/libraries/AP_HAL_Linux/Scheduler.cpp:100:11: error: expected primary-expression before '.' token
/home/pi/ardupilot/libraries/AP_HAL_Linux/Scheduler.cpp:101:11: error: expected primary-expression before '.' token
/home/pi/ardupilot/libraries/AP_HAL_Linux/Scheduler.cpp:102:11: error: expected primary-expression before '.' token
/home/pi/ardupilot/libraries/AP_HAL_Linux/Scheduler.cpp:103:11: error: expected primary-expression before '.' token
../mk/board_native.mk:129: recipe for target '/tmp/ArduPlane.build/libraries/AP_HAL_Linux/Scheduler.o' failed
make: *** [/tmp/ArduPlane.build/libraries/AP_HAL_Linux/Scheduler.o] Error 1

@dmurray14

The intended branch to use with Navio is navio.

Please refer to our guide.

Hey, how about that. Don’t know how I missed that, sorry…

OK, here’s the latest, following the guide exactly:

pi@navio-rpi ~ $ git clone git://github.com/emlid/ardupilot.git
Cloning into 'ardupilot'...
remote: Counting objects: 113274, done.
remote: Total 113274 (delta 0), reused 0 (delta 0), pack-reused 113274
Receiving objects: 100% (113274/113274), 61.33 MiB | 3.59 MiB/s, done.
Resolving deltas: 100% (80216/80216), done.
Checking out files: 100% (2227/2227), done.
pi@navio-rpi ~ $ cd ardupilot/
pi@navio-rpi ~/ardupilot $ ls
APMrover2  AntennaTracker  ArduCopter  ArduPlane  CONTRIBUTING.md  COPYING.txt  Doxyfile.in  FollowMe  MAINTAINERS.md  README.md  Tools  Vagrantfile  docs  libraries  mk  reformat.sh  uncrustify_cpp.cfg  uncrustify_headers.cfg
pi@navio-rpi ~/ardupilot $ git checkout navio
Branch navio set up to track remote branch navio from origin.
Switched to a new branch 'navio'
pi@navio-rpi ~/ardupilot $ cd ArduPlane/
pi@navio-rpi ~/ardupilot/ArduPlane $ make configure
../mk/configure.mk:2: WARNING - A /home/pi/ardupilot/config.mk file has been written
../mk/configure.mk:2: Please edit the file to match your system configuration, if you use a different board or port
pi@navio-rpi ~/ardupilot/ArduPlane $ make navio
// BUILDROOT=/tmp/ArduPlane.build HAL_BOARD=HAL_BOARD_LINUX HAL_BOARD_SUBTYPE=HAL_BOARD_SUBTYPE_LINUX_NAVIO TOOLCHAIN=RPI EXTRAFLAGS=-DGIT_VERSION="f486dd46"
building /tmp/ArduPlane.build/ArduPlane.cpp
%% ArduPlane.cpp
make: *** No rule to make target '/home/pi/ardupilot/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/../common/./mavlink_msg_scaled_imu3.h', needed by '/tmp/ArduPlane.build/ArduPlane.o'.  Stop.

Just tried it with the diydrones repo too, nearly the same error. No idea what I’m doing wrong?

Well, I tried again today using exactly the same commands and it worked…wish I knew why.

Well, that looks strange. Good that it was solved by itself:)

Well, I just attempted this again, same problem is back.

pi@navio-rpi ~/ardupilot/ArduPlane $ make navio
// BUILDROOT=/tmp/ArduPlane.build HAL_BOARD=HAL_BOARD_LINUX HAL_BOARD_SUBTYPE=HAL_BOARD_SUBTYPE_LINUX_NAVIO TOOLCHAIN=RPI EXTRAFLAGS=-DGIT_VERSION="f486dd46"
building /tmp/ArduPlane.build/ArduPlane.cpp
%% ArduPlane.cpp
make: *** No rule to make target '/home/pi/ardupilot/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/../common/./mavlink_msg_scaled_imu3.h', needed by '/tmp/ArduPlane.build/ArduPlane.o'.  Stop.

Would be great if someone can check the guide to see if there’s anything missing.

Further, I’m not sure why I can’t compile ArduPlane-release from the diydrones git. Same error as in OP (expected primary-expression before ‘.’ token) - saw somewhere else online this may be due to an old gcc, tried 4.9 and still the same issue.

I have the same issue when I try to compile on the RPi2. I tried it several times with each variety of Ardupilot. It is always the same error, but for different files. Cross compiling works fine.

Good point @schuermannsebastian, I forgot to mention this is on an RPi2. I just tried cross-compiling and it worked perfectly, thanks.

Would really love to get some fix on this.