0

我试图让我的程序使用 MathLink 与 Mathematica 对话。我正在使用cygwin和mathematica 8.0。

我可以编译“AddTwo”程序的等效程序,并通过使用 x86_64-w64-mingw32-gcc.exe 编译器(与 cygwin 一起安装)成功使用它。

但是,如果我尝试使用 gcc 进行编译,我在 mathlink.h 中有一大堆错误。这是我得到的前几行:

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’

我想使用 gcc 的原因是我想在我的代码中使用 gsl 库。我可以很容易地使用 gcc 来使用它们,但是我一辈子都无法弄清楚如何让 mingw 编译器与 gsl 库一起工作。以下是我使用 gsl 从 mingw 收到的错误消息:

"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

非常感谢任何帮助(我知道,我知道,去 *nix 机器,一切都会正常工作......但我买不起另一个 Mathematica 许可证)。

4

0 回答 0