Mathematica 9 is now available
Student Support Forum
Student Support Forum: 'How to use MathLink with Win7 and MinGW?' topicStudent Support Forum > General > Archives > "How to use MathLink with Win7 and MinGW?"

Help | Reply To Topic
Author Comment/Response
05/24/10 12:33pm


I'd like to write a C-Function for Mathematica.
So I've read the Mathematica 7 documentation and found MathLink.

My first program looks like this example:

So I've created the the c and the tm file.
After compiling the tm file with "mprep" to a new c file "exec.c" I tried to compile the output file with the gcc standard compiler (MinGW) "gcc exec.c -o program" and received a bunch of errors like "...undifiend reference to `MLDeinitialize@4"'.
Unfortunately, I do not know how to prevent these errors.

Maybe it has something to do with missing DLL files... I have not copied the dll files from MathLink (from the Mathematica MatheLink directory) to anywhere, because I do not exactly know where to put them.
I only added the "mathlink.h" file to the MinGW directory (it's working fine).

I use Mathematica 7 on a Windows 7 PC (32-bit). If it is possible I do not want to install programs like Cygwin (for running mcc) or Visual Studio 8 (I just found tutorials for both but not for MinGW).

Please note that I am quite a newbie with MathLink.

Could somebody help me out?


URL: ,
Help | Reply To Topic