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:

Qt Code:
  1. > ls -R headers
  2. headers:
  3. jrtplib jthread
  4.  
  5. headers/jrtplib:
  6. rtcpapppacket.h rtpbyteaddress.h rtpkeyhashtable.h rtpsessionparams.h
  7. rtcpbyepacket.h rtpcollisionlist.h rtplibraryversion.h rtpsessionsources.h
  8. rtcpcompoundpacketbuilder.h rtpconfig.h rtpmemorymanager.h rtpsourcedata.h
  9. rtcpcompoundpacket.h rtpdebug.h rtpmemoryobject.h rtpsources.h
  10. rtcppacketbuilder.h rtpdefines.h rtppacketbuilder.h rtpstructs.h
  11. rtcppacket.h rtperrors.h rtppacket.h rtptimeutilities.h
  12. rtcprrpacket.h rtpexternaltransmitter.h rtppollthread.h rtptransmitter.h
  13. rtcpscheduler.h rtphashtable.h rtprandom.h rtptypes.h
  14. rtcpsdesinfo.h rtpinternalsourcedata.h rtprandomrand48.h rtptypes_win.h
  15. rtcpsdespacket.h rtpipv4address.h rtprandomrands.h rtpudpv4transmitter.h
  16. rtcpsrpacket.h rtpipv4destination.h rtprandomurandom.h rtpudpv6transmitter.h
  17. rtcpunknownpacket.h rtpipv6address.h rtprawpacket.h
  18. rtpaddress.h rtpipv6destination.h rtpsession.h
  19.  
  20. headers/jthread:
  21. jmutexautolock.h jmutex.h jthreadconfig.h jthread.h
  22. > ls -R libs
  23. libs:
  24. 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:

Qt Code:
  1. INCLUDEPATH += ../headers
  2. 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:

Qt Code:
  1. jthread::JMutex mutex;
  2. mutex.Lock();
  3. mutex.Unlock();
To copy to clipboard, switch view to plain text mode 

I see this when I try to run this program:

Qt Code:
  1. Debugging starts
  2. &"warning: GDB: Failed to set controlling terminal: Invalid argument\n"
  3. error while loading shared libraries: libjrtp.so.3.9.1: cannot open shared object file: No such file or directory
  4. 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).