2012-09-10 7 views
2

Windows 용 파이썬 넷립을 빌드하려고합니다. Microsoft Visual C++ Express 2010 버전을 사용하고 있습니다. 내가 명령 파이썬 setup.py를 실행하면 내가 다음 로그 및 오류를 얻을 설치 :netifaces를 빌드 할 수 없습니다.

내가 무엇을 놓치고 나쁜 포맷 에 대한
running install 
running bdist_egg 
running egg_info 
writing netifaces.egg-info\PKG-INFO 
writing top-level names to netifaces.egg-info\top_level.txt 
writing dependency_links to netifaces.egg-info\dependency_links.txt 
reading manifest file 'netifaces.egg-info\SOURCES.txt' 
writing manifest file 'netifaces.egg-info\SOURCES.txt' 
installing library code to build\bdist.win32\egg 
running install_lib 
running build_ext 
building 'netifaces' extension 
c:\Program Files\Microsoft Visual Studio 10.0\VC\BIN\cl.exe /c /nologo /Ox /MD/
W3 /GS- /DNDEBUG -DWIN32=1 -DNETIFACES_VERSION=0.8 -Ic:\python27\include -Ic:\py 
thon27\PC /Tcnetifaces.c /Fobuild\temp.win32-2.7\Release\netifaces.obj 
netifaces.c 
netifaces.c(410) : error C2275: 'PyObject' : illegal use of this type as an expr 
ession 
     c:\python27\include\object.h(108) : see declaration of 'PyObject' 
netifaces.c(411) : error C2275: 'PyObject' : illegal use of this type as an expr 
ession 
     c:\python27\include\object.h(108) : see declaration of 'PyObject' 
netifaces.c(720) : error C2275: 'PyObject' : illegal use of this type as an expr 
ession 
     c:\python27\include\object.h(108) : see declaration of 'PyObject' 
netifaces.c(720) : error C2065: 'dict' : undeclared identifier 
netifaces.c(722) : error C2065: 'dict' : undeclared identifier 
netifaces.c(722) : warning C4047: '=' : 'int' differs in levels of indirection f 
rom 'PyObject *' 
netifaces.c(724) : error C2065: 'dict' : undeclared identifier 
netifaces.c(734) : error C2065: 'dict' : undeclared identifier 
netifaces.c(734) : warning C4047: 'function' : 'PyObject *' differs in levels of 
indirection from 'int' 
netifaces.c(734) : warning C4024: 'PyDict_SetItemString' : different types for f 
ormal and actual parameter 1 
netifaces.c(736) : error C2065: 'dict' : undeclared identifier 
netifaces.c(736) : warning C4047: 'function' : 'PyObject *' differs in levels of 
indirection from 'int' 
netifaces.c(736) : warning C4024: 'PyDict_SetItemString' : different types for f 
ormal and actual parameter 1 
netifaces.c(738) : error C2065: 'dict' : undeclared identifier 
netifaces.c(738) : warning C4047: 'function' : 'PyObject *' differs in levels of 
indirection from 'int' 
netifaces.c(738) : warning C4024: 'PyDict_SetItemString' : different types for f 
ormal and actual parameter 1 
netifaces.c(744) : error C2065: 'dict' : undeclared identifier 
netifaces.c(744) : warning C4047: 'function' : 'PyObject *' differs in levels of 
indirection from 'int' 
netifaces.c(744) : warning C4024: 'add_to_family' : different types for formal a 
nd actual parameter 3 
error: command '"c:\Program Files\Microsoft Visual Studio 10.0\VC\BIN\cl.exe"' f 
ailed with exit status 2 

미안?

답변

1

netifaces.c의 이름을 netifaces.cpp로 바꾸고 (그에 따라 setup.py를 업데이트하십시오).

그 이유는 .c 확장자를 사용하면 MSVC가이 파일을 C89를 준수한다고 해석하기 때문입니다.이 파일은 netifaces.c가 따르지 않습니다. 여기에 자세한 정보 : error C2275 : illegal use of this type as an expression

관련 문제