x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Android compiler won't recognise double-precision math functions?

In order to get around some issue we've been having with floats, I've had to create a double-precision float library for our game, which essentially just calls the 'double' versions of the functions called in 'FMath'.

For example, FMath::Sin() just calls sin - whereas my version FMathD::Sin() calls sinl. Here's the full code:

     static FORCEINLINE double Sin(double Value) { return sinl(Value); }
     static FORCEINLINE double Asin(double Value) { return asinl((Value<-1.0) ? -0.0 : ((Value<0.0) ? Value : 0.0)); }
     static FORCEINLINE double Cos(double Value) { return cosl(Value); }
     static FORCEINLINE double Acos(double Value) { return acosl((Value<-1.0) ? -1.0 : ((Value<1.0) ? Value : 1.0)); }
     static FORCEINLINE double Tan(double Value) { return tanl(Value); }
     static FORCEINLINE double Atan2(double X, double Y) { return atan2l(X, Y); }
     static FORCEINLINE double Atan(double Value) { return atanl(Value); }
     static FORCEINLINE double Pow(double A, double B) { return powl(A, B); }
 
     static FORCEINLINE double Fmod(double X, double Y) { return fmodl(X, Y); }
 
     static FORCEINLINE double Loge(double X) { return logl(X); }


This builds and works perfectly for Windows (and fixes our problems) - but it won't build for Android. When compiling, I get the following errors:

 MainFrameActions: Packaging (Android (ATC)): UnrealBuildTool: E:/P4/JBaxter_Main/Stormtide/SatSim/SatSim_Main/Source\GESGame/Utilities/DMath.h(20,16) :  error: use of undeclared identifier 'sqrtl'
 MainFrameActions: Packaging (Android (ATC)): UnrealBuildTool:                 return 1.0 / sqrtl(D);
 MainFrameActions: Packaging (Android (ATC)): UnrealBuildTool:                              ^
 MainFrameActions: Packaging (Android (ATC)): UnrealBuildTool: E:/P4/JBaxter_Main/Stormtide/SatSim/SatSim_Main/Source\GESGame/Utilities/DMath.h(24,10) :  error: use of undeclared identifier 'sqrtl'
 MainFrameActions: Packaging (Android (ATC)): UnrealBuildTool:                 return sqrtl(D);
 MainFrameActions: Packaging (Android (ATC)): UnrealBuildTool:                        ^
 MainFrameActions: Packaging (Android (ATC)): UnrealBuildTool: E:/P4/JBaxter_Main/Stormtide/SatSim/SatSim_Main/Source\GESGame/Utilities/DMath.h(77,55) :  error: use of undeclared identifier 'sinl'
 MainFrameActions: Packaging (Android (ATC)): UnrealBuildTool:         static FORCEINLINE double Sin(double Value) { return sinl(Value); }
 MainFrameActions: Packaging (Android (ATC)): UnrealBuildTool:                                                              ^
 MainFrameActions: Packaging (Android (ATC)): UnrealBuildTool: E:/P4/JBaxter_Main/Stormtide/SatSim/SatSim_Main/Source\GESGame/Utilities/DMath.h(78,56) :  error: use of undeclared identifier 'asinl'
 MainFrameActions: Packaging (Android (ATC)): UnrealBuildTool:         static FORCEINLINE double Asin(double Value) { return asinl((Value<-1.0) ? -0.0 : ((Value<0.0) ? Value : 0.0)); }
 MainFrameActions: Packaging (Android (ATC)): UnrealBuildTool:                                                               ^
 MainFrameActions: Packaging (Android (ATC)): UnrealBuildTool: E:/P4/JBaxter_Main/Stormtide/SatSim/SatSim_Main/Source\GESGame/Utilities/DMath.h(79,55) :  error: use of undeclared identifier 'cosl'
 MainFrameActions: Packaging (Android (ATC)): UnrealBuildTool:         static FORCEINLINE double Cos(double Value) { return cosl(Value); }
 MainFrameActions: Packaging (Android (ATC)): UnrealBuildTool:                                                              ^
 MainFrameActions: Packaging (Android (ATC)): UnrealBuildTool: E:/P4/JBaxter_Main/Stormtide/SatSim/SatSim_Main/Source\GESGame/Utilities/DMath.h(80,56) :  error: use of undeclared identifier 'acosl'
 MainFrameActions: Packaging (Android (ATC)): UnrealBuildTool:         static FORCEINLINE double Acos(double Value) { return acosl((Value<-1.0) ? -1.0 : ((Value<1.0) ? Value : 1.0)); }
 MainFrameActions: Packaging (Android (ATC)): UnrealBuildTool:                                                               ^
 MainFrameActions: Packaging (Android (ATC)): UnrealBuildTool: E:/P4/JBaxter_Main/Stormtide/SatSim/SatSim_Main/Source\GESGame/Utilities/DMath.h(81,55) :  error: use of undeclared identifier 'tanl'
 MainFrameActions: Packaging (Android (ATC)): UnrealBuildTool:         static FORCEINLINE double Tan(double Value) { return tanl(Value); }
 MainFrameActions: Packaging (Android (ATC)): UnrealBuildTool:                                                              ^
 MainFrameActions: Packaging (Android (ATC)): UnrealBuildTool: E:/P4/JBaxter_Main/Stormtide/SatSim/SatSim_Main/Source\GESGame/Utilities/DMath.h(82,63) :  error: use of undeclared identifier 'atan2l'
 MainFrameActions: Packaging (Android (ATC)): UnrealBuildTool:         static FORCEINLINE double Atan2(double X, double Y) { return atan2l(X, Y); }
 MainFrameActions: Packaging (Android (ATC)): UnrealBuildTool:                                                                      ^
 MainFrameActions: Packaging (Android (ATC)): UnrealBuildTool: E:/P4/JBaxter_Main/Stormtide/SatSim/SatSim_Main/Source\GESGame/Utilities/DMath.h(83,56) :  error: use of undeclared identifier 'atanl'
 MainFrameActions: Packaging (Android (ATC)): UnrealBuildTool:         static FORCEINLINE double Atan(double Value) { return atanl(Value); }
 MainFrameActions: Packaging (Android (ATC)): UnrealBuildTool:                                                               ^
 MainFrameActions: Packaging (Android (ATC)): UnrealBuildTool: E:/P4/JBaxter_Main/Stormtide/SatSim/SatSim_Main/Source\GESGame/Utilities/DMath.h(84,61) :  error: use of undeclared identifier 'powl'
 MainFrameActions: Packaging (Android (ATC)): UnrealBuildTool:         static FORCEINLINE double Pow(double A, double B) { return powl(A, B); }
 MainFrameActions: Packaging (Android (ATC)): UnrealBuildTool:                                                                    ^
 MainFrameActions: Packaging (Android (ATC)): UnrealBuildTool: E:/P4/JBaxter_Main/Stormtide/SatSim/SatSim_Main/Source\GESGame/Utilities/DMath.h(86,62) :  error: use of undeclared identifier 'fmodl'
 MainFrameActions: Packaging (Android (ATC)): UnrealBuildTool:         static FORCEINLINE double Fmod(double X, double Y) { return fmodl(X, Y); }
 MainFrameActions: Packaging (Android (ATC)): UnrealBuildTool:                                                                     ^
 MainFrameActions: Packaging (Android (ATC)): UnrealBuildTool: E:/P4/JBaxter_Main/Stormtide/SatSim/SatSim_Main/Source\GESGame/Utilities/DMath.h(88,52) :  error: use of undeclared identifier 'logl'
 MainFrameActions: Packaging (Android (ATC)): UnrealBuildTool:         static FORCEINLINE double Loge(double X) { return logl(X); }
 MainFrameActions: Packaging (Android (ATC)): UnrealBuildTool:                                                           ^
 MainFrameActions: Packaging (Android (ATC)): UnrealBuildTool: 12 errors generated.

Is there something I need to include to allow this to work? I've tried math.h - but to no avail.

Product Version: UE 4.11 Preview
Tags:
more ▼

asked Mar 14 '16 at 06:33 PM in C++ Programming

avatar image

TheJamsh
820 60 97 140

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question