Linux下移植pjsip,使用QT开发

1、移植pjsip

env:fedora14

arm-linuc-gcc:gcc version 4.5.1 (ctng-1.8.1-FA) 

#./configure \

CC=arm-linux-gcc \

CROSS_COMPILE=arm-none-linux-gnueabi- \

--build=i386-linux \

--prefix=/usr/local/pjsip \

--host=arm-none-linux-gnueabi \

--target=arm-none-linux-gnueabi 

#make dep

#make 

#make install

2、将pjsip库加载进QT工程中

将以下库添加到pro文件中

unix:!macx:!symbian: LIBS += -L/usr/local/pjsip/lib/ -lpjsua-arm-none-linux-gnueabi \

-lpjsip-ua-arm-none-linux-gnueabi \

-lpjsip-simple-arm-none-linux-gnueabi \

-lpjsip-arm-none-linux-gnueabi \

-lpjmedia-codec-arm-none-linux-gnueabi \

-lpjmedia-videodev-arm-none-linux-gnueabi \

-lpjmedia-arm-none-linux-gnueabi \

-lpjmedia-audiodev-arm-none-linux-gnueabi \

-lpjnath-arm-none-linux-gnueabi \

-lpjlib-util-arm-none-linux-gnueabi \

-lresample-arm-none-linux-gnueabi \

-lmilenage-arm-none-linux-gnueabi \

-lsrtp-arm-none-linux-gnueabi \

-lgsmcodec-arm-none-linux-gnueabi \

-lspeex-arm-none-linux-gnueabi \

-lilbccodec-arm-none-linux-gnueabi \

-lg7221codec-arm-none-linux-gnueabi \

-lportaudio-arm-none-linux-gnueabi  \

-lpj-arm-none-linux-gnueabi \

-lm \

-luuid \

-lnsl \

-lrt \

-lpthread  \

-lasound

INCLUDEPATH += /usr/local/pjsip/include

DEPENDPATH += /usr/local/pjsip/include

unix:!macx:!symbian: PRE_TARGETDEPS += /usr/local/pjsip/lib/libg7221codec-arm-none-linux-gnueabi.a \

/usr/local/pjsip/lib/libgsmcodec-arm-none-linux-gnueabi.a \

/usr/local/pjsip/lib/libilbccodec-arm-none-linux-gnueabi.a \

/usr/local/pjsip/lib/libmilenage-arm-none-linux-gnueabi.a \

/usr/local/pjsip/lib/libpj-arm-none-linux-gnueabi.a \

/usr/local/pjsip/lib/libpjlib-util-arm-none-linux-gnueabi.a \

/usr/local/pjsip/lib/libpjmedia-arm-none-linux-gnueabi.a \

/usr/local/pjsip/lib/libpjmedia-audiodev-arm-none-linux-gnueabi.a \

/usr/local/pjsip/lib/libpjmedia-codec-arm-none-linux-gnueabi.a \

/usr/local/pjsip/lib/libpjmedia-videodev-arm-none-linux-gnueabi.a \

/usr/local/pjsip/lib/libpjnath-arm-none-linux-gnueabi.a \

/usr/local/pjsip/lib/libpjsip-arm-none-linux-gnueabi.a \

/usr/local/pjsip/lib/libpjsip-simple-arm-none-linux-gnueabi.a \

/usr/local/pjsip/lib/libpjsip-ua-arm-none-linux-gnueabi.a \

/usr/local/pjsip/lib/libpjsua-arm-none-linux-gnueabi.a \

/usr/local/pjsip/lib/libportaudio-arm-none-linux-gnueabi.a \

/usr/local/pjsip/lib/libresample-arm-none-linux-gnueabi.a \

/usr/local/pjsip/lib/libspeex-arm-none-linux-gnueabi.a \

/usr/local/pjsip/lib/libsrtp-arm-none-linux-gnueabi.a

3、编译出错

 from ../QT_PJSIP_VOIP/qt_sip.h:3,

 from ../QT_PJSIP_VOIP/mainwindow.h:6,

 from ../QT_PJSIP_VOIP/main.cpp:2:

/usr/local/pjsip/include/pj/config.h:1161:4: error: #error "PJ_IS_LITTLE_ENDIAN is not defined!"

/usr/local/pjsip/include/pj/config.h:1165:4: error: #error "PJ_IS_BIG_ENDIAN is not defined!"

解决:在config.h文件中宏定义

#define PJ_IS_BIG_ENDIAN 0

#define PJ_IS_LITTLE_ENDIAN 1

这样就能编译通过了。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值