Dodawanie biblioteki PJSIP do CodeBlocks
Ostatnio zmodyfikowano 2016-01-19 09:19
piootrek13 Temat założony przez niniejszego użytkownika |
Dodawanie biblioteki PJSIP do CodeBlocks » 2016-01-16 20:39:50 Witam Nie mogę poradzić sobie z dodaniem biblioteki PJSIP do środowiska CodeBlocks. W pobranej przezemnie paczce PJSIP nie ma plików *lib także nie mam co dodać do link libraries. W efekcie przy kompilacji przykładowego kodu: #include <pjsua2.hpp> #include <iostream>
using namespace pj;
class MyAccount : public Account { public: virtual void onRegState( OnRegStateParam & prm ) { AccountInfo ai = getInfo(); std::cout <<( ai.regIsActive ? "*** Register:": "*** Unregister:" ) << " code=" << prm.code << std::endl; } };
int main() { Endpoint ep; ep.libCreate(); EpConfig ep_cfg; ep.libInit( ep_cfg ); TransportConfig tcfg; tcfg.port = 5060; try { ep.transportCreate( PJSIP_TRANSPORT_UDP, tcfg ); } catch( Error & err ) { std::cout << err.info() << std::endl; return 1; } ep.libStart(); std::cout << "*** PJSUA2 STARTED ***" << std::endl; AccountConfig acfg; acfg.idUri = "sip:test@pjsip.org"; acfg.regConfig.registrarUri = "sip:pjsip.org"; AuthCredInfo cred( "digest", "*", "test", 0, "secret" ); acfg.sipConfig.authCreds.push_back( cred ); MyAccount * acc = new MyAccount; acc->create( acfg ); pj_thread_sleep( 10000 ); delete acc; return 0; }
otrzymuje taki log: ||=== Build: Debug in aaa (compiler: GNU GCC Compiler) ===| obj\Debug\main.o||In function `main':| C:\Users\Acer\Desktop\projekty\aaa\main.cpp|18|undefined reference to `pj::Endpoint::Endpoint()'| C:\Users\Acer\Desktop\projekty\aaa\main.cpp|20|undefined reference to `pj::Endpoint::libCreate()'| C:\Users\Acer\Desktop\projekty\aaa\main.cpp|24|undefined reference to `pj::Endpoint::libInit(pj::EpConfig const&)'| C:\Users\Acer\Desktop\projekty\aaa\main.cpp|27|undefined reference to `pj::TransportConfig::TransportConfig()'| C:\Users\Acer\Desktop\projekty\aaa\main.cpp|30|undefined reference to `pj::Endpoint::transportCreate(pjsip_transport_type_e, pj::TransportConfig const&)'| C:\Users\Acer\Desktop\projekty\aaa\main.cpp|37|undefined reference to `pj::Endpoint::libStart()'| C:\Users\Acer\Desktop\projekty\aaa\main.cpp|41|undefined reference to `pj::AccountConfig::AccountConfig()'| C:\Users\Acer\Desktop\projekty\aaa\main.cpp|44|undefined reference to `pj::AuthCredInfo::AuthCredInfo(std::string const&, std::string const&, std::string const&, int, std::string)'| C:\Users\Acer\Desktop\projekty\aaa\main.cpp|49|undefined reference to `pj::Account::create(pj::AccountConfig const&, bool)'| C:\Users\Acer\Desktop\projekty\aaa\main.cpp|52|undefined reference to `pj_thread_sleep'| C:\Users\Acer\Desktop\projekty\aaa\main.cpp|58|undefined reference to `pj::Endpoint::~Endpoint()'| C:\Users\Acer\Desktop\projekty\aaa\main.cpp|32|undefined reference to `pj::Error::info(bool) const'| C:\Users\Acer\Desktop\projekty\aaa\main.cpp|58|undefined reference to `pj::Endpoint::~Endpoint()'| obj\Debug\main.o||In function `ZN9MyAccount10onRegStateERN2pj15OnRegStateParamE':| C:\Users\Acer\Desktop\projekty\aaa\main.cpp|10|undefined reference to `pj::Account::getInfo() const'| obj\Debug\main.o||In function `ZN2pj8UaConfigD1Ev':| C:\Users\Acer\Desktop\projekty\aaa\..\..\pjproject-2.4.5\pjproject-2.4.5\pjsip\include\pjsua2\endpoint.hpp|170|undefined reference to `vtable for pj::UaConfig'| obj\Debug\main.o||In function `ZN2pj9LogConfigD1Ev':| C:\Users\Acer\Desktop\projekty\aaa\..\..\pjproject-2.4.5\pjproject-2.4.5\pjsip\include\pjsua2\endpoint.hpp|343|undefined reference to `vtable for pj::LogConfig'| obj\Debug\main.o||In function `ZN2pj8EpConfigC1Ev':| C:\Users\Acer\Desktop\projekty\aaa\..\..\pjproject-2.4.5\pjproject-2.4.5\pjsip\include\pjsua2\endpoint.hpp|625|undefined reference to `vtable for pj::EpConfig'| C:\Users\Acer\Desktop\projekty\aaa\..\..\pjproject-2.4.5\pjproject-2.4.5\pjsip\include\pjsua2\endpoint.hpp|625|undefined reference to `pj::UaConfig::UaConfig()'| C:\Users\Acer\Desktop\projekty\aaa\..\..\pjproject-2.4.5\pjproject-2.4.5\pjsip\include\pjsua2\endpoint.hpp|625|undefined reference to `pj::LogConfig::LogConfig()'| C:\Users\Acer\Desktop\projekty\aaa\..\..\pjproject-2.4.5\pjproject-2.4.5\pjsip\include\pjsua2\endpoint.hpp|625|undefined reference to `pj::MediaConfig::MediaConfig()'| obj\Debug\main.o||In function `ZN2pj8EpConfigD1Ev':| C:\Users\Acer\Desktop\projekty\aaa\..\..\pjproject-2.4.5\pjproject-2.4.5\pjsip\include\pjsua2\endpoint.hpp|625|undefined reference to `vtable for pj::EpConfig'| obj\Debug\main.o||In function `ZN2pj9TlsConfigD1Ev':| C:\Users\Acer\Desktop\projekty\aaa\..\..\pjproject-2.4.5\pjproject-2.4.5\pjsip\include\pjsua2\siptypes.hpp|123|undefined reference to `vtable for pj::TlsConfig'| obj\Debug\main.o||In function `ZN2pj15TransportConfigD1Ev':| C:\Users\Acer\Desktop\projekty\aaa\..\..\pjproject-2.4.5\pjproject-2.4.5\pjsip\include\pjsua2\siptypes.hpp|283|undefined reference to `vtable for pj::TransportConfig'| obj\Debug\main.o||In function `ZN2pj16AccountRegConfigD1Ev':| C:\Users\Acer\Desktop\projekty\aaa\..\..\pjproject-2.4.5\pjproject-2.4.5\pjsip\include\pjsua2\account.hpp|46|undefined reference to `vtable for pj::AccountRegConfig'| obj\Debug\main.o||In function `ZN2pj16AccountSipConfigD1Ev':| C:\Users\Acer\Desktop\projekty\aaa\..\..\pjproject-2.4.5\pjproject-2.4.5\pjsip\include\pjsua2\account.hpp|184|undefined reference to `vtable for pj::AccountSipConfig'| obj\Debug\main.o||In function `ZN2pj17AccountPresConfigD1Ev':| C:\Users\Acer\Desktop\projekty\aaa\..\..\pjproject-2.4.5\pjproject-2.4.5\pjsip\include\pjsua2\account.hpp|336|undefined reference to `vtable for pj::AccountPresConfig'| obj\Debug\main.o||In function `ZN2pj16AccountNatConfigD1Ev':| C:\Users\Acer\Desktop\projekty\aaa\..\..\pjproject-2.4.5\pjproject-2.4.5\pjsip\include\pjsua2\account.hpp|444|undefined reference to `vtable for pj::AccountNatConfig'| obj\Debug\main.o||In function `ZN2pj18AccountMediaConfigD1Ev':| C:\Users\Acer\Desktop\projekty\aaa\..\..\pjproject-2.4.5\pjproject-2.4.5\pjsip\include\pjsua2\account.hpp|691|undefined reference to `vtable for pj::AccountMediaConfig'| obj\Debug\main.o||In function `ZN2pj13AccountConfigD1Ev':| C:\Users\Acer\Desktop\projekty\aaa\..\..\pjproject-2.4.5\pjproject-2.4.5\pjsip\include\pjsua2\account.hpp|853|undefined reference to `vtable for pj::AccountConfig'| obj\Debug\main.o||In function `ZN2pj12AuthCredInfoD1Ev':| C:\Users\Acer\Desktop\projekty\aaa\..\..\pjproject-2.4.5\pjproject-2.4.5\pjsip\include\pjsua2\siptypes.hpp|46|undefined reference to `vtable for pj::AuthCredInfo'| obj\Debug\main.o||In function `ZN9MyAccountC1Ev':| C:\Users\Acer\Desktop\projekty\aaa\main.cpp|7|undefined reference to `pj::Account::Account()'| obj\Debug\main.o||In function `ZN2pj12AuthCredInfoC1ERKS0_':| C:\Users\Acer\Desktop\projekty\aaa\..\..\pjproject-2.4.5\pjproject-2.4.5\pjsip\include\pjsua2\siptypes.hpp|46|undefined reference to `vtable for pj::AuthCredInfo'| obj\Debug\main.o||In function `ZN9MyAccountD1Ev':| C:\Users\Acer\Desktop\projekty\aaa\main.cpp|7|undefined reference to `pj::Account::~Account()'| ||=== Build failed: 33 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|
Czy może wie ktoś jak dodać tę bibliotekę do codeblocks ? |
|
mateczek |
» 2016-01-19 09:19:13 może pobrałeś źródła :P biblioteki a nie binarkę?? masz pliki: *.dll; *.so; *.a ?? Jeśli nie masz takich a masz pliki *.cpp to są źródła i bibliotekę musisz najpierw skompilować !!! |
|
« 1 » |