无法在cygwin上安装pycurl:缺少openssl符号CRYPTO_num_locks等

时间:2014-05-15 19:56:00

标签: openssl pycurl

我正在尝试在Windows 7 Cygwin上安装pycurl。我在该环境中运行easy_install,但是命令

easy_install pycurl

给出了一堆未定义的符号错误:

/tmp/easy_install-A69Atd/pycurl-7.19.3.1/src/pycurl.c:688: undefined reference to `CRYPTO_set_id_callback'
/tmp/easy_install-A69Atd/pycurl-7.19.3.1/src/pycurl.c:688:(.text+0x70f): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `CRYPTO_set_id_callback'
/tmp/easy_install-A69Atd/pycurl-7.19.3.1/src/pycurl.c:689: undefined reference to `CRYPTO_set_locking_callback'
/tmp/easy_install-A69Atd/pycurl-7.19.3.1/src/pycurl.c:689:(.text+0x716): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `CRYPTO_set_locking_callback'
build/temp.cygwin-1.7.29-x86_64-2.7/src/pycurl.o: In function `pycurl_ssl_init':
/tmp/easy_install-A69Atd/pycurl-7.19.3.1/src/pycurl.c:671: undefined reference to `CRYPTO_num_locks'
/tmp/easy_install-A69Atd/pycurl-7.19.3.1/src/pycurl.c:671:(.text+0xaf7c): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `CRYPTO_num_locks'
/tmp/easy_install-A69Atd/pycurl-7.19.3.1/src/pycurl.c:679: undefined reference to `CRYPTO_set_id_callback'
/tmp/easy_install-A69Atd/pycurl-7.19.3.1/src/pycurl.c:679:(.text+0xafd3): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `CRYPTO_set_id_callback'
/tmp/easy_install-A69Atd/pycurl-7.19.3.1/src/pycurl.c:680: undefined reference to `CRYPTO_set_locking_callback'
/tmp/easy_install-A69Atd/pycurl-7.19.3.1/src/pycurl.c:680:(.text+0xafdf): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `CRYPTO_set_locking_callback'

有关解决方法的任何想法吗?

1 个答案:

答案 0 :(得分:1)

库中setup.py缺少-lcrypto

class ExtensionConfiguration(object):
    def __init__(self):
        self.include_dirs = []
        self.define_macros = [("PYCURL_VERSION", '"%s"' % VERSION)]
        self.library_dirs = []
        self.libraries = [] 

更改self.libraries以包含crypto

self.libraries = ["crypto"]