I want to check the work of the installed library pjsip. I put it this way ./configure & make dep & make install further copied a simple example from the site of the site:
include
#include <pjsip.h> #include <pjsua.h> #include <pjsua2.hpp> #include <pjlib.h> #include <pjlib.h> #include <pjlib-util.h> #include <pjmedia.h> #include <pjmedia-codec.h> #include <pjsip.h> #include <pjsip_simple.h> #include <pjsip_ua.h> #include <pjsua-lib/pjsua.h> using namespace pj; using namespace std; int main() { Endpoint *ep = new Endpoint; try { ep->libCreate(); } catch(Error& err) { cout << "Startup error: " << err.info() << endl; } cout << "xyi"; ep->libDestroy(); delete ep; return 0; } I added a file to the pro:
INCLUDEPATH +=/home/alexey/phone/pjproject-2.5.5/pjlib/include \ /home/alexey/phone/pjproject-2.5.5/pjlib-util/include \ /home/alexey/phone/pjproject-2.5.5/pjnath/include \ /home/alexey/phone/pjproject-2.5.5/pjmedia/include \ /home/alexey/phone/pjproject-2.5.5/pjsip/include \ /home/alexey/phone/pjproject-2.5.5/pjsip-apps/include \ /home/alexey/phone/pjproject-2.5.5/third_party/include \ LIBS += -L/home/alexey/phone/pjproject-2.5.5/pjlib/lib \ -L/home/alexey/phone/pjproject-2.5.5/pjlib-util/lib \ -L/home/alexey/phone/pjproject-2.5.5/pjnath/lib \ -L/home/alexey/phone/pjproject-2.5.5/pjmedia/lib \ -L/home/alexey/phone/pjproject-2.5.5/pjsip/lib \ -L/home/alexey/phone/pjproject-2.5.5/pjsip-apps/lib \ -L/home/alexey/phone/pjproject-2.5.5/third_party/lib \ I get an error when building
undefined reference to `pj::Endpoint::Endpoint()' undefined reference to `pj::Endpoint::libCreate()' undefined reference to `pj::Endpoint::libDestroy(unsigned int)' undefined reference to `pj::Error::info[abi:cxx11](bool) const' syntax highlighting is. You can override classes. I mean that qt sees them. I do not understand what's the matter? Maybe in the compiler settings you need to specify something?
.h, as if you had created a class, declared a function in it, but did not describe it - asianirishEndpointclass is described (the binary code of its functions) - asianirish-l(ΠΈΠΌΡ_Π±ΠΈΠ±Π»ΠΈΠΎΡΠ΅ΠΊΠΈ), that is, if there is alibsomeliblibrarylibsomelibthen you need to put-lsomelib. This process can be automated - right click on the project andAdd Library. Read more: doc.qt.io/qtcreator/creator-project-qmake-libraries.html - asianirishpkg-config --cflags --libs libpjprojectlike this from the console. How can I add this to the pro file now - Alexey Smirnov