I'm trying to use two external libraries called jrtplib and jthread within a Qt project, but I'm not sure how I do this. I've compiled it from source and I've obtained shared objects named libjrtp.so.3.9.1 and libjrtp.so.3.9.1. I added the header files as well.
These are the files I copied from the source:
> ls -R headers
headers:
jrtplib jthread
headers/jrtplib:
rtcpapppacket.h rtpbyteaddress.h rtpkeyhashtable.h rtpsessionparams.h
rtcpbyepacket.h rtpcollisionlist.h rtplibraryversion.h rtpsessionsources.h
rtcpcompoundpacketbuilder.h rtpconfig.h rtpmemorymanager.h rtpsourcedata.h
rtcpcompoundpacket.h rtpdebug.h rtpmemoryobject.h rtpsources.h
rtcppacketbuilder.h rtpdefines.h rtppacketbuilder.h rtpstructs.h
rtcppacket.h rtperrors.h rtppacket.h rtptimeutilities.h
rtcprrpacket.h rtpexternaltransmitter.h rtppollthread.h rtptransmitter.h
rtcpscheduler.h rtphashtable.h rtprandom.h rtptypes.h
rtcpsdesinfo.h rtpinternalsourcedata.h rtprandomrand48.h rtptypes_win.h
rtcpsdespacket.h rtpipv4address.h rtprandomrands.h rtpudpv4transmitter.h
rtcpsrpacket.h rtpipv4destination.h rtprandomurandom.h rtpudpv6transmitter.h
rtcpunknownpacket.h rtpipv6address.h rtprawpacket.h
rtpaddress.h rtpipv6destination.h rtpsession.h
headers/jthread:
jmutexautolock.h jmutex.h jthreadconfig.h jthread.h
> ls -R libs
libs:
libjrtp.so libjrtp.so.3.9.1 libjthread.so libjthread.so.1.3.1
> ls -R headers
headers:
jrtplib jthread
headers/jrtplib:
rtcpapppacket.h rtpbyteaddress.h rtpkeyhashtable.h rtpsessionparams.h
rtcpbyepacket.h rtpcollisionlist.h rtplibraryversion.h rtpsessionsources.h
rtcpcompoundpacketbuilder.h rtpconfig.h rtpmemorymanager.h rtpsourcedata.h
rtcpcompoundpacket.h rtpdebug.h rtpmemoryobject.h rtpsources.h
rtcppacketbuilder.h rtpdefines.h rtppacketbuilder.h rtpstructs.h
rtcppacket.h rtperrors.h rtppacket.h rtptimeutilities.h
rtcprrpacket.h rtpexternaltransmitter.h rtppollthread.h rtptransmitter.h
rtcpscheduler.h rtphashtable.h rtprandom.h rtptypes.h
rtcpsdesinfo.h rtpinternalsourcedata.h rtprandomrand48.h rtptypes_win.h
rtcpsdespacket.h rtpipv4address.h rtprandomrands.h rtpudpv4transmitter.h
rtcpsrpacket.h rtpipv4destination.h rtprandomurandom.h rtpudpv6transmitter.h
rtcpunknownpacket.h rtpipv6address.h rtprawpacket.h
rtpaddress.h rtpipv6destination.h rtpsession.h
headers/jthread:
jmutexautolock.h jmutex.h jthreadconfig.h jthread.h
> ls -R libs
libs:
libjrtp.so libjrtp.so.3.9.1 libjthread.so libjthread.so.1.3.1
To copy to clipboard, switch view to plain text mode
I added the following flag to the qmake file:
INCLUDEPATH += ../headers
LIBS += ../libs/libjrtp.so ../libs/libjthread.so
INCLUDEPATH += ../headers
LIBS += ../libs/libjrtp.so ../libs/libjthread.so
To copy to clipboard, switch view to plain text mode
To test the library, I added #include <jthread/jmutex.h> and put this in the main function:
jthread::JMutex mutex;
mutex.Lock();
mutex.Unlock();
jthread::JMutex mutex;
mutex.Lock();
mutex.Unlock();
To copy to clipboard, switch view to plain text mode
I see this when I try to run this program:
Debugging starts
&"warning: GDB: Failed to set controlling terminal: Invalid argument\n"
error while loading shared libraries: libjrtp.so.3.9.1: cannot open shared object file: No such file or directory
Debugging has finished
Debugging starts
&"warning: GDB: Failed to set controlling terminal: Invalid argument\n"
error while loading shared libraries: libjrtp.so.3.9.1: cannot open shared object file: No such file or directory
Debugging has finished
To copy to clipboard, switch view to plain text mode
This looks like a dynamic linking failure. Other than that I've seen no warning signs. What am I doing wrong? Perhaps there is a way to statically link with jrtplib to avoid issues. I realize that I didn't use LIBS like everyone else (LIBS += -l../libs/libjrtp.so -l../libs/libjthread.so), but that only gave me more errors. Leaving out the LIBS statement quite logically causes qmake to fail to link to the library (undefined reference to `jthread::JMutex::JMutex()' etc).
Bookmarks