我试图让我的程序使用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从 非常感谢任何帮助(我知道,我知道,去一台* nix机器,一切都会工作......但我只能买得起另一个Mathematica许可证。)"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