How can I see the command-line options that the mex() command passes to the C compiler?

4 vues (au cours des 30 derniers jours)
Jason S
Jason S le 9 Août 2013
I would like to see what command-line the mex() command passes to the C compiler. How can I do this?
  1 commentaire
Jason S
Jason S le 9 Août 2013
(p.s. I have a more specific purpose; I'm sharing a semiportable .h file with another project, and I need to #ifdef out some lines when the mex() compiler is used.)

Connectez-vous pour commenter.

Réponses (1)

Jan
Jan le 10 Août 2013
Try the debugging:
mex -v ...
If the C-file needs to consider a compilation from a mex command, you can explicitly create a flag:
mex -DCalledFromMex ...
And in the C-code:
#ifdef CalledFromMex

Catégories

En savoir plus sur Write C Functions Callable from MATLAB (MEX Files) dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by