建设m2crypto:7个未解决的外部

时间:2013-05-01 13:51:09

标签: build openssl windows-7-x64 python-3.3 m2crypto

我尝试为win-amd64-py3.3构建M2Cryptogithub):

python setup.py build --compiler msvc

我有一个链接器未解决的外部符号错误(full log):

C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\amd64\link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:D:\Programy\Python33\libs /LIBPATH:D:\Programy\Python33\PCbuild\amd64 /LIBPATH:c:\pkg\lib ssleay32.lib libeay32.lib /EXPORT:PyInit___m2crypto build\temp.win-amd64-3.3\Release\SWIG/_m2crypto_wrap.obj /OUT:build\lib.win-amd64-3.3\M2Crypto\__m2crypto.pyd /IMPLIB:build\temp.win-amd64-3.3\Release\SWIG\__m2crypto.lib /MANIFESTFILE:build\temp.win-amd64-3.3\Release\SWIG\__m2crypto.pyd.manifest
_m2crypto_wrap.obj : warning LNK4197: export 'PyInit___m2crypto' specified multiple times; using first specification
Creating library build\temp.win-amd64-3.3\Release\SWIG\__m2crypto.lib and object build\temp.win-amd64-3.3\Release\SWIG\__m2crypto.exp
_m2crypto_wrap.obj : error LNK2019: unresolved external symbol PyString_AsStringAndSize referenced in function m2_PyString_AsStringAndSizeInt
_m2crypto_wrap.obj : error LNK2019: unresolved external symbol PyString_FromStringAndSize referenced in function bn_to_mpi
_m2crypto_wrap.obj : error LNK2019: unresolved external symbol PyInt_AS_LONG referenced in function asn1_integer_set
_m2crypto_wrap.obj : error LNK2019: unresolved external symbol PyBuffer_New referenced in function ec_key_get_public_der
_m2crypto_wrap.obj : error LNK2019: unresolved external symbol PyFile_AsFile referenced in function _wrap_err_print_errors_fp
_m2crypto_wrap.obj : error LNK2019: unresolved external symbol PyFile_Check referenced in function _wrap_err_print_errors_fp
_m2crypto_wrap.obj : error LNK2019: unresolved external symbol PyInstance_New referenced in function ssl_verify_callback
build\lib.win-amd64-3.3\M2Crypto\__m2crypto.pyd : fatal error LNK1120: 7 unresolved externals

发生了什么事?我正在使用Win64 OpenSSL v1.0.1e。我需要较旧的库吗?

1 个答案:

答案 0 :(得分:0)

从完整的日志开始,它看起来像第一个问题是编译器无法找到python c头文件。然后链接器找不到python库。也许cl.exe的选项不好(不应该是/ID:\...而不是-ID:\...?)或者你没有安装python头文件。