Hi Fellows,
I am following the instructions on http://ardupilot.org/dev/docs/sitl-native-on-windows.html#sitl-native-on-windows to set up the SITL on the Windows and I ran into the problems, firstly,
git clone git://github.com/ArduPilot/ardupilot.git did not check out all the files needed. i.e. dsdl in the uavcan
is empty, therefore I have to check it out separately, secondly, there are compile error: please refer to the message below:
v.xian@SOPENG-VINCENT ~/ardupilot/ArduCopter
$ make sitl -j4
Checking modules
%% libraries/AP_Param/AP_Param.o
%% libraries/GCS_MAVLink/GCS_MAVLink.o
// BUILDROOT=/tmp/ArduCopter.build HAL_BOARD=HAL_BOARD_SITL HAL_BOARD_SUBTYPE=HAL_BOARD_SUBTYPE_NONE TOOLCHAIN=NATIVE EXTRAFLAGS=-DGIT_VERSION="78442b7e" -I/home/v.xian/ardupilot/libraries/AP_Common/missing -DHAVE_CMATH_ISFINITE -DNEED_CMATH_ISFINITE_STD_NAMESPACE
%% libraries/GCS_MAVLink/MAVLink_routing.o
In file included from /home/v.xian/ardupilot/libraries/AP_Math/AP_Math.h:17:0,
from /home/v.xian/ardupilot/libraries/GCS_MAVLink/GCS_MAVLink.h:9,
from /home/v.xian/ardupilot/libraries/GCS_MAVLink/GCS.h:10,
from /home/v.xian/ardupilot/libraries/GCS_MAVLink/GCS_MAVLink.cpp:23:
/home/v.xian/ardupilot/libraries/AP_Math/quaternion.h: In member function 'bool Quaternion::is_nan() const':
/home/v.xian/ardupilot/libraries/AP_Math/quaternion.h:51:24: error: 'isnan' was not declared in this scope
return isnan(q1) || isnan(q2) || isnan(q3) || isnan(q4);
^
compilation terminated due to -Wfatal-errors.
In file included from /home/v.xian/ardupilot/libraries/AP_Math/AP_Math.h:17:0,
from /home/v.xian/ardupilot/libraries/AP_Param/AP_Param.cpp:32:
/home/v.xian/ardupilot/libraries/AP_Math/quaternion.h: In member function 'bool Quaternion::is_nan() const':
/home/v.xian/ardupilot/libraries/AP_Math/quaternion.h:51:24: error: 'isnan' was not declared in this scope
return isnan(q1) || isnan(q2) || isnan(q3) || isnan(q4);
^
compilation terminated due to -Wfatal-errors.
C:/cygwin/home/v.xian/ardupilot/mk/build_rules.mk:27: recipe for target '/tmp/ArduCopter.build/libraries/GCS_MAVLink/GCS_MAVLink.o' failed
make: *** [/tmp/ArduCopter.build/libraries/GCS_MAVLink/GCS_MAVLink.o] Error 1
make: *** Waiting for unfinished jobs....
C:/cygwin/home/v.xian/ardupilot/mk/build_rules.mk:27: recipe for target '/tmp/ArduCopter.build/libraries/AP_Param/AP_Param.o' failed
make: *** [/tmp/ArduCopter.build/libraries/AP_Param/AP_Param.o] Error 1
In file included from /home/v.xian/ardupilot/libraries/AP_Math/AP_Math.h:17:0,
from /home/v.xian/ardupilot/libraries/GCS_MAVLink/GCS_MAVLink.h:9,
from /home/v.xian/ardupilot/libraries/GCS_MAVLink/GCS.h:10,
from /home/v.xian/ardupilot/libraries/GCS_MAVLink/MAVLink_routing.cpp:24:
/home/v.xian/ardupilot/libraries/AP_Math/quaternion.h: In member function 'bool Quaternion::is_nan() const':
/home/v.xian/ardupilot/libraries/AP_Math/quaternion.h:51:24: error: 'isnan' was not declared in this scope
return isnan(q1) || isnan(q2) || isnan(q3) || isnan(q4);
^
compilation terminated due to -Wfatal-errors.
C:/cygwin/home/v.xian/ardupilot/mk/build_rules.mk:27: recipe for target '/tmp/ArduCopter.build/libraries/GCS_MAVLink/MAVLink_routing.o' failed
What did I do wrong?
Thank you in advance with best regards
Vincent
make: *** [/tmp/ArduCopter.build/libraries/GCS_MAVLink/MAVLink_routing.o] Error 1
Replies
SOLUTION
@pjmosquera
In mk directory you have board_native.mk file. Edit it and in line 6, replace :
EXTRAFLAGS += -DHAVE_CMATH_ISFINITE -DNEED_CMATH_ISFINITE_STD_NAMESPACE
withEXTRAFLAGS += -DHAVE_CMATH_ISFINITE -DNEED_CMATH_ISFINITE_STD_NAMESPACE -DHAVE_CMATH_ISINF -DNEED_CMATH_ISINF_STD_NAMESPACE -DHAVE_CMATH_ISNAN -DNEED_CMATH_ISNAN_STD_NAMESPACE
You should be able to run
make sitl -j4
Same issue, may use achmadz solution but dont know if I compile for pix4 I will get correct build
I'm in the same boat. Just wanted to comment to show some activity on this.
Replacing all call to isnan and isinf with std::isnan and std::isinf seems to put a band-aid on it...
http://www.ahowto.net/mt_rand/cygwin-failed-to-build-ardupilot-beca...