I have a very hard time creating a PJSUA2 package for Python 3.x on Windows 10. I downloaded the source code from the pjsip site and I'm able to compile the C++ code without problems, but I cannot build the PJSUA2 module for Python. The docs mention using SWIG, but I had no luck so far.
When I run make
from ./pjsip-apps/src/swig
I get the following:
Makefile:1: ../../../build.mak: No such file or directory
make: *** No rule to make target '../../../build.mak'. Stop.
When I run make
from ./pjsip-apps/src/swig/python
I get:
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
I don't understand what could be wrong, as I literally only downloaded the source code and did not touch anything.