I'm trying to set up an iOS project to compile a c++ library called Eigen for Linear Algebra maths.
I begin following the instructions of the Question mentioned in:
How to compile Eigen in iPhone
But there are still some kind of things I could not figure out.
I just created a ,,singleViewApplication'' and wanted to use the c++ files in an new Objective C class called MathLibary. Because some guys said that it is possible to mix up Objective C and C++ if I name the class MathLibary.hh and MathLibary.mm. The class looks like
#import "MathLibary.hh"
#define EIGEN_DONT_VECTORIZE
#import "SVD.h"
@implementation MathLibary
@end
When I try to run the App the build fails an the compiler gives out some errors like: In line 47 in SVD.h file, which is:
typedef typename NumTraits<typename MatrixType::Scalar>::Real RealScalar;
The error is Expected a qualified name after 'type name'
For me it sounds as that the compiler tries to compile the SVD.h as objective c file but is c++.
I hope that somebody is able to help me, thanks a lot.
go to codeblocks Settings-> complier-> Search Directories-> Add-> enter the address of the folder you chose in (1)-> o.k. declare #include "Eigen/Dense" before the main function.
To install eigen just double click on C:/workspace/eigen-3.3. 4/build-vc14/Eigen3. sln solution file. This action will open eigen project in Visual Studio C++ 14 2015.
ARPACK-Eigen is implemented as a header-only C++ library, whose only dependency, Eigen, is also header-only.
If you want to mix ObjC and C++, did you make sure to rename your file to have a ".mm" suffix? :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With