转载地址:http://blog.youkuaiyun.com/laotie1015/article/details/8252609
问题描述:
1、安装包:jrtplib-3.7.1.tar.gz jthread-1.2.1.tar.gz
2、步骤:分别解压两个安装包
进入jthread-1.2.1使用./configure -host=arm-linux CC=arm-linux-gcc CXX=arm-linux-g++ 命令配置
make
make install
同样进入jrtplib-3.7.1 使用同样步骤
3、错误信息
rtppollthread.cpp:(.text+0x484): undefined reference to `JThread::~JThread()'
rtppollthread.cpp:(.text+0x4a4): undefined reference to `JMutex::~JMutex()'
rtppollthread.cpp:(.text+0x4ac): undefined reference to `JThread::~JThread()'
../src/.libs/libjrtp.a(rtppollthread.o): In function `RTPPollThread::RTPPollThread(RTPSession&, RTCPScheduler&)':
rtppollthread.cpp:(.text+0x4d4): undefined reference to `JThread::JThread()'
rtppollthread.cpp:(.text+0x4e4): undefined reference to `JMutex::JMutex()'
rtppollthread.cpp:(.text+0x510): undefined reference to `JThread::~JThread()'
../src/.libs/libjrtp.a(rtppollthread.o): In function `RTPPollThread::RTPPollThread(RTPSession&, RTCPScheduler&)':
rtppollthread.cpp:(.text+0x530): undefined reference to `JThread::JThread()'
rtppollthread.cpp:(.text+0x540): undefined reference to `JMutex::JMutex()'
rtppollthread.cpp:(.text+0x56c): undefined reference to `JThread::~JThread()'
../src/.libs/libjrtp.a(rtppollthread.o):(.rodata+0x34): undefined reference to `typeinfo for JThread'
collect2: ld returned 1 exit status
解决办法:手动链接
配置jrtplib的命令改为
./configure -host=arm-linux CC=arm-linux-gcc CXX=arm-linux-g++ --with-jthread-include=/usr/local/include/jthread LDFLAGS=-L/usr/local/lib 就OK了