Tag Info

Hot answers tagged

3

tl; dr Report errors through return values. MathLink programs can return any Mathematica expression they like which makes structured error handling possible. It looks like you have a function that returns integers with a template like :Begin: :Function: get_number :Pattern: getNumber[x_Integer] :Arguments: {x} :ArgumentTypes: {Integer32} ...


2

This is a linking error, not a compilation error. It occurs because the linker can't find MLEvaluate(): the documentation states that MLEvaluate() is only available for use in mprep MathLink template programs. That's because this function is defined in the C source output by mprep when processing a template files. Template files apply only when you ...


1

I guess that this is a linkage issue. The generated output.tm.c file is compiled a C code whereas "your code" is compiled as C++ code. Thus the function output will have C++ linkage while the function __tr0 expects the function to have C linkage. In your C++ code, declare the function with C linkage using extern "C", i.e.: #include "mathlink.h" using ...



Only top voted, non community-wiki answers of a minimum length are eligible