juancarlostinoco / ardupilot-mega

Automatically exported from code.google.com/p/ardupilot-mega
0 stars 0 forks source link

cmake of ArduPlane broken in git version #600

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. mkdir build && cd build && cmake .. -DBOARD=mega -DPORT=/dev/ttyUSB0
2. make ArduPlane-upload

What is the expected output? What do you see instead?

[ 98%] Built target mega_memcheck
Scanning dependencies of target ArduPlane
[100%] Building CXX object CMakeFiles/ArduPlane.dir/ArduPlane/ArduPlane.cpp.obj
In file included from 
/home/andre/ardupilot-mega/build/ArduPlane/ArduPlane.cpp:34:0:
/usr/share/arduino/libraries/SPI/SPI.h:25:0: warning: "SPI_CLOCK_DIV64" 
redefined
/usr/share/arduino/libraries/SPI/SPI.h:20:0: note: this is the location of the 
previous definition
/home/andre/ardupilot-mega/build/ArduPlane/ArduPlane.cpp:473:40: error: 
redefinition of ‘ModeFilterInt16_Size5 sonar_mode_filter’
/home/andre/ardupilot-mega/build/ArduPlane/ArduPlane.cpp:100:40: error: 
‘ModeFilterInt16_Size5 sonar_mode_filter’ previously declared here

What version of the product are you using? On what operating system?

error should be platform independent (but I do use Ubuntu/linux). Other errors 
were reported on OSX.

Please provide any additional information below.

There is a workaround: in line 235 of ArduPlane.pde replace

ModeFilterInt16_Size5 sonar_mode_filter(2);

by

ModeFilter<int16_t,5> sonar_mode_filter(2);

(essentially replacing the typedef which seems to make problems for the arduino 
cmake toolchain)

Original issue reported on code.google.com by andre.sc...@gmail.com on 12 Apr 2012 at 8:00

GoogleCodeExporter commented 8 years ago
I get this too.

I just go to the arduplane.cpp and comment out the first ModeFilterInt16_Size5.
Then another error will pop up about set_fence... not defined in scope and I 
comment out that line as well.

I don't know how to fix it, but I know how to get it to compile.

Original comment by lith...@gmail.com on 16 Apr 2012 at 2:52