I would like to compile a console application using the XCode 7.3 GUI. The application would read information from a mat file, and to test it I thought I would try the matlab example diagnose.cpp. It has previously been noted that compiling this outside of Matlab requires specifcation of the path to the libmat.dylib, which in my case is /Applications/MATLAB_R2015b.app/bin/maci64. However I could not find out how to specify this in the Xcode GUI. Any suggestions as to how to do this? I am trying to avoid using the matlab compiler as this results in very slow standalone programs.

 Réponse acceptée

Wayne Xun
Wayne Xun le 26 Juil 2016

1 vote

Hi John
I found a tutorial for XCode 7.2. This is a bit older than your version, but hopefully you'll still be able to follow it. TUTORIAL
Hope this helps

1 commentaire

John Knowles
John Knowles le 27 Juil 2016
Modifié(e) : John Knowles le 27 Juil 2016
Hi Wayne:
That really helped a lot for the mat functions. I never would have figured that out on my own. Now the strange thing is that I am getting errors for failing to link to what I think are mex API functions, even though, following the tutorial, I linked to the LibMex.dylib library also. I show these errors below. For instance mxDestroyArray is listed in the Mathworks page as a function in Matrix.h. I could not find it in there, but that file consists mainly of pre-processor commands, so it could be included from somewhere else.
Am i interpreting these errors correctly as due to a missing lib file? Is there an easy fix? many thanks,
John
Undefined symbols for architecture x86_64:
"_mxDestroyArray", referenced from:
diagnose(char const*) in Diagnose.o
"_mxFree", referenced from:
diagnose(char const*) in Diagnose.o
"_mxGetNumberOfDimensions_730", referenced from:
diagnose(char const*) in Diagnose.o
"_mxIsFromGlobalWS", referenced from:

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Write C Functions Callable from MATLAB (MEX Files) dans Centre d'aide et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by