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?

  • This only means that Qt Creator sees the header files .h , as if you had created a class, declared a function in it, but did not describe it - asianirish
  • those. can't see cpp files? - Alexey Smirnov
  • in this case, the "binary analog" cpp). I suspect that I also want some other library in which the Endpoint class is described (the binary code of its functions) - asianirish
  • It seems to me that there is still not enough -l(имя_Π±ΠΈΠ±Π»ΠΈΠΎΡ‚Π΅ΠΊΠΈ) , that is, if there is a libsomelib library libsomelib then you need to put -lsomelib . This process can be automated - right click on the project and Add Library . Read more: doc.qt.io/qtcreator/creator-project-qmake-libraries.html - asianirish
  • g ++ main.cpp -o main pkg-config --cflags --libs libpjproject like this from the console. How can I add this to the pro file now - Alexey Smirnov

0