I'm trying to build MathLink on a Mac using Mex, according to the instructions included in the MathLink download.
Unfortunately, when I compile
mex(['-I', Mathematica_path, 'Links/MathLink/DeveloperKit/MacOSX-x86-64/CompilerAdditions'], ... ['-L', Mathematica_path, 'Links/MathLink/DeveloperKit/MacOSX-x86-64/CompilerAdditions'], ... ['-l', 'MLi4'], ... ['-I', Mathematica_path, 'IncludeFiles/C'], '-v', ... 'math.c');
I get the error
Error using mex Undefined symbols for architecture x86_64: "_MLDisownDoubleArray", referenced from: _mexFunction in math.o "_MLDisownString", referenced from: _mexFunction in math.o _WaitForReturnPacket in math.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
It seems that libMLi4.a does not contain the DisownDoubleArray or DisownString functions, which is causing the MathLink to fail to compile. Which library should I use to find those functions? (Note I'm using these as a part of Ayonga's FROST toolkit in Matlab, so I think I actually need MathLink, not WSTP) Thanks!
I'm using Mac OS X 10, Matlab R2015b, and Mathematica 11.2.0