Project Home
Project Home
Source Code
Source Code
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
BroadcastCommunity.qnx.com will be offline from May 31 6:00pm until June 2 12:00AM for upcoming system upgrades. For more information please go to https://community.qnx.com/sf/discussion/do/listPosts/projects.bazaar/discussion.bazaar.topc28418
Forum Topic - boost::math::isnan doesn't compile with QNX 6.6 QCC: (3 Items)
   
boost::math::isnan doesn't compile with QNX 6.6 QCC  
Hi,

I found an issue when cross compiling an application that uses the boost::math::isnan function (and possibly other boost
::math::is* functions).

The QCC compiler threw the following error:
/home/me/depot/test/qnx/boost/math.cpp: In function 'int main()':
/home/me/depot/test/qnx/boost/math/math.cpp:6:21: error: expected unqualified-id before '(' token
cc: /opt/qnx660/host/linux/x86/usr/lib/gcc/arm-unknown-nto-qnx6.6.0eabi/4.7.3/cc1plus error 1

Here is the test program (test_math.cpp):
#include <stdio.h>
#include <boost/math/special_functions/fpclassify.hpp>

int main()
{
  if (!boost::math::isnan(5))
  {
    printf("Is not Nan\n");
  }
}

For the build system, I am using cmake, but it can also be reproduced using the following command to compile:
/opt/qnx660/host/linux/x86/usr/bin/QCC  -Vgcc_ntoarmv7le -Wl,-lm -I/home/me/depot/boost_1_55_0 test_math.cpp

Compiler: QNX 6.6 QCC for arm
Boost: 1.55

How can we solve this issue?

Thanks,
Anton
Re: boost::math::isnan doesn't compile with QNX 6.6 QCC  
It's probably because isnan is a macro. Try with (boost::math::isnan)(5) instead. It's explained in the Boost 
documentation:
http://www.boost.org/doc/libs/1_55_0/libs/math/doc/html/math_toolkit/fpclass.html
Re: boost::math::isnan doesn't compile with QNX 6.6 QCC  
> It's probably because isnan is a macro. Try with (boost::math::isnan)(5) 
> instead. It's explained in the Boost documentation:
> http://www.boost.org/doc/libs/1_55_0/libs/math/doc/html/math_toolkit/fpclass.
> html


Hi Niklas,

My bad, I didn't read the boost doc first. 
Thanks for the information, it compiles fine now.

Best regards,
Anton