我在 Windows 10 上为 Python 3.x 创建 PJSUA2 包非常困难。我从 pjsip 网站下载了源代码,并且能够毫无问题地编译 C++ 代码,但无法为以下版本构建 PJSUA2 模块: Python。文档提到使用 SWIG,但到目前为止我还没有运气。
当我从
make
运行 ./pjsip-apps/src/swig
时,我得到以下信息:
Makefile:1: ../../../build.mak: No such file or directory
make: *** No rule to make target '../../../build.mak'. Stop.
当我从
make
运行 ./pjsip-apps/src/swig/python
时,我得到:
sed: -e expression #1, char 8: unterminated `s' command
Exception ignored in: <_io.TextIOWrapper name='<stdout>' mode='w' encoding='cp1250'>
OSError: [Errno 22] Invalid argument
python3 setup.py build --compiler=mingw32
helper.mak:2: /build/common.mak: No such file or directory
make[1]: *** No rule to make target '/build/common.mak'. Stop.
helper.mak:2: /build/common.mak: No such file or directory
make[1]: *** No rule to make target '/build/common.mak'. Stop.
helper.mak:2: /build/common.mak: No such file or directory
make[1]: *** No rule to make target '/build/common.mak'. Stop.
helper.mak:2: /build/common.mak: No such file or directory
make[1]: *** No rule to make target '/build/common.mak'. Stop.
running build
running build_py
running build_ext
building '_pjsua2' extension
x86_64-w64-mingw32-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -O2 -pipe -fno-ident -I/c/mingw-builds/ucrt64-seh-posix/x86_64-1220-posix-seh-ucrt-rt_v10-rev2/mingw64/opt/include -I/c/mingw-builds/ucrt64-seh-posix/prerequisites/x86_64-zlib-static/include -I/c/mingw-builds/ucrt64-seh-posix/prerequisites/x86_64-w64-mingw32-static/include -D__USE_MINGW_ANSI_STDIO=1 -IC:/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/opt/include/python3.9 -c pjsua2_wrap.cpp -o build/temp.mingw_x86_64_ucrt-3.9/pjsua2_wrap.o
pjsua2_wrap.cpp:3841:10: fatal error: pjsua2.hpp: No such file or directory
3841 | #include "pjsua2.hpp"
| ^~~~~~~~~~~~
compilation terminated.
error: command 'C:\\ProgramData\\chocolatey\\bin/x86_64-w64-mingw32-gcc.exe' failed with exit code 1
make: *** [Makefile:37: _pjsua2.so] Error 1
我不明白可能出了什么问题,因为我实际上只下载了源代码,没有接触任何东西。