Registered Member
|
Hi, I just started to use Eigen lib to do matrix manipulation instead of Matlab.
I start from the example code, it can be compiled in VS 2010
I want to call this function in matlab, therefore modify it:
But it seems like Matlab cannot use the Eigen header files, and gives the following error info
Can anyone give me some clue about how to solve this problem? Or where can i find a tutorial about this? Many thanks!! |
Registered Member
|
Remember: in standard C++ it's "int main", not "void main". // http://www.parashift.com/c++-faq-lite/n ... l#faq-29.3
As for mex, you have to use the -I (that's "I" like "Include") option, just like you had to tell your compiler how to find the directory including Eigen header files: http://www.mathworks.se/help/techdoc/ref/mex.html |
Registered Member
|
Thanks a lot. Your suggestion works! I also tried armdillo lib, it works there too! |
Registered Member
|
Hey i also come across same problem to include eigen library in mex file.
i tried with following code but i am not successful in that. I used below command ... and path is given as shown below:
i am using following in mex file.
Can you please help me as i got following error. Error using mex (line 206) Unable to complete successfully. Error in ex (line 1) mex -I "C:\Program Files (x86)\Eigen\include" mexample.c |
Registered Member
|
For the last post, your path of Eigen headers is wrong.
if your Eigen path is "x:\Eigen" which not only contains the heards but also contans docs and cmake, your mex build command should be
It works for me. Enjoy. |
Registered Member
|
I am having a similar issue. I've used Eigen with mex before but it's been years.
I have the newest Octave install in a Windows (8) computer. Eigen is in x\\eigen-eigen-6b38706d90a9\eigen-eigen-6b38706d90a9 That's where it placed itself when downloaded. If I use the command mex -I"x\\eigen-eigen-6b38706d90a9\eigen-eigen-6b38706d90a9" mexfile.cpp it does not recognize <Eigen/Core>. Oddly I've used the same code before with Octave and the path provided above does not cause problems when included as an include path in a Visual Studio project. Thanks for your help. |
Registered users: Bing [Bot], Evergrowing, Google [Bot], rockscient