Installable MathLink Programs

The Mathematica system provides a convenient way to call functions in external C and other programs. With a .tm template specifying Mathematica functions corresponding to each C function, you build a MathLink-installable binary using mprep or mcc. You can exchange not only C-like data types such as integers, reals, arrays, and strings, but also arbitrary Mathematica expressions.

ReferenceReference

Install load a MathLink installable executable to call from your Mathematica session

Uninstall close down a MathLink executable, removing its Mathematica functions

LinkPatterns find functions available in a running MathLink program

., tm template file for connecting C and Mathematica functions

mprep preprocess .tm files to generate compiled C programs (Windows)

mcc complete command-line script for building MathLink programs (Unix, Mac OS X)

C Language Functions »

MLMain() special version of main() for MathLink-installable C programs

MLEvaluate(), MLEvaluateString() call back from C into Mathematica

MLPutFunction(), MLGetFunction(), ... exchange arbitrary structures

New to Mathematica? Find your learning path »
Have a question? Ask support »