Tag Info

New 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} ...


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 ...



Top 50 recent answers are included