Unable to run PJSIP stack in Qtcreator Ubuntu !!!

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi All,

I have a serious problem adding PJSIP libraries to Qtcreator in Ubuntu and
Centos, then I tried two ways to performed that

1.- I used the Qtcreator option : in the .pro file, right click -> add
library -> external library -> , then I chose only linux platform
(qtcreator option), then the library is added to my .pro file.
    Normaly with this methode, both, the include path for the header files
and the library itself are added, the lines in the .pro file are as follow :

#pjsip

unix:!macx:!symbian: LIBS += -L$$PWD/../pjproject-1.10/pjsip/lib/
-lpjsua-i686-pc-linux-gnu

INCLUDEPATH += $$PWD/../pjproject-1.10/pjsip/include
DEPENDPATH += $$PWD/../pjproject-1.10/pjsip/include

unix:!macx:!symbian: PRE_TARGETDEPS +=
$$PWD/../pjproject-1.10/pjsip/lib/libpjsua-i686-pc-linux-gnu.a

2.- Add libraries manually, then I firstly added the headers first with
INCLUDEPATH after I add each library as follow :

INCLUDEPATH += \

    /home/rafael/A2011/ELE3000/pjproject-1.10/pjsip/include \

    /home/rafael/A2011/ELE3000/pjproject-1.10/pjmedia/include \

    /home/rafael/A2011/ELE3000/pjproject-1.10/pjnath/include \

    /home/rafael/A2011/ELE3000/pjproject-1.10/pjlib-util/include \

    /home/rafael/A2011/ELE3000/pjproject-1.10/pjlib/include


  LIBS += /home/rafael/A2011/ELE3000/pjproject-1.10/pjlib-util/lib/libpjlib-util-i686-pc-linux-gnu.a

 LIBS += /home/rafael/A2011/ELE3000/pjproject-1.10/pjmedia/lib/libpjmedia-i686-pc-linux-gnu.a

 LIBS += /home/rafael/A2011/ELE3000/pjproject-1.10/pjmedia/lib/libpjmedia-codec-i686-pc-linux-gnu.a

 LIBS += /home/rafael/A2011/ELE3000/pjproject-1.10/pjsip/lib/libpjsip-i686-pc-linux-gnu.a

 LIBS += /home/rafael/A2011/ELE3000/pjproject-1.10/pjsip/lib/libpjsip-simple-i686-pc-linux-gnu.a

 LIBS += /home/rafael/A2011/ELE3000/pjproject-1.10/pjsip/lib/libpjsip-ua-i686-pc-linux-gnu.a

 LIBS += /home/rafael/A2011/ELE3000/pjproject-1.10/pjsip/lib/libpjsua-i686-pc-linux-gnu.a

 LIBS += /home/rafael/A2011/ELE3000/pjproject-1.10/pjmedia/lib/libpjsdp-i686-pc-linux-gnu.a

 LIBS += /home/rafael/A2011/ELE3000/pjproject-1.10/pjmedia/lib/libpjmedia-audiodev-i686-pc-linux-gnu.a

 LIBS += /home/rafael/A2011/ELE3000/pjproject-1.10/pjnath/lib/libpjnath-i686-pc-linux-gnu.a

 LIBS += /home/rafael/A2011/ELE3000/pjproject-1.10/pjlib/lib/libpj-i686-pc-linux-gnu.a



In both cases I have several errors with the follow message :


/home/rafael/A2011/ELE3000/pjproject-1.10/pjsip/lib/libpjsua-i686-pc-linux-gnu.a(pjsua_call.o):-1:
In function `xfer_server_on_evsub_state':

File not found : ...


pjsua_call.c:-1: error: undefined reference to `pjsip_evsub_get_state'

File not found : ...



... then there are almost 731 error of this kind ...


I read a old post with a similar problem, PJSIP libraries error adding
that to QtCreator :
http://article.gmane.org/gmane.comp.voip.pjsip/12758/match=qtcreator+ubuntu+pjsip+library

The only difference with my problem is I work with Ubuntu and Centos
and the solution presented is for Windows. However the mainly idea is
the same. In statically libraries as PJSIP, the order for linked that
is MATTER, and is very important. I verified that because, I changed
the LIBS order and in each case I have differents erros, some
"undefined references" in a case and others "undefined references" in
others cases. However I can't find the good order to put the PJSIP
libraries.


I tried with PJSIP 1.10 and PJSIP 1.12 in both I have the same problem ...


My main code is, a very very small program :


A) MAIN CODE :


#include "sipconnect.h"

 int main(int argc, char **args)

{

    QApplication application(argc, args);

//  Utilisation de la classe sipconnect

    QVBoxLayout *layout;

    layout = new QVBoxLayout;

//  class sipconnect : public QWidget

//  explicit sipconnect(QWidget *parent = 0, char *text="<none>");

    QWidget * windowtest;

    windowtest = new QWidget;

    layout->addWidget(windowtest);

    windowtest->resize(240,450);

    windowtest->setWindowTitle(QApplication::translate("Top Level",
"My Softphone"));

    char *TextConnecter = "Connecter";

    char *TextDeconnecter = "Deconnecter";

    char *Quit = "Quit";

    int pos1=1;

    int pos2=2;

    int pos3=3;

    sipconnect *ButtonConnect;

    ButtonConnect = new sipconnect(windowtest,TextConnecter,pos1);

    sipconnect *ButtonDeconnecter;

    ButtonDeconnecter = new sipconnect(windowtest,TextDeconnecter,pos2);

    sipconnect *ButtonQuit;

    ButtonQuit = new sipconnect(windowtest,Quit,pos3);

    windowtest->show();


    // Initialisation de PJSIP

    pj_status_t status;

    /* Init pjsua */

    pjsua_config cfg;

    pjsua_logging_config log_cfg;


    pjsua_logging_config_default(&log_cfg);

    log_cfg.console_level = 4;

    /* Create pjsua first! */

    status = pjsua_create();

    if (status != PJ_SUCCESS) error_exit("Error in pjsua_create()", status);

    pjsua_config_default(&cfg);

    cfg.cb.on_incoming_call = NULL;

    cfg.cb.on_call_media_state = &on_call_media_state;

    cfg.cb.on_call_state = &on_call_state;

    status = pjsua_init(&cfg, &log_cfg, NULL);

    if (status != PJ_SUCCESS) error_exit("Error in pjsua_init()", status);

    /* Add UDP transport. */

    {

        pjsua_transport_config cfg;

        pjsua_transport_config_default(&cfg);

        cfg.port = 5060;

        status = pjsua_transport_create(PJSIP_TRANSPORT_UDP, &cfg, NULL);

        //if (status != PJ_SUCCESS) error_exit("Error creating
transport", status);

    }

     /* Initialization is done, now start pjsua */

    status = pjsua_start();

    if (status != PJ_SUCCESS) error_exit("Error starting pjsua", status);

    return application.exec();

}


B) Sipconnect class Header :


#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>

class sipconnect : public QWidget

{

    Q_OBJECT

public:

    sipconnect(QWidget *parent = 0, char *text="<none>", int pos=0);


public slots:

    void pushButtonClicked();

};

C) Sipconnect source :


#include "sipconnect.h"

#include <QObject>

#include <QWidget>

#include <QtGui>

void sipconnect::pushButtonClicked()

{

    QPushButton *button = new QPushButton("Je suis dans SLOT
pushButtonClicked");

    button->resize(100, 30);

    button->move(120,50);

    button->show();

}

sipconnect::sipconnect(QWidget *parent, char *text, int pos) :

    QWidget(parent)

{

        //const char text1=*text;

        char *Quit = "Quit";

        if (*text==*Quit)

        {

            QPushButton *button = new
QPushButton(QApplication::translate("sip1", text), parent);

            connect ( button, SIGNAL( clicked() ), qApp, SLOT(quit()));

            button->resize(150, 30);

            button->move(80, pos*40+40);

        }

        else

        {

            //connection = new SipConnection();

            QPushButton *button = new
QPushButton(QApplication::translate("sip1", text), parent);

            connect ( button, SIGNAL( clicked() ), this, SLOT(
pushButtonClicked() ) );

            button->resize(150, 30);

            button->move(80, pos*40+40);


        }

}



Somebody has some suggestions ?


Thanks in advance,


Rafa
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20111123/331bd191/attachment-0001.html>


[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux