• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: [OT] calling isnan
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [OT] calling isnan


  • Subject: Re: [OT] calling isnan
  • From: Chris Espinosa <email@hidden>
  • Date: Fri, 18 Feb 2005 11:40:32 -0800

On Feb 18, 2005, at 8:51 AM, Fred Bacon wrote:

I've run into a strange problem, and could use some advice.  I have a 

C++ library that I'm porting from linux to Mac OS X.  One of the classes

validates that a floating point number meets certain criteria, i.e. it

must be in the correct value range for the object.  The class makes use

of the function isnan as part of the validation.  On Mac OS X, this is a

macro defined in /usr/include/architecture/ppc/math.h.  You get this

header by simply including math.h in your file.  

However, when I compile the library, the linker says that this function

is undefined.  I've tried including <architecture/ppc/math.h> directly

and still it doesn't work.  I've gone over the include file to see if

something special needs to be defined or undefined to get the macro.  I

can't find anything.  I tried using namespace std.  I've changed the

order of includes in case something else was undefing it.

I had to resort to copying the macro definition from math.h and putting

it into my own header wrapped with an #ifdef (__APPLE__) ... #endif.

Does anyone know what could cause this?


isnan is a macro, so according to the linker, it is undefined.  At some point in your project you are using isnan()x) without having an #include <math.h>.  If the macro isn't defined at the point of use, the compiler assumes it's a function call, and the linker searches in vain for an implementation.


Chris

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: [OT] calling isnan
      • From: Fred Bacon <email@hidden>
References: 
 >[OT] calling isnan (From: Fred Bacon <email@hidden>)

  • Prev by Date: Re: [OT] calling isnan
  • Next by Date: Re: quickly add files to new target?
  • Previous by thread: Re: [OT] calling isnan
  • Next by thread: Re: [OT] calling isnan
  • Index(es):
    • Date
    • Thread