在Windows上构建pjsua python

2024-10-02 22:35:01 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试在windows中使用visualstudio2012构建_pjsuac扩展。在

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

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

我按照这里的说明-https://trac.pjsip.org/repos/wiki/Python_SIP/Build_Install。在

在Microsoft Windows with Visual Studio中的步骤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项目)中,我得到了错误

^{pr2}$

C:/Python27/libs中,我有一个文件Python27.lib。在

这个C扩展只适用于python2.4(python24)吗??在

提前谢谢


Tags: the项目fromorgbuild目录includebe
2条回答

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

正确的解决方案是:

  1. 打开python_pjsua属性页(右键单击->属性)
  2. 链接器->输入->其他依赖项。在
  3. 将python24.lib更改为python27.lib(如果调试,则将python24_d.lib更改为python27_d.lib)。在

它应该可以正常工作和编译。在

相关问题 更多 >