gpt4 book ai didi

python - 在 Windows 上构建 pjsua python

转载 作者:太空宇宙 更新时间:2023-11-03 23:47:46 25 4
gpt4 key购买 nike

我正在尝试使用 Visual Studio 2012 在 Windows 中构建 _pjsua C 扩展。

我从这里下载了源代码 - http://www.pjsip.org/download.htm .

我安装了 Python27,并将 C:\Python27\includeC:\Python27\libs 目录添加到项目 includelibrary 目录。

我按照此处的说明操作 - https://trac.pjsip.org/repos/wiki/Python_SIP/Build_Install .

带有 Visual Studio 的 Microsoft Windows 中,在 第 1 步:构建 C 扩展 下,它说:

Visual Studio 2005:

1. Open pjproject-vs8.sln from the PJSIP distribution directory.

2. Select either Debug or Release from the build configuration
Note: the Python module does not support other build configurations.

3. In Visual Studio, right click python_pjsua project from the Solution Explorer panel, and select Build from the pop-up menu.
Note: the python_pjsua project is not built by default if you build the solution, hence it needs to be built manually by right-clicking and select Build from the pop-up menu.

4. The _pjsua.pyd Python module will be placed in pjsip-apps\lib directory.
or in case of debug, it will be _pjsua_d.pyd

在第 3 步(构建 python_pjsua 项目)中出现错误

pjsua error lnk1181 cannot open input file python24.lib

C:/Python27/libs 我有文件 python27.lib

此 C 扩展是否仅适用于 Python 2.4 (python24)??

提前致谢

最佳答案

不,不是这样。您可以使用简单的技巧:复制python27.lib并将其重命名为python24.lib,然后将其放入C:/Python27/libs文件夹。现在您可以构建扩展,然后在 cmd python setup-vc.py install 命令中运行。

关于python - 在 Windows 上构建 pjsua python,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28656559/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com