首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >如何为Mac构建和安装P4Python?

如何为Mac构建和安装P4Python?
EN

Stack Overflow用户
提问于 2008-10-03 18:38:40
回答 3查看 2K关注 0票数 2

我一直无法为Intel Mac 10.5.5构建P4Python

以下是我的步骤:

  1. I下载了p4python.tgz (从http://filehost.perforce.com/perforce/r07.3/tools/下载),并将其展开为下载的p4api.tar (从http://filehost.perforce.com/perforce/r07.3/bin.macosx104x86/),并将其展开为P4Python,将"p4api-2007.3.143793“放入"P4Python-2007.3”中,并编辑setup.cfg以设置"p4_api=./p4api-2007.3.143793".
  2. I将'extra_link_args = "-framework","Carbon"‘行添加到setup.py中,如下所示:

self.architecture(unameOut4)

  • I unameOut == "Darwin":unix = "MACOSX“release = "104”platform = elif运行python setup.py build并获得:

$ python setup.py内部版本

API Release 2007.3
running build
running build_py
running build_ext
building 'P4API' extension
gcc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -DID_OS="MACOSX104X86" -DID_REL="2007.3" -DID_PATCH="151416" -DID_API="2007.3" -DID_Y="2008" -DID_M="04" -DID_D="09" -I./p4api-2007.3.143793 -I./p4api-2007.3.143793/include/p4 -I/build/toolchain/mac32/python-2.4.3/include/python2.4 -c P4API.cpp -o build/temp.darwin-9.5.0-i386-2.4/P4API.o -DOS_MACOSX -DOS_MACOSX104 -DOS_MACOSXX86 -DOS_MACOSX104X86
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for C/ObjC but not for C++
P4API.cpp: In function âint P4Adapter_init(P4Adapter*, PyObject*, PyObject*)â:
P4API.cpp:105: error: âPy_ssize_tâ was not declared in this scope
P4API.cpp:105: error: expected `;' before âposâ
P4API.cpp:107: error: âposâ was not declared in this scope
P4API.cpp: In function âPyObject* P4Adapter_run(P4Adapter*, PyObject*)â:
P4API.cpp:177: error: âPy_ssize_tâ was not declared in this scope
P4API.cpp:177: error: expected `;' before âiâ
P4API.cpp:177: error: âiâ was not declared in this scope
error: command 'gcc' failed with exit status 1

which gcc returns /usr/bin/gcc和gcc -v returns:

Using built-in specs.
Target: i686-apple-darwin9
Configured with: /var/tmp/gcc/gcc-5465~16/src/configure
--disable-checking -enable-werror --prefix=/usr --mandir=/share/man
--enable-languages=c,objc,c++,obj-c++
--program-transform-name=/^[cg][^.-]*$/s/$/-4.0/
--with-gxx-include-dir=/include/c++/4.0.0 --with-slibdir=/usr/lib
--build=i686-apple-darwin9 --with-arch=apple --with-tune=generic
--host=i686-apple-darwin9 --target=i686-apple-darwin9
Thread model: posix
gcc version 4.0.1 (Apple Inc. build 5465)

python -V返回Python2.4.3。

EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/168273

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档