2

I am using VS2015 RC and the cross platform C++ Shared Library Template. Under the .Shared code I added a simple point class. When it created the class, in the .cpp it included pch.h or a pre-compiled header that is only available in .android and not .ios. That threw an error, so I just removed that so I didn't get errors and figured I could include my STL items as needed. Hopefully that is the correct route for that.

Anyway my main issue is In the Point.cpp file I need to use sqrt so I need to include math.h:

#include <math.h>

I have tried including it several different ways (cmath...), but no matter what I get the error myprojectname.iOS: Error: cannot open source file "math.h". According to the setting sin the project properties for .iOS Use STL is LLVM C== standard library with C++11 support (libc++).

I am not sure how to add the correct include directory for iOS this is the first time I've written a cross platform library and done any iOS development.

From what I've read all the STL classes are available on both platforms. Any help with any of it would be great. Too bad there isn't a full tutorial on making a simple math library that you then use in an Android and ios app.

JasonMArcher
  • 14,195
  • 22
  • 56
  • 52
  • I have a C++ shared project (which has includes from boost) and an iOS static library which has a reference to the shared project. My problem is that I didn't succeed on building the library on MAC, because I don't know how to specify to the compiler a path where to search for the boost include files. I tried to modify the properties of the iOS static library, but without success. If I put the boost include files near the files from of the static library, copied to the MAC during the building process, the build succeeds. I don't like that. @MusicMonkey5555 do you have another solution? – Raluca Pandaru Feb 28 '17 at 17:30

0 Answers0