Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

To resolve issues starting MATLAB on Mac OS X 10.10 (Yosemite) visit: http://www.mathworks.com/matlabcentral/answers/159016

Creating a static library using the .mex command

Asked by uli terlinden on 5 Feb 2013

Hello, i wanted to ask if someone can tell me how to create a static library by using the mex-command (?)

Thanks in advance,

Uli

0 Comments

uli terlinden

Tags

Products

1 Answer

Answer by José-Luis on 5 Feb 2013
Edited by José-Luis on 6 Feb 2013
Accepted answer

That would depend on the compiler you use. Just compile some object files ( /c option for visual studio, -c for gcc). Then you could use your favorite utility ( ar in *nix systems, no idea for Windows) to create your static library, which is after all only a collection of object files.

This might help you understand how to set the compiler options.

2 Comments

uli terlinden on 8 Feb 2013

Well, that means i have to pass the same arguments as by "making" the library by foot ?? I wondered if there is a "special" mex-option or a command, that will create a static library (no matter what compiler i use... just like "mex" itself, as it is so to say "compilerindependent"). I know how to get this done so far on *nix systems... so i think i have to find out how to do it with VS ... Thanks for the answer, it helped me a lot and motivates me find out more about VS.

Greetings,

Uli

José-Luis on 8 Feb 2013

I am not aware of such a function, sorry. Good luck in your job!

José-Luis

Contact us