【问题标题】:Build pjsip 2.10 using msys2使用 msys2 构建 pjsip 2.10
【发布时间】:2020-09-17 00:57:02
【问题描述】:

我正在使用 msys2 编译 pjsip 2.10:
1)打开msys2控制台:C:\msys64\msys2_shell.cmd
2) 运行更新:

pacman -Sy
pacman --needed -S bash pacman pacman-mirrors msys2-runtime
pacman -Su
pacman -S perl
pacman -S mingw-w64-i686-toolchain mingw-w64-x86_64-toolchain
pacman -S base-devel

3) 重启 msys2 控制台
4) 导出 PATH="/c/msys64/mingw32/bin/:$PATH"
5) 配置:

./configure --prefix=$PWD/dist_mingw --disable-ffmpeg --enable-shared --disable-video --disable-speex-aec --disable-speex-aec --disable-g711-codec --disable-l16-codec --disable-gsm-codec --disable-g722-codec --disable-g7221-codec --disable-speex-codec --disable-ilbc-codec --disable-vpx --disable-opus --disable-libyuv --disable-libwebrtc

6) make CFLAGS+="-DPJ_WIN32=1 -DPJ_M_I386=1 -D_LIB -DWIN32 -DPJ_M_I386=1"
7) 但是错误:

output/pjlib-x86_64-pc-msys/log.o:log.c:(.text+0xcb): undefined reference to `pj_time_decode'
output/pjlib-x86_64-pc-msys/ssl_sock_ossl.o:ssl_sock_ossl.c:(.text+0x205): undefined reference to `pj_time_encode'
output/pjlib-x86_64-pc-msys/ssl_sock_dump.o:ssl_sock_dump.c:(.text+0x9c): undefined reference to `pj_time_decode'
output/pjlib-x86_64-pc-msys/ssl_sock_dump.o:ssl_sock_dump.c:(.text+0xb2): undefined reference to `pj_time_decode'

8) 正如我所见,pj_time_encodepjproject-2.10\pjlib\src\pj\os_time_win32.c 中,但该文件未编译。相反,文件os_time_unix.c 已编译。我认为这就是原因。那么如何编译文件os_time_win32.c 而不是os_time_unix.c
我不擅长makefile,所以这对我来说很难定制构建。非常感谢!

【问题讨论】:

  • 您可以询问 pjsip 维护者。如果他们支持 Windows 构建,他们应该能够提供帮助。

标签: makefile pjsip mingw32 msys2


【解决方案1】:

在我的 MSYS 环境中,PJSIP 2.10 可以很好地编译(将 x86_64-w64-mingw32 替换为 i686-w64-mingw32 对于 32 位):

./configure --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --enable-shared --enable-libsamplerate --with-external-speex --with-external-gsm --with-external-srtp --with-external-pa &&
make dep &&
make &&
echo SUCCESS

我自己首先编译了依赖项,因此使用了 with-external- 标志。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-05-10
    • 1970-01-01
    • 1970-01-01
    • 2017-03-09
    • 2014-07-15
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多