0

If you create a new Native Android Application (or OpenGLES Project template), include , and use any of the math functions included with it (powf, ldexpl, sqrt, etc...) then you get an undefined reference to that method.

Another user had the same issue here, but their solutions did not work for me.

I'm using Visual Studio 2019. Does anyone know how to get around this issue?

szMuzzyA
  • 136
  • 13
  • And have you added `-lm` to your libs? – Amadeus Oct 18 '19 at 01:37
  • That did it! Thanks! Post it as an answer and I will accept it. Is there a reference somewhere that mentions the '-lm' command? – szMuzzyA Oct 18 '19 at 01:45
  • Well this is a common library to be included when using math library. For a better explanation: https://stackoverflow.com/questions/1033898/why-do-you-have-to-link-the-math-library-in-c – Amadeus Oct 18 '19 at 01:46
  • https://developer.android.com/ndk/guides/stable_apis.html#c_library tells you there is a separate libm "(following the usual Unix tradition), but like libc this is automatically linked by the build systems." – Botje Oct 18 '19 at 08:53
  • Maybe I have been spoiled by Visual Studio C++ projects because I've never had to link anything to use a math library in my 10 years of programming. – szMuzzyA Oct 18 '19 at 21:10

0 Answers0