Bug building apm planner 2 from source on ubuntu 14.04

Hi!

I’m trying to build from source apm planner following the github information. When doing make I get the following error:

make: *** [build-release/obj/MainWindow.o] Error 1

the full make output is here pastebin.com/0uEB7sUD

I am running ubuntu 14.04 x86_x64.

to be more specific, the error message is:

In file included from src/ui/MainWindow.cc:31:0:
/usr/include/osg/Math: In function ‘bool osg::isNaN(float)’:
src/QGC.h:54:18: error: ‘std::std’ has not been declared
#define isnan(x) std::isnan(x)
^
/usr/include/osg/Math: In function ‘bool osg::isNaN(double)’:
src/QGC.h:54:18: error: ‘std::std’ has not been declared
#define isnan(x) std::isnan(x)
^
make: *** [build-release/obj/MainWindow.o] Error 1

[quote=“keohr”]to be more specific, the error message is:

In file included from src/ui/MainWindow.cc:31:0:
/usr/include/osg/Math: In function ‘bool osg::isNaN(float)’:
src/QGC.h:54:18: error: ‘std::std’ has not been declared
#define isnan(x) std::isnan(x)
^
/usr/include/osg/Math: In function ‘bool osg::isNaN(double)’:
src/QGC.h:54:18: error: ‘std::std’ has not been declared
#define isnan(x) std::isnan(x)
^
make: *** [build-release/obj/MainWindow.o] Error 1[/quote]

Hello

After you pointed to error I did some searching and the file /usr/include/osg/Math has two invalid declarations of std::isnan(). According to this site:

stackoverflow.com/questions/5706 … s-nan-in-c

std::isnan(x) is not defined in the current standard so I just removed std:: from the two entries and it compiled normally. I also filled a bug for that package in ubuntu.

Thanks for your investigation and solution! APM-Planner compiles with no error now.

Just to be clear on what to do for this bug:

sudo cp /usr/include/osg/Math /usr/include/osg/Math.bak
sudo pico /usr/include/osg/Math

Then find and remove “std::” x 2 in “std::isnan”

carry on with compile.

tarek : )