在Windows上使用Mathematica 10构建用于Python的mathlink.pyd

2024-05-08 15:33:10 发布

您现在位置:Python中文网/ 问答频道 /正文

显然,mathlinkpython扩展已经有一段时间没有更新了。如下所示,它没有链接到正确的库。此外,API似乎已经更新,而mathlink源代码没有更新。在

C:\Program Files\Wolfram Research\Mathematica\10.0\SystemFiles\Links\Python
>python setup.py build
running build
running build_ext
building 'mathlink' extension
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\cl.exe /c /nologo /Ox
 /MD /W3 /GS- /DNDEBUG -DWINDOWS_MATHLINK "-IC:\Program Files\Wolfram Research\M
athematica\10.0\SystemFiles\Links\MathLink\DeveloperKit\Windows\CompilerAddition
s\mldev32\include" -Ic:\Python27\include -Ic:\Python27\PC /Tcmathlink.c /Fobuild
\temp.win32-2.7\Release\mathlink.obj
mathlink.c
mathlink.c(1473) : warning C4013: 'MLDisownByteString' undefined; assuming exter n returning int
mathlink.c(1555) : warning C4013: 'MLDisownString' undefined; assuming extern returning int
mathlink.c(1885) : warning C4013: 'MLDisownSymbol' undefined; assuming extern returning int
mathlink.c(2094) : warning C4013: 'MLDisownIntegerList' undefined; assuming extern returning int
mathlink.c(2167) : warning C4013: 'MLDisownRealList' undefined; assuming extern returning int
mathlink.c(2238) : warning C4013: 'MLDisownIntegerArray' undefined; assuming extern returning int
mathlink.c(2259) : warning C4013: 'MLDisownRealArray' undefined; assuming extern returning int
mathlink.c(3861) : warning C4047: 'function' : 'unsigned long' differs in levels of indirection from 'MLParametersPointer'
mathlink.c(3861) : warning C4024: 'MLNewParameters' : different types for formal and actual parameter 1
mathlink.c(3861) : warning C4020: 'MLNewParameters' : too many actual parameters 
mathlink.c(3861) : warning C4047: '=' : 'ulong_ct' differs in levels of indirect ion from 'MLEnvironmentParameter'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\link.exe /DLL /nologo
 /INCREMENTAL:NO "/LIBPATH:C:\Program Files\Wolfram Research\Mathematica\10.0\Sy
stemFiles\Links\MathLink\DeveloperKit\Windows\CompilerAdditions\mldev32\lib" /LI
BPATH:c:\Python27\libs /LIBPATH:c:\Python27\PCbuild ml32i3m.lib /EXPORT:initmath
link build\temp.win32-2.7\Release\mathlink.obj /OUT:build\lib.win32-2.7\mathlink
.pyd /IMPLIB:build\temp.win32-2.7\Release\mathlink.lib /MANIFESTFILE:build\temp.
win32-2.7\Release\mathlink.pyd.manifest Creating library build\temp.win32-2.7\Release\mathlink.lib and object build\temp.win32-2.7\Release\mathlink.exp
mathlink.obj : error LNK2019: unresolved external symbol _MLDisownByteString referenced in function _mathlink_GetLong
mathlink.obj : error LNK2019: unresolved external symbol _MLDisownString referenced in function _mathlink_GetString
mathlink.obj : error LNK2019: unresolved external symbol _MLDisownSymbol referenced in function _mathlink_GetSymbol
mathlink.obj : error LNK2019: unresolved external symbol _MLDisownIntegerList referenced in function _mathlink_GetIntegerList
mathlink.obj : error LNK2019: unresolved external symbol _MLDisownRealList referenced in function _mathlink_GetFloatList
mathlink.obj : error LNK2019: unresolved external symbol _MLDisownIntegerArray referenced in function _mathlink_GetIntArray
mathlink.obj : error LNK2019: unresolved external symbol _MLDisownRealArray referenced in function _mathlink_GetFloatArray
mathlink.obj : error LNK2019: unresolved external symbol _MLNewParameters@8 referenced in function _Env_Alloc
build\lib.win32-2.7\mathlink.pyd : fatal error LNK1120: 8 unresolved externals
error: command '"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\link
.exe"' failed with exit status 1120

有什么建议,谢谢。在


Tags: inbuildobjfunctionerrorsymbolexternalwin32