Jump to content


gcc 4.6.1 generates build errors


  • Please log in to reply
3 replies to this topic

#1 Scott

Scott

    Developer

  • Members
  • PipPipPip
  • 93 posts
  • LocationBay Area
  • Country: flag of Australia Australia


Posted 30 January 2012 - 10:00 PM

OS: Ubuntu 11.10 (Oneiric)

I recently installed the latest version of Ubuntu and found that it comes with gcc 4.6.1. This compiler seems to cause errors when compiling flight code (see example below) but I was able to successfully compile using gcc 4.5.3. Thought I would mention this to see if others are having the same problem. If so, we should update the wiki to specify the latest gcc version that is supported. ie. 4.5.3


[color=#000000][font=arial][size=1]
~/code/OpenPilot$ make sim_posix[/size][/font][/color][color=#000000][font=arial][size=1]
make[1]: Nothing to be done for `first'.[/size][/font][/color][color=#000000][font=arial][size=1]
- OpenPilot UAVObject Generator -[/size][/font][/color][color=#000000][font=arial][size=1]
Done: processed 52 XML files and generated 52 objects with no ID collisions. Total size of the data fields is 1765 bytes.[/size][/font][/color][color=#000000][font=arial][size=1]
generating flight code[/size][/font][/color][color=#000000][font=arial][size=1]
**** Compiling C : ../PiOS.posix/posix/Libraries/FreeRTOS/Source/portable/GCC/Posix/port_linux.c to ../../build/sitl_posix/port_linux.o[/size][/font][/color][color=#000000][font=arial][size=1]
""gcc -c  -DDIAGNOSTICS -DUAVOBJ_INIT_accessorydesired  -DUAVOBJ_INIT_actuatorcommand  -DUAVOBJ_INIT_actuatordesired  -DUAVOBJ_INIT_actuatorsettings  -DUAVOBJ_INIT_ahrscalibration  -DUAVOBJ_INIT_ahrssettings  -DUAVOBJ_INIT_ahrsstatus  -DUAVOBJ_INIT_attitudeactual  -DUAVOBJ_INIT_attituderaw  -DUAVOBJ_INIT_baroaltitude  -DUAVOBJ_INIT_flightbatterysettings  -DUAVOBJ_INIT_firmwareiapobj  -DUAVOBJ_INIT_flightbatterystate  -DUAVOBJ_INIT_flightplancontrol  -DUAVOBJ_INIT_flightplansettings  -DUAVOBJ_INIT_flightplanstatus  -DUAVOBJ_INIT_flighttelemetrystats  -DUAVOBJ_INIT_gcstelemetrystats  -DUAVOBJ_INIT_gpsposition  -DUAVOBJ_INIT_gpssatellites  -DUAVOBJ_INIT_gpstime  -DUAVOBJ_INIT_guidancesettings  -DUAVOBJ_INIT_ccguidancesettings  -DUAVOBJ_INIT_homelocation  -DUAVOBJ_INIT_i2cstats  -DUAVOBJ_INIT_manualcontrolcommand  -DUAVOBJ_INIT_manualcontrolsettings  -DUAVOBJ_INIT_mixersettings  -DUAVOBJ_INIT_mixerstatus  -DUAVOBJ_INIT_nedaccel  -DUAVOBJ_INIT_objectpersistence  -DUAVOBJ_INIT_positionactual  -DUAVOBJ_INIT_positiondesired  -DUAVOBJ_INIT_ratedesired  -DUAVOBJ_INIT_sonaraltitude  -DUAVOBJ_INIT_stabilizationdesired  -DUAVOBJ_INIT_stabilizationsettings  -DUAVOBJ_INIT_systemalarms  -DUAVOBJ_INIT_systemsettings  -DUAVOBJ_INIT_systemstats  -DUAVOBJ_INIT_taskinfo  -DUAVOBJ_INIT_velocityactual  -DUAVOBJ_INIT_velocitydesired  -DUAVOBJ_INIT_watchdogstatus  -DUAVOBJ_INIT_flightstatus  -DUAVOBJ_INIT_hwsettings  -DUAVOBJ_INIT_receiveractivity  -DUAVOBJ_INIT_cameradesired  -DUAVOBJ_INIT_camerastabsettings  -DARCH_POSIX -O0 -mtune=i686  -I./System -I./System/inc -I../UAVTalk -I../UAVTalk/inc -I../UAVObjects -I../UAVObjects/inc -I../../build/sitl_posix/../uavobject-synthetics/flight -I../PiOS.posix -I../PiOS.posix/inc -I../Libraries/inc -I../PiOS.posix/posix -I../PiOS.posix/posix/Libraries/FreeRTOS/Source/include -I../PiOS.posix/posix/Libraries -I../PiOS.posix/posix/Libraries/FreeRTOS/Source/portable/GCC/Posix -I../Libraries/PyMite/vm -I../Libraries/PyMite/platform/openpilot_sitl -I../../build/sitl_posix -I../Modules/CameraStab/inc -I../Modules/GPS/inc -I../Modules/Telemetry/inc -I../Modules/Actuator/inc -I../Modules/Stabilization/inc -I../Modules/ManualControl/inc -I../Modules/System/inc -I. -fomit-frame-pointer -Wall -Werror -MD -MP -MF ../../build/sitl_posix/dep/port_linux.o.d -std=gnu99 ../PiOS.posix/posix/Libraries/FreeRTOS/Source/portable/GCC/Posix/port_linux.c -o ../../build/sitl_posix/port_linux.o[/size][/font][/color][color=#000000][font=arial][size=1]
../PiOS.posix/posix/Libraries/FreeRTOS/Source/portable/GCC/Posix/port_linux.c: In function ‘xPortStartScheduler’:[/size][/font][/color][color=#000000][font=arial][size=1]
../PiOS.posix/posix/Libraries/FreeRTOS/Source/portable/GCC/Posix/port_linux.c:204:15: error: variable ‘xResult’ set but not used [-Werror=unused-but-set-variable][/size][/font][/color][color=#000000][font=arial][size=1]
../PiOS.posix/posix/Libraries/FreeRTOS/Source/portable/GCC/Posix/port_linux.c: In function ‘vPortEndScheduler’:[/size][/font][/color][color=#000000][font=arial][size=1]
../PiOS.posix/posix/Libraries/FreeRTOS/Source/portable/GCC/Posix/port_linux.c:255:15: error: variable ‘xResult’ set but not used [-Werror=unused-but-set-variable][/size][/font][/color][color=#000000][font=arial][size=1]
../PiOS.posix/posix/Libraries/FreeRTOS/Source/portable/GCC/Posix/port_linux.c: In function ‘vPortForciblyEndThread’:[/size][/font][/color][color=#000000][font=arial][size=1]
../PiOS.posix/posix/Libraries/FreeRTOS/Source/portable/GCC/Posix/port_linux.c:455:15: error: variable ‘xResult’ set but not used [-Werror=unused-but-set-variable][/size][/font][/color][color=#000000][font=arial][size=1]
../PiOS.posix/posix/Libraries/FreeRTOS/Source/portable/GCC/Posix/port_linux.c: In function ‘prvResumeThread’:[/size][/font][/color][color=#000000][font=arial][size=1]
../PiOS.posix/posix/Libraries/FreeRTOS/Source/portable/GCC/Posix/port_linux.c:581:15: error: variable ‘xResult’ set but not used [-Werror=unused-but-set-variable][/size][/font][/color][color=#000000][font=arial][size=1]
cc1: all warnings being treated as errors[/size][/font][/color]


#2 peabody124

peabody124

    Crash Dummy

  • Administrators
  • 4113 posts
  • LocationHouston, TX
  • Country: flag of United States United States


Posted 30 January 2012 - 10:03 PM

Interestingly the arm gcc 4.6.2 works.

#3 PT_Dreamer

PT_Dreamer

    GCS Core Developer

  • Administrators
  • 1211 posts
  • LocationCaparica, Portugal
  • Country: flag of Portugal Portugal


Posted 30 January 2012 - 10:10 PM

Those aren't real errors, they are just warnings being treated as errors. Just edit the compile flag.
Life is just a game, but atleast the graphics are awesome!

#4 Scott

Scott

    Developer

  • Members
  • PipPipPip
  • 93 posts
  • LocationBay Area
  • Country: flag of Australia Australia


Posted 30 January 2012 - 10:14 PM

Ok. Thanks. I'll look into the compile flag and try 4.6 again.

I'm glad that sim_posix compiles. Are either of you using it for closed loop simulation?