Note that there are some explanatory texts on larger screens.

plurals
  1. POCompiling Mathematica 8 mathlink.h using gcc
    primarykey
    data
    text
    <p>I'm trying to get my program to talk to Mathematica using MathLink. I'm using cygwin, and mathematica 8.0.</p> <p>I can compile the equivalent of the "AddTwo" program and use it successfully by using the x86_64-w64-mingw32-gcc.exe compiler (as installed with cygwin).</p> <p>However, if I try to use gcc to do the compilation, I have a whole tonne of errors in mathlink.h. Here are the first few lines of what I get:</p> <pre><code>gcc -c -static-libgcc -I/cygdrive/c/Program\ Files/Wolfram\ Research/Mathematica/8.0/SystemFiles/Links/MathLink/DeveloperKit/Windows-x86-64/CompilerAdditions/mldev64/include talk.c In file included from talk.c:1:0: mathlink.h:996:1: error: expected ‘)’ before ‘*’ token mathlink.h:997:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘MLDeviceMain’ </code></pre> <p>The reason that I want to use gcc is that I want to use the gsl libraries in my code. I can use them easily enough with gcc, but I can't for the life of me figure out how to get the mingw compilers working with the gsl libraries. Here are the error messages I get from mingw with gsl:</p> <pre><code>"x86_64-w64-mingw32-gcc.exe" -o Loops.exe ./loops.o -L/usr/lib -lgsl -lgslcblas /usr/lib/gcc/x86_64-w64-mingw32/4.5.3/../../../../x86_64-w64-mingw32/bin/ld: skipping incompatible /usr/lib/libgsl.dll.a when searching for -lgsl /usr/lib/gcc/x86_64-w64-mingw32/4.5.3/../../../../x86_64-w64-mingw32/bin/ld: skipping incompatible /usr/lib/libgsl.a when searching for -lgsl /usr/lib/gcc/x86_64-w64-mingw32/4.5.3/../../../../x86_64-w64-mingw32/bin/ld: skipping incompatible /usr/lib/libgsl.a when searching for -lgsl /usr/lib/gcc/x86_64-w64-mingw32/4.5.3/../../../../x86_64-w64-mingw32/bin/ld: skipping incompatible /usr/lib/libgsl.dll.a when searching for -lgsl /usr/lib/gcc/x86_64-w64-mingw32/4.5.3/../../../../x86_64-w64-mingw32/bin/ld: skipping incompatible /usr/lib/libgsl.a when searching for -lgsl /usr/lib/gcc/x86_64-w64-mingw32/4.5.3/../../../../x86_64-w64-mingw32/bin/ld: cannot find -lgsl /usr/lib/gcc/x86_64-w64-mingw32/4.5.3/../../../../x86_64-w64-mingw32/bin/ld: skipping incompatible /usr/lib/libgslcblas.dll.a when searching for -lgslcblas /usr/lib/gcc/x86_64-w64-mingw32/4.5.3/../../../../x86_64-w64-mingw32/bin/ld: skipping incompatible /usr/lib/libgslcblas.a when searching for -lgslcblas /usr/lib/gcc/x86_64-w64-mingw32/4.5.3/../../../../x86_64-w64-mingw32/bin/ld: skipping incompatible /usr/lib/libgslcblas.a when searching for -lgslcblas /usr/lib/gcc/x86_64-w64-mingw32/4.5.3/../../../../x86_64-w64-mingw32/bin/ld: skipping incompatible /usr/lib/libgslcblas.dll.a when searching for -lgslcblas /usr/lib/gcc/x86_64-w64-mingw32/4.5.3/../../../../x86_64-w64-mingw32/bin/ld: skipping incompatible /usr/lib/libgslcblas.a when searching for -lgslcblas /usr/lib/gcc/x86_64-w64-mingw32/4.5.3/../../../../x86_64-w64-mingw32/bin/ld: cannot find -lgslcblas </code></pre> <p>Any assistance greatly appreciated (I know, I know, go to a *nix machine and everything will work... but I just can't afford another Mathematica license).</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload