安装asyncio backport trollius时出现gcc错误(Python 2.7.5和Win7)

时间:2014-03-01 17:34:34

标签: python python-2.7 python-asyncio

我无法安装asyncio backport trollius。从文档中,我必须:“...首先构建_overlapped.pyd扩展名(它将放在asyncio目录中):”

PS C:\Users\M1330\Downloads\trollius-0.1.6> python setup.py build_ext
running build_ext
building 'asyncio._overlapped' extension
creating build
creating build\temp.win32-2.7
creating build\temp.win32-2.7\Release
C:\WinPython\tools\mingw32\bin\gcc.exe -mdll -O -Wall -IC:\WinPython\python-2.7.5\include -IC:\WinPython\python-2.7.5\PC -c overlapped.c -o build\temp.win32-2.7\Release\overlapped.o
overlapped.c:105:1: error: unknown type name 'LPFN_ACCEPTEX'
overlapped.c:105:36: warning: initialization makes integer from pointer without a cast [enabled by default]
overlapped.c:106:1: error: unknown type name 'LPFN_CONNECTEX'
overlapped.c:106:38: warning: initialization makes integer from pointer without a cast [enabled by default]
overlapped.c:107:1: error: unknown type name 'LPFN_DISCONNECTEX'
overlapped.c:107:44: warning: initialization makes integer from pointer without a cast [enabled by default]
overlapped.c: In function 'initialize_function_pointers':
overlapped.c:118:25: error: 'WSAID_ACCEPTEX' undeclared (first use in this function)
overlapped.c:118:25: note: each undeclared identifier is reported only once for each function it appears in
overlapped.c:119:26: error: 'WSAID_CONNECTEX' undeclared (first use in this function)
overlapped.c:120:29: error: 'WSAID_DISCONNECTEX' undeclared (first use in this function)
overlapped.c: In function 'overlapped_RegisterWaitWithQueue':
overlapped.c:293:5: warning: implicit declaration of function 'RegisterWaitForSingleObject' [-Wimplicit-function-declaration]
overlapped.c:294:38: error: 'WAITORTIMERCALLBACK' undeclared (first use in this function)
overlapped.c:294:58: error: expected ')' before 'PostToQueueCallback'
overlapped.c: In function 'overlapped_UnregisterWait':
overlapped.c:320:5: warning: implicit declaration of function 'UnregisterWait' [-Wimplicit-function-declaration]
overlapped.c: In function 'Overlapped_dealloc':
overlapped.c:583:21: warning: unknown conversion type character 'R' in format [-Wformat]
overlapped.c:583:21: warning: too many arguments for format [-Wformat-extra-args]
overlapped.c: In function 'Overlapped_AcceptEx':
overlapped.c:959:22: error: called object 'Py_AcceptEx' is not a function
overlapped.c: In function 'Overlapped_ConnectEx':
overlapped.c:1046:23: error: called object 'Py_ConnectEx' is not a function
overlapped.c: In function 'Overlapped_DisconnectEx':
overlapped.c:1086:26: error: called object 'Py_DisconnectEx' is not a function
overlapped.c: In function 'Overlapped_WaitNamedPipeAndConnect':
overlapped.c:1224:5: warning: implicit declaration of function 'QueueUserWorkItem' [-Wimplicit-function-declaration]
overlapped.c: In function '_init_overlapped':
overlapped.c:1410:5: error: 'SO_UPDATE_CONNECT_CONTEXT' undeclared (first use in this function)
overlapped.c: At top level:
overlapped.c:256:1: warning: 'PostToQueueCallback' defined but not used [-Wunused-function]
overlapped.c:517:1: warning: 'Overlapped_doc' defined but not used [-Wunused-variable]
error: command 'gcc' failed with exit status 1

未声明的变量和类型名称。我知道小C,我在这里想念的是什么?

1 个答案:

答案 0 :(得分:1)

您可以安装Microsoft SDK来构建Python扩展,请参阅: http://haypo-notes.readthedocs.org/misc.html#compile-python-extensions-on-windows

注意:我是Trollius的作者。您可以通过电子邮件与我联系。