Set up your iOS project to use your own

I'm trying to set up an iOS project to compile a C ++ library called Eigen for linear algebra math.

I am starting to follow the guidance of the Question mentioned in:

How to compile Eigen in iPhone

But there are some other things that I could not understand.

  • Stafan user said to set the correct compiler flags (-mfpu = neon -mfloat-abi = softfp). Where to set these flags? I have already set the flags for one file, for example, at http://meandmark.com/blog/2011/10/xcode-4-setting-compiler-flags-for-a-single-file/ . But for what files do I need to set these flags? In particular, C ++ files from the Eigen library are not displayed here.
  • A Blukee user said he used the optimized armv7 arch in build customization. In the build settings, I see in the "Architecture" category a green field that says that "Standard" (armv7) is that right?

I just created a singleViewApplication '' and wanted to use C ++ files in a new Objective-C class called MathLibary. Because some guys said that you can mix Objective-C and C ++ if I name the class MathLibary.hh and MathLibary.mm. Class looks like

#import "MathLibary.hh" #define EIGEN_DONT_VECTORIZE #import "SVD.h" @implementation MathLibary @end 

When I try to start the application, the assembly fails, the compiler throws some errors, for example: On line 47 in the SVD.h file:

 typedef typename NumTraits<typename MatrixType::Scalar>::Real RealScalar; 

Error: expected expected name after type name

For me, it sounds as if the compiler is trying to compile SVD.h as an object file c, but is C ++.

  1. How to change the compiler to compile both objective c files for the user interface and C ++ files from the library.

I hope someone can help me, thanks.

+4
source share
1 answer

If you want to mix ObjC and C ++, you must rename your file to have the suffix ".mm"? :)

+3
source

Source: https://habr.com/ru/post/1415713/


All Articles