Paulo Rogério Panhoto | 1 Aug 2010 06:49
Picon

Re: pjsua_create() undefined.

You need to add the pjsip libraries with the -l option.

i.e> gcc -o pjsip-perf -lpjsua pjsip-perf

Regards,

Paulo

2010/7/31 Shamun toha md <shamun.toha <at> gmail.com>

Dear sir,

I am using Fedora 12 and pjSIP. I am getting this error. for the reference of "pjsua_create()".

Error:
=====
[sun <at> example mysip]$ gcc pjsip-perf.c
/tmp/ccGXG4zr.o: In function `main':
pjsip-perf.c:(.text+0xa): undefined reference to `pjsua_create'

collect2: ld returned 1 exit status
[sun <at> example mysip]$



Code:
========
// Step -1
#include <pjsua-lib/pjsua.h>

// Step -2
#define sip_realm  "asterisk"
#define sip_domain "127.0.0.1"
#define sip_user   "dddd"
#define sip_passwd "dddd"



// Step -3
int main(int argc, char *argv[])
{

   pjsua_acc_id acc_id;
   pj_status_t status;
  
   // Create pjsua first
   status = pjsua_create();
  
  return 0;

}


Thank you
Best regards
Shamun




_______________________________________________
Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip <at> lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org


<div>
<p>You need to add the pjsip libraries with the -l option.<br><br>i.e&gt; gcc -o pjsip-perf -lpjsua pjsip-perf<br><br>Regards,<br><br>Paulo<br><br></p>
<div class="gmail_quote">2010/7/31 Shamun toha md <span dir="ltr">&lt;<a href="mailto:shamun.toha <at> gmail.com">shamun.toha <at> gmail.com</a>&gt;</span><br><blockquote class="gmail_quote">
<br><div class="gmail_quote">Dear sir,<br><br>I am using Fedora 12 and pjSIP. I am getting this error. for the reference of "pjsua_create()".<br><br>Error:<br>=====<br>[sun <at> example mysip]$ gcc pjsip-perf.c<br>/tmp/ccGXG4zr.o: In function `main':<br>

pjsip-perf.c:(.text+0xa): undefined reference to `pjsua_create'<div class="im">
<br>collect2: ld returned 1 exit status<br>
</div>[sun <at> example mysip]$ <br><br><br><br>Code:<br>========<br>// Step -1 <br>#include &lt;pjsua-lib/pjsua.h&gt;<br><br>// Step -2<br>#define sip_realm&nbsp; "asterisk"<br>#define sip_domain "127.0.0.1"<br>#define sip_user&nbsp;&nbsp; "dddd"<br>#define sip_passwd "dddd"<br><br><br><br>// Step -3<br>int main(int argc, char *argv[])<br>

{<div class="im">
<br>&nbsp;&nbsp; pjsua_acc_id acc_id;<br>
</div>&nbsp;&nbsp; pj_status_t status;<br>&nbsp;&nbsp; <br>&nbsp;&nbsp; // Create pjsua first<br>&nbsp;&nbsp; status = pjsua_create();<br>&nbsp;&nbsp; <br>&nbsp; return 0;<div class="im">
<br>}<br><br><br>Thank you<br>Best regards<br>Shamun<br><br><br>
</div>
</div>
<br><br>_______________________________________________<br>
Visit our blog: <a href="http://blog.pjsip.org" target="_blank">http://blog.pjsip.org</a><br><br>
pjsip mailing list<br><a href="mailto:pjsip <at> lists.pjsip.org">pjsip <at> lists.pjsip.org</a><br><a href="http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org" target="_blank">http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org</a><br><br>
</blockquote>
</div>
<br>
</div>
Waleed | 1 Aug 2010 07:33
Picon

Re: Newcomer - Please kindly give a feedback



On Sat, Jul 31, 2010 at 1:46 PM, Shamun toha md <shamun.toha <at> gmail.com> wrote:
Dear Sir,

If anyone get this letter, let me know, i am just confuse why its not working.

1. pjsua_acc_id acc_id; // create no error

2. All rest related pjsua_*  // cause this compile error

[root <at> example lib]# gcc -Wall /home/sun/Downloads/mysip/myapp.c
/home/sun/Downloads/mysip/myapp.c: In function ‘main’:
/home/sun/Downloads/mysip/myapp.c:29: warning: implicit declaration of function ‘error_exit’
/home/sun/Downloads/mysip/myapp.c:21: warning: unused variable ‘acc_id’
/tmp/ccbVD6Mv.o: In function `main':
myapp.c:(.text+0x1b): undefined reference to `pjsua_verify_sip_url'
myapp.c:(.text+0x3a): undefined reference to `error_exit'
collect2: ld returned 1 exit status
[root <at> example lib]#


Thank you
Best regards
Shamun


_______________________________________________
Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip <at> lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

there's a makefile you should to use it . check this http://www.pjsip.org/using.htm

<div><div dir="ltr">
<br><br><div class="gmail_quote">On Sat, Jul 31, 2010 at 1:46 PM, Shamun toha md <span dir="ltr">&lt;<a href="mailto:shamun.toha <at> gmail.com">shamun.toha <at> gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote">
Dear Sir,<br><br>If anyone get this letter, let me know, i am just confuse why its not working.<br><br>1. pjsua_acc_id acc_id; // create no error<br><br>2. All rest related pjsua_*&nbsp; // cause this compile error<br><br>[root <at> example lib]# gcc -Wall /home/sun/Downloads/mysip/myapp.c<br>

/home/sun/Downloads/mysip/myapp.c: In function &lsquo;main&rsquo;:<br>/home/sun/Downloads/mysip/myapp.c:29: warning: implicit declaration of function &lsquo;error_exit&rsquo;<br>/home/sun/Downloads/mysip/myapp.c:21: warning: unused variable &lsquo;acc_id&rsquo;<br>

/tmp/ccbVD6Mv.o: In function `main':<br>myapp.c:(.text+0x1b): undefined reference to `pjsua_verify_sip_url'<br>myapp.c:(.text+0x3a): undefined reference to `error_exit'<br>collect2: ld returned 1 exit status<br>

[root <at> example lib]# <br><br><br>Thank you<br>Best regards<br>Shamun<br><br><br>_______________________________________________<br>
Visit our blog: <a href="http://blog.pjsip.org" target="_blank">http://blog.pjsip.org</a><br><br>
pjsip mailing list<br><a href="mailto:pjsip <at> lists.pjsip.org">pjsip <at> lists.pjsip.org</a><br><a href="http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org" target="_blank">http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org</a><br><br>
</blockquote>
</div>there's a makefile you should to use it . check this&nbsp;<a href="http://www.pjsip.org/using.htm">http://www.pjsip.org/using.htm</a><div><br></div>
</div></div>
Alejandro Orellana | 1 Aug 2010 12:09

Re: pjsua_create() undefined.

That is correct. 
Ingeneral you need to specify 
The include files paths with the -I option

The librareis path with -L option

And the librRies you r using
with. The -l 



Sent from my iPhone

On Aug 1, 2010, at 12:49 AM, Paulo Rogério Panhoto <paulo <at> voicetechnology.com.br> wrote:

You need to add the pjsip libraries with the -l option.

i.e> gcc -o pjsip-perf -lpjsua pjsip-perf

Regards,

Paulo

2010/7/31 Shamun toha md <shamun.toha <at> gmail.com>

Dear sir,

I am using Fedora 12 and pjSIP. I am getting this error. for the reference of "pjsua_create()".

Error:
=====
[sun <at> example mysip]$ gcc pjsip-perf.c
/tmp/ccGXG4zr.o: In function `main':
pjsip-perf.c:(.text+0xa): undefined reference to `pjsua_create'

collect2: ld returned 1 exit status
[sun <at> example mysip]$



Code:
========
// Step -1
#include <pjsua-lib/pjsua.h>

// Step -2
#define sip_realm  "asterisk"
#define sip_domain "127.0.0.1"
#define sip_user   "dddd"
#define sip_passwd "dddd"



// Step -3
int main(int argc, char *argv[])
{

   pjsua_acc_id acc_id;
   pj_status_t status;
  
   // Create pjsua first
   status = pjsua_create();
  
  return 0;

}


Thank you
Best regards
Shamun




_______________________________________________
Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip <at> lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org


_______________________________________________
Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip <at> lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
<div>
<div>That is correct.&nbsp;</div>
<div>Ingeneral you need to specify&nbsp;</div>
<div>The include files paths with the -I option</div>
<div><br></div>
<div>The librareis path with -L option</div>
<div><br></div>
<div>And the librRies you r using</div>
<div>with. The -l&nbsp;</div>
<div><br></div>
<div>
<br><br>Sent from my iPhone</div>
<div>
<br>On Aug 1, 2010, at 12:49 AM, Paulo Rog&eacute;rio Panhoto &lt;<a href="mailto:paulo <at> voicetechnology.com.br">paulo <at> voicetechnology.com.br</a>&gt; wrote:<br><br>
</div>
<div></div>
<blockquote type="cite"><div>You need to add the pjsip libraries with the -l option.<br><br>i.e&gt; gcc -o pjsip-perf -lpjsua pjsip-perf<br><br>Regards,<br><br>Paulo<br><br><div class="gmail_quote">2010/7/31 Shamun toha md <span dir="ltr">&lt;<a href="mailto:shamu%0A%20n.toha <at> gmail.com"></a><a href="mailto:shamun.toha <at> gmail.com">shamun.toha <at> gmail.com</a>&gt;</span><br><blockquote class="gmail_quote">
<br><div class="gmail_quote">Dear sir,<br><br>I am using Fedora 12 and pjSIP. I am getting this error. for the reference of "pjsua_create()".<br><br>Error:<br>=====<br>[sun <at> example mysip]$ gcc pjsip-perf.c<br>/tmp/ccGXG4zr.o: In function `main':<br>

pjsip-perf.c:(.text+0xa): undefined reference to `pjsua_create'<div class="im">
<br>collect2: ld returned 1 exit status<br>
</div>[sun <at> example mysip]$ <br><br><br><br>Code:<br>========<br>// Step -1 <br>#include &lt;pjsua-lib/pjsua.h&gt;<br><br>// Step -2<br>#define sip_realm&nbsp; "asterisk"<br>#define sip_domain "127.0.0.1"<br>#define sip_user&nbsp;&nbsp; "dddd"<br>#define sip_passwd "dddd"<br><br><br><br>// Step -3<br>int main(int argc, char *argv[])<br>

{<div class="im">
<br>&nbsp;&nbsp; pjsua_acc_id acc_id;<br>
</div>&nbsp;&nbsp; pj_status_t status;<br>&nbsp;&nbsp; <br>&nbsp;&nbsp; // Create pjsua first<br>&nbsp;&nbsp; status = pjsua_create();<br>&nbsp;&nbsp; <br>&nbsp; return 0;<div class="im">
<br>}<br><br><br>Thank you<br>Best regards<br>Shamun<br><br><br>
</div>
</div>
<br><br>_______________________________________________<br>
Visit our blog: <a href="http://blog.pjsip.org" target="_blank"></a><a href="http://blog.pjsip.org">http://blog.pjsip.org</a><br><br>
pjsip mailing list<br><a href="mailto:pjsip <at> lists.pjsip.org"></a><a href="mailto:pjsip <at> lists.pjsip.org">pjsip <at> lists.pjsip.org</a><br><a href="http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org" target="_blank"></a><a href="http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org">http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org</a><br><br>
</blockquote>
</div>
<br>
</div></blockquote>
<blockquote type="cite"><div>
<span>_______________________________________________</span><br><span>Visit our blog: <a href="http://blog.pjsip.org"></a><a href="http://blog.pjsip.org">http://blog.pjsip.org</a></span><br><span></span><br><span>pjsip mailing list</span><br><span><a href="mailto:pjsip <at> lists.pjsip.org">pjsip <at> lists.pjsip.org</a></span><br><span><a href="http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org">http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org</a></span><br>
</div></blockquote>
</div>
Shamun toha md | 1 Aug 2010 13:54
Picon
Gravatar

GCC - getting fail and fail and fail

Dear sir,

Thank you, for your feedback. Still its not working.  You mention to use -L and -l, can you be kindly more specific, the whole PJSIP is complicated like rocket science, i am trying this for more then 7 days just to compile 10 lines of code and see the "Hello world".

14 line code:
==========
#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>

int main(int argc, char *argv[]) {
   pj_status_t status;
   status = pjsua_create();
  return 0;
}


Tried so far, but not yet working:
=========================
[root <at> example mysip]# gcc -L/usr/local/lib/ myapp.c -lpjsua
/usr/bin/ld: cannot find -lpjsua
collect2: ld returned 1 exit status
[root <at> example mysip]#

OR

[root <at> example mysip]# gcc -Wall myapp.c
/tmp/ccqFqozz.o: In function `main':
myapp.c:(.text+0xa): undefined reference to `pjsua_create'
collect2: ld returned 1 exit status
[root <at> example mysip]#




Question 1:
=========

What did you mean by -L ? The libraries folder path like following .a extention files? or the trunk file i downloaded using svn checkout?

[root <at> example mysip]# ls /usr/local/lib/libpj*
/usr/local/lib/libpj-i686-pc-linux-gnu.a                /usr/local/lib/libpjmedia-codec-i686-pc-linux-gnu.a  /usr/local/lib/libpjsip-i686-pc-linux-gnu.a         /usr/local/lib/libpjsua-i686-pc-linux-gnu.a
/usr/local/lib/libpjlib-util-i686-pc-linux-gnu.a        /usr/local/lib/libpjmedia-i686-pc-linux-gnu.a        /usr/local/lib/libpjsip-simple-i686-pc-linux-gnu.a
/usr/local/lib/libpjmedia-audiodev-i686-pc-linux-gnu.a  /usr/local/lib/libpjnath-i686-pc-linux-gnu.a         /usr/local/lib/libpjsip-ua-i686-pc-linux-gnu.a
[root <at> example mysip]#


Question 2
=========
What did you mean by -lpjsua ? Did you mean to use pjsua replace it by APP_LDLIBS ? after downloading the trunk file, there is a build.mak file example as following:

export MACHINE_NAME := auto
export OS_NAME := auto
export HOST_NAME := unix
export CC_NAME := gcc
export TARGET_NAME := i686-pc-linux-gnu
export CROSS_COMPILE :=
export LINUX_POLL := select

export ac_prefix := /usr/local

LIB_SUFFIX = $(TARGET_NAME).a

export APP_LDLIBS := -lpjsua-$(TARGET_NAME)\
    -lpjsip-ua-$(TARGET_NAME)\
    -lpjsip-simple-$(TARGET_NAME)\
    -lpjsip-$(TARGET_NAME)\
    -lpjmedia-codec-$(TARGET_NAME)\
    -lpjmedia-$(TARGET_NAME)\
    -lpjmedia-audiodev-$(TARGET_NAME)\
    -lpjnath-$(TARGET_NAME)\
    -lpjlib-util-$(TARGET_NAME)\
    $(APP_THIRD_PARTY_LIBS)\
    $(APP_THIRD_PARTY_EXT)\
    -lpj-$(TARGET_NAME)\
    -lm -lnsl -lrt -lpthread


Looking forward... :o(


Thank you
Best regards
Shamun

<div><p>Dear sir,<br><br>
Thank you, for your feedback. Still its not working.&nbsp; You mention to
use -L and -l, can you be kindly more specific, the whole PJSIP is
complicated like rocket science, i am trying this for more then 7 days
just to compile 10 lines of code and see the "Hello world".<br><br>
14 line code:<br>
==========<br>
#include &lt;pjlib.h&gt;<br>
#include &lt;pjlib-util.h&gt;<br>
#include &lt;pjmedia.h&gt;<br>
#include &lt;pjmedia-codec.h&gt;<br>
#include &lt;pjsip.h&gt;<br>
#include &lt;pjsip_simple.h&gt;<br>
#include &lt;pjsip_ua.h&gt;<br>
#include &lt;pjsua-lib/pjsua.h&gt;<br><br>
int main(int argc, char *argv[]) {<br>
&nbsp;&nbsp; pj_status_t status;<br>
&nbsp;&nbsp; status = pjsua_create();<br>
&nbsp; return 0;<br>
}<br><br><br>
Tried so far, but not yet working:<br>
=========================<br>
[root <at> example mysip]# gcc -L/usr/local/lib/ myapp.c -lpjsua<br>

/usr/bin/ld: cannot find -lpjsua<br>

collect2: ld returned 1 exit status<br>

[root <at> example mysip]# <br><br>
OR <br><br>
[root <at> example mysip]# gcc -Wall myapp.c<br>
/tmp/ccqFqozz.o: In function `main':<br>
myapp.c:(.text+0xa): undefined reference to `pjsua_create'<br>
collect2: ld returned 1 exit status<br>
[root <at> example mysip]# <br><br><br><br><br>
Question 1:<br>
=========<br><br>
What did you mean by -L ? The libraries folder path like following .a
extention files? or the trunk file i downloaded using svn checkout?<br><br>
[root <at> example mysip]# ls /usr/local/lib/libpj*<br>
/usr/local/lib/libpj-i686-pc-linux-gnu.a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
/usr/local/lib/libpjmedia-codec-i686-pc-linux-gnu.a&nbsp;
/usr/local/lib/libpjsip-i686-pc-linux-gnu.a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
/usr/local/lib/libpjsua-i686-pc-linux-gnu.a<br>
/usr/local/lib/libpjlib-util-i686-pc-linux-gnu.a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
/usr/local/lib/libpjmedia-i686-pc-linux-gnu.a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
/usr/local/lib/libpjsip-simple-i686-pc-linux-gnu.a<br>
/usr/local/lib/libpjmedia-audiodev-i686-pc-linux-gnu.a&nbsp;
/usr/local/lib/libpjnath-i686-pc-linux-gnu.a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
/usr/local/lib/libpjsip-ua-i686-pc-linux-gnu.a<br>
[root <at> example mysip]# <br><br><br>
Question 2<br>
=========<br>
What did you mean by -lpjsua ? Did you mean to use pjsua replace it by APP_LDLIBS ? after downloading the trunk file, there is a build.mak file example as following: <br><br>
export MACHINE_NAME := auto<br>
export OS_NAME := auto<br>
export HOST_NAME := unix<br>
export CC_NAME := gcc<br>
export TARGET_NAME := i686-pc-linux-gnu<br>
export CROSS_COMPILE := <br>
export LINUX_POLL := select <br><br>
export ac_prefix := /usr/local<br><br>
LIB_SUFFIX = $(TARGET_NAME).a<br><br>
export APP_LDLIBS := -lpjsua-$(TARGET_NAME)\<br>
&nbsp;&nbsp;&nbsp; -lpjsip-ua-$(TARGET_NAME)\<br>
&nbsp;&nbsp;&nbsp; -lpjsip-simple-$(TARGET_NAME)\<br>
&nbsp;&nbsp;&nbsp; -lpjsip-$(TARGET_NAME)\<br>
&nbsp;&nbsp;&nbsp; -lpjmedia-codec-$(TARGET_NAME)\<br>
&nbsp;&nbsp;&nbsp; -lpjmedia-$(TARGET_NAME)\<br>
&nbsp;&nbsp;&nbsp; -lpjmedia-audiodev-$(TARGET_NAME)\<br>
&nbsp;&nbsp;&nbsp; -lpjnath-$(TARGET_NAME)\<br>
&nbsp;&nbsp;&nbsp; -lpjlib-util-$(TARGET_NAME)\<br>
&nbsp;&nbsp;&nbsp; $(APP_THIRD_PARTY_LIBS)\<br>
&nbsp;&nbsp;&nbsp; $(APP_THIRD_PARTY_EXT)\<br>
&nbsp;&nbsp;&nbsp; -lpj-$(TARGET_NAME)\<br>
&nbsp;&nbsp;&nbsp; -lm -lnsl -lrt -lpthread <br><br><br>
Looking forward... :o(<br><br><br>
Thank you<br>
Best regards<br>
Shamun<br></p></div>
Shamun toha md | 1 Aug 2010 13:51
Picon
Gravatar

GCC fail

Dear sir,

Thank you, for your feedback. Still its not working.  You mention to use -L and -l, can you be kindly more specific, the whole PJSIP is complicated like rocket science, i am trying this for more then 7 days just to compile 10 lines of code and see the "Hello world".

14 line code:
==========
#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>

int main(int argc, char *argv[]) {
   pj_status_t status;
   status = pjsua_create();
  return 0;
}


Tried so far, but not yet working:
=========================
[root <at> example mysip]# gcc -L/usr/local/lib/ myapp.c -lpjsua
/usr/bin/ld: cannot find -lpjsua
collect2: ld returned 1 exit status
[root <at> example mysip]#

OR

[root <at> example mysip]# gcc -Wall myapp.c
/tmp/ccqFqozz.o: In function `main':
myapp.c:(.text+0xa): undefined reference to `pjsua_create'
collect2: ld returned 1 exit status
[root <at> example mysip]#




Question 1:
=========

What did you mean by -L ? The libraries folder path like following .a extention files? or the trunk file i downloaded using svn checkout?

[root <at> example mysip]# ls /usr/local/lib/libpj*
/usr/local/lib/libpj-i686-pc-linux-gnu.a                /usr/local/lib/libpjmedia-codec-i686-pc-linux-gnu.a  /usr/local/lib/libpjsip-i686-pc-linux-gnu.a         /usr/local/lib/libpjsua-i686-pc-linux-gnu.a
/usr/local/lib/libpjlib-util-i686-pc-linux-gnu.a        /usr/local/lib/libpjmedia-i686-pc-linux-gnu.a        /usr/local/lib/libpjsip-simple-i686-pc-linux-gnu.a
/usr/local/lib/libpjmedia-audiodev-i686-pc-linux-gnu.a  /usr/local/lib/libpjnath-i686-pc-linux-gnu.a         /usr/local/lib/libpjsip-ua-i686-pc-linux-gnu.a
[root <at> example mysip]#


Question 2
=========
What did you mean by -lpjsua ? Did you mean to use pjsua replace it by APP_LDLIBS ? after downloading the trunk file, there is a build.mak file example as following:

export MACHINE_NAME := auto
export OS_NAME := auto
export HOST_NAME := unix
export CC_NAME := gcc
export TARGET_NAME := i686-pc-linux-gnu
export CROSS_COMPILE :=
export LINUX_POLL := select

export ac_prefix := /usr/local

LIB_SUFFIX = $(TARGET_NAME).a

export APP_LDLIBS := -lpjsua-$(TARGET_NAME)\
    -lpjsip-ua-$(TARGET_NAME)\
    -lpjsip-simple-$(TARGET_NAME)\
    -lpjsip-$(TARGET_NAME)\
    -lpjmedia-codec-$(TARGET_NAME)\
    -lpjmedia-$(TARGET_NAME)\
    -lpjmedia-audiodev-$(TARGET_NAME)\
    -lpjnath-$(TARGET_NAME)\
    -lpjlib-util-$(TARGET_NAME)\
    $(APP_THIRD_PARTY_LIBS)\
    $(APP_THIRD_PARTY_EXT)\
    -lpj-$(TARGET_NAME)\
    -lm -lnsl -lrt -lpthread


Looking forward... :o(


Thank you
Best regards
Shamun



<div><p>Dear sir,<br><br>Thank you, for your feedback. Still its not working.&nbsp; You mention to use -L and -l, can you be kindly more specific, the whole PJSIP is complicated like rocket science, i am trying this for more then 7 days just to compile 10 lines of code and see the "Hello world".<br><br>14 line code:<br>==========<br>#include &lt;pjlib.h&gt;<br>#include &lt;pjlib-util.h&gt;<br>#include &lt;pjmedia.h&gt;<br>#include &lt;pjmedia-codec.h&gt;<br>#include &lt;pjsip.h&gt;<br>#include &lt;pjsip_simple.h&gt;<br>
#include &lt;pjsip_ua.h&gt;<br>#include &lt;pjsua-lib/pjsua.h&gt;<br><br>int main(int argc, char *argv[]) {<br>&nbsp;&nbsp; pj_status_t status;<br>&nbsp;&nbsp; status = pjsua_create();<br>&nbsp; return 0;<br>}<br><br><br>Tried so far, but not yet working:<br>
=========================<br>[root <at> example mysip]# gcc -L/usr/local/lib/ myapp.c -lpjsua<br>
/usr/bin/ld: cannot find -lpjsua<br>
collect2: ld returned 1 exit status<br>
[root <at> example mysip]# <br><br>OR <br><br>[root <at> example mysip]# gcc -Wall myapp.c<br>/tmp/ccqFqozz.o: In function `main':<br>myapp.c:(.text+0xa): undefined reference to `pjsua_create'<br>collect2: ld returned 1 exit status<br>
[root <at> example mysip]# <br><br><br><br><br>Question 1:<br>=========<br><br>What did you mean by -L ? The libraries folder path like following .a extention files? or the trunk file i downloaded using svn checkout?<br><br>[root <at> example mysip]# ls /usr/local/lib/libpj*<br>
/usr/local/lib/libpj-i686-pc-linux-gnu.a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /usr/local/lib/libpjmedia-codec-i686-pc-linux-gnu.a&nbsp; /usr/local/lib/libpjsip-i686-pc-linux-gnu.a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /usr/local/lib/libpjsua-i686-pc-linux-gnu.a<br>/usr/local/lib/libpjlib-util-i686-pc-linux-gnu.a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /usr/local/lib/libpjmedia-i686-pc-linux-gnu.a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /usr/local/lib/libpjsip-simple-i686-pc-linux-gnu.a<br>
/usr/local/lib/libpjmedia-audiodev-i686-pc-linux-gnu.a&nbsp; /usr/local/lib/libpjnath-i686-pc-linux-gnu.a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /usr/local/lib/libpjsip-ua-i686-pc-linux-gnu.a<br>[root <at> example mysip]# <br><br><br>Question 2<br>=========<br>What did you mean by -lpjsua ? Did you mean to use pjsua replace it by APP_LDLIBS ? after downloading the trunk file, there is a build.mak file example as following: <br><br>export MACHINE_NAME := auto<br>export OS_NAME := auto<br>export HOST_NAME := unix<br>export CC_NAME := gcc<br>export TARGET_NAME := i686-pc-linux-gnu<br>export CROSS_COMPILE := <br>export LINUX_POLL := select <br><br>
export ac_prefix := /usr/local<br><br>LIB_SUFFIX = $(TARGET_NAME).a<br><br>export APP_LDLIBS := -lpjsua-$(TARGET_NAME)\<br>&nbsp;&nbsp;&nbsp; -lpjsip-ua-$(TARGET_NAME)\<br>&nbsp;&nbsp;&nbsp; -lpjsip-simple-$(TARGET_NAME)\<br>&nbsp;&nbsp;&nbsp; -lpjsip-$(TARGET_NAME)\<br>
&nbsp;&nbsp;&nbsp; -lpjmedia-codec-$(TARGET_NAME)\<br>&nbsp;&nbsp;&nbsp; -lpjmedia-$(TARGET_NAME)\<br>&nbsp;&nbsp;&nbsp; -lpjmedia-audiodev-$(TARGET_NAME)\<br>&nbsp;&nbsp;&nbsp; -lpjnath-$(TARGET_NAME)\<br>&nbsp;&nbsp;&nbsp; -lpjlib-util-$(TARGET_NAME)\<br>&nbsp;&nbsp;&nbsp; $(APP_THIRD_PARTY_LIBS)\<br>&nbsp;&nbsp;&nbsp; $(APP_THIRD_PARTY_EXT)\<br>
&nbsp;&nbsp;&nbsp; -lpj-$(TARGET_NAME)\<br>&nbsp;&nbsp;&nbsp; -lm -lnsl -lrt -lpthread <br><br><br>Looking forward... :o(<br><br><br>Thank you<br>Best regards<br>Shamun<br><br><br><br></p></div>
Shamun toha md | 1 Aug 2010 14:41
Picon
Gravatar

Re: pjsip Digest, Vol 36, Issue 1

Thank you for the feedback. Tried didnt worked, Still not working.  Either my english is bad or i am stupid, please check details:

Scenario:
=======

My PJ installation:  http://gist.github.com/503309

My PJ application/compile/build/fail:  http://gist.github.com/503314


Please kindly advice.

Many thanks
Best regards
Shamun

<div><p>Thank you for the feedback. Tried didnt worked, Still not working.&nbsp; Either my english is bad or i am stupid, please check details:<br><br>Scenario:<br>=======<br><br>My PJ installation:&nbsp; <a href="http://gist.github.com/503309">http://gist.github.com/503309</a><br><br>My PJ application/compile/build/fail:&nbsp; <a href="http://gist.github.com/503314">http://gist.github.com/503314</a><br><br><br>Please kindly advice.<br><br>Many thanks<br>Best regards<br>Shamun<br><br></p></div>
Shamun toha md | 1 Aug 2010 16:22
Picon
Gravatar

pjsua_create() undefined

Dear Sir,

Can you please advice?


Code: SUCCESSFULL
==================
#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>

int main(int argc, char *argv[]) {
  return 0;
}
[root <at> example mysip]# gcc -L /home/sun/Downloads/pjsip/trunk/pjlib/lib/  myapp.c -I/home/sun/Downloads/pjsip/trunk/pjsip/include/
[root <at> example mysip]# ls
a.out  Makefile  Makefile~  myapp.c  myapp.c~  myapp.cpp  myapp.cpp~

Code: FAIL
===============
#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>

int main(int argc, char *argv[]) {
   pj_status_t status;
   status = pjsua_create();
  return 0;
}
[root <at> example mysip]# gcc -L /home/sun/Downloads/pjsip/trunk/pjlib/lib/  myapp.c -I/home/sun/Downloads/pjsip/trunk/pjsip/include/
/tmp/cc0p8IvC.o: In function `main':
myapp.c:(.text+0xa): undefined reference to `pjsua_create'
collect2: ld returned 1 exit status


Thank you
Best regards
Shamun

<div><p>Dear Sir,<br><br>Can you please advice?<br><br><br>Code: SUCCESSFULL<br>==================<br>#include &lt;pjlib.h&gt;<br>#include &lt;pjlib-util.h&gt;<br>#include &lt;pjmedia.h&gt;<br>#include &lt;pjmedia-codec.h&gt;<br>#include &lt;pjsip.h&gt;<br>
#include &lt;pjsip_simple.h&gt;<br>#include &lt;pjsip_ua.h&gt;<br>#include &lt;pjsua-lib/pjsua.h&gt;<br><br>int main(int argc, char *argv[]) {<br>&nbsp; return 0;<br>}<br>[root <at> example mysip]# gcc -L /home/sun/Downloads/pjsip/trunk/pjlib/lib/&nbsp; myapp.c -I/home/sun/Downloads/pjsip/trunk/pjsip/include/≤br>
[root <at> example mysip]# ls<br>a.out&nbsp; Makefile&nbsp; Makefile~&nbsp; myapp.c&nbsp; myapp.c~&nbsp; myapp.cpp&nbsp; myapp.cpp~<br><br>Code: FAIL<br>===============<br>#include &lt;pjlib.h&gt;<br>#include &lt;pjlib-util.h&gt;<br>#include &lt;pjmedia.h&gt;<br>
#include &lt;pjmedia-codec.h&gt;<br>#include &lt;pjsip.h&gt;<br>#include &lt;pjsip_simple.h&gt;<br>#include &lt;pjsip_ua.h&gt;<br>#include &lt;pjsua-lib/pjsua.h&gt;<br><br>int main(int argc, char *argv[]) {<br>&nbsp;&nbsp; pj_status_t status;<br>
&nbsp;&nbsp; status = pjsua_create();<br>&nbsp; return 0;<br>}<br>[root <at> example mysip]# gcc -L /home/sun/Downloads/pjsip/trunk/pjlib/lib/&nbsp; myapp.c -I/home/sun/Downloads/pjsip/trunk/pjsip/include/≤br>/tmp/cc0p8IvC.o: In function `main':<br>myapp.c:(.text+0xa): undefined reference to `pjsua_create'<br>collect2: ld returned 1 exit status<br><br><br>Thank you<br>Best regards<br>Shamun<br></p></div>
Alejandro Orellana | 1 Aug 2010 16:28

Re: pjsua_create() undefined

as mentioned before you need to include the libraries to link as well , using the option -l  (little L)

gcc -L /home/sun/Downloads/pjsip/trunk/pjlib/lib/  myapp.c -I/home/sun/Downloads/pjsip/trunk/pjsip/include/   -lLIBRARYNAMEHERE

On Aug 1, 2010, at 10:22 AM, Shamun toha md wrote:

gcc -L /home/sun/Downloads/pjsip/trunk/pjlib/lib/  myapp.c -I/home/sun/Downloads/pjsip/trunk/pjsip/include/

------
Alejandro Orellana
Savant Systems, LLC
770 Main Street
Osterville, Ma. 02655
(508) 683-2547 (W)
(508) 683-2647 (F)

Alejandro.Orellana <at> savantav.com

Statement of Confidentiality
The contents of this e-mail message and any attachments are confidential and are intended solely for the addressee. The information may also be legally privileged. This transmission is sent in trust, and the sole purpose of delivery to the intended recipient. If you have received this transmission in error, any use, reproduction or dissemination of this transmission is strictly prohibited. If you are not the intended recipient, please immediately notify the sender by reply e-mail or at 508.683-2500 and delete this message and its attachments, if any.



<div>as mentioned before you need to include the libraries to link as well , using the option -l &nbsp;(little L)<div><br></div>
<div>gcc -L /home/sun/Downloads/pjsip/trunk/pjlib/lib/&nbsp; myapp.c -I/home/sun/Downloads/pjsip/trunk/pjsip/include/ &nbsp; -lLIBRARYNAMEHERE</div>
<div>
<br><div>
<div>On Aug 1, 2010, at 10:22 AM, Shamun toha md wrote:</div>
<br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span">gcc -L /home/sun/Downloads/pjsip/trunk/pjlib/lib/&nbsp; myapp.c -I/home/sun/Downloads/pjsip/trunk/pjsip/include/≤/span></blockquote>
</div>
<br><div>
<span class="Apple-style-span"><div>
<div><span class="Apple-style-span">------</span></div>
<div><span class="Apple-style-span">Alejandro Orellana</span></div>
<div>
<span class="Apple-style-span">Savant Systems, LLC<br>770 Main Street<br>Osterville, Ma. 02655<br>(508) 683-2547 (W)<br>(508) 683-2647 (F)</span><br><a href="mailto:tim.locascio <at> savantav.com">Alejandro.Orellana <at> savantav.com</a>
</div>
<div><span class="Apple-style-span"><div><span class="Apple-style-span"><span class="Apple-style-span"><div><span class="Apple-style-span"><div><span class="Apple-style-span"><div>
<div><br></div>
<div>Statement of Confidentiality<br>The contents of this e-mail message and any attachments are confidential and are intended solely for the addressee. The information may also be legally privileged. This transmission is sent in trust, and the sole purpose of delivery to the intended recipient. If you have received this transmission in error, any use, reproduction or dissemination of this transmission is strictly prohibited. If you are not the intended recipient, please immediately notify the sender by reply e-mail or at 508.683-2500 and delete this message and its attachments, if any.</div>
<div><br></div>
</div></span></div></span></div></span></span></div></span></div>
</div></span><br class="Apple-interchange-newline">
</div>
<br>
</div>
</div>
Shamun toha md | 1 Aug 2010 16:41
Picon
Gravatar

pjsua_create() undefined

Thank you!!! for the details (-L small L and i uses). Now i got more errors.

[root <at> example mysip]# gcc -L /home/sun/Downloads/pjsip/trunk/pjlib/lib/  myapp.c -I/home/sun/Downloads/pjsip/trunk/pjsip/include/ \
-lpjsua-i686-pc-linux-gnu \
-lpjsip-ua-i686-pc-linux-gnu \
-lpjsip-simple-i686-pc-linux-gnu \
-lpjsip-i686-pc-linux-gnu \
-lpjmedia-i686-pc-linux-gnu \
-lpjmedia-i686-pc-linux-gnu \
-lpjmedia-audiodev-i686-pc-linux-gnu \
-lpjnath-i686-pc-linux-gnu \
-lpjlib-util-i686-pc-linux-gnu \
-lpj-i686-pc-linux-gnu

/usr/local/lib/libpjsua-i686-pc-linux-gnu.a(pjsua_media.o): In function `pjsua_media_subsys_init':
pjsua_media.c:(.text+0x296a): undefined reference to `pjmedia_codec_speex_init'
pjsua_media.c:(.text+0x2a0e): undefined reference to `pjmedia_codec_ilbc_init'
pjsua_media.c:(.text+0x2a23): undefined reference to `pjmedia_codec_gsm_init'
pjsua_media.c:(.text+0x2a4d): undefined reference to `pjmedia_codec_g722_init'
pjsua_media.c:(.text+0x2a6a): undefined reference to `pjmedia_codec_l16_init'
/usr/local/lib/libpjsua-i686-pc-linux-gnu.a(pjsua_media.o): In function `pjsua_media_subsys_destroy':
pjsua_media.c:(.text+0x3293): undefined reference to `pjmedia_codec_speex_deinit'
pjsua_media.c:(.text+0x3298): undefined reference to `pjmedia_codec_gsm_deinit'
pjsua_media.c:(.text+0x32a6): undefined reference to `pjmedia_codec_g722_deinit'
pjsua_media.c:(.text+0x32ab): undefined reference to `pjmedia_codec_l16_deinit'
/usr/local/lib/libpjmedia-i686-pc-linux-gnu.a(resample_resample.o): In function `pjmedia_resample_run':
resample_resample.c:(.text+0x16c): undefined reference to `res_Resample'
resample_resample.c:(.text+0x204): undefined reference to `res_SrcLinear'
resample_resample.c:(.text+0x268): undefined reference to `res_Resample'
resample_resample.c:(.text+0x2b7): undefined reference to `res_SrcLinear'
/usr/local/lib/libpjmedia-i686-pc-linux-gnu.a(resample_resample.o): In function `pjmedia_resample_create':
resample_resample.c:(.text+0x52f): undefined reference to `res_GetXOFF'
/usr/local/lib/libpjmedia-i686-pc-linux-gnu.a(transport_srtp.o): In function `pjmedia_transport_srtp_decrypt_pkt':
transport_srtp.c:(.text+0x318): undefined reference to `srtp_unprotect_rtcp'
transport_srtp.c:(.text+0x37a): undefined reference to `srtp_unprotect'
/usr/local/lib/libpjmedia-i686-pc-linux-gnu.a(transport_srtp.o): In function `pjmedia_transport_srtp_stop':
transport_srtp.c:(.text+0x42a): undefined reference to `srtp_dealloc'
transport_srtp.c:(.text+0x43e): undefined reference to `srtp_dealloc'
/usr/local/lib/libpjmedia-i686-pc-linux-gnu.a(transport_srtp.o): In function `srtp_rtcp_cb':
transport_srtp.c:(.text+0x66f): undefined reference to `srtp_unprotect_rtcp'
/usr/local/lib/libpjmedia-i686-pc-linux-gnu.a(transport_srtp.o): In function `generate_crypto_attr_value':
transport_srtp.c:(.text+0x8c0): undefined reference to `crypto_get_random'
/usr/local/lib/libpjmedia-i686-pc-linux-gnu.a(transport_srtp.o): In function `pjmedia_srtp_init_lib':
transport_srtp.c:(.text+0x9c1): undefined reference to `srtp_init'
/usr/local/lib/libpjmedia-i686-pc-linux-gnu.a(transport_srtp.o): In function `pjmedia_srtp_deinit_lib':
transport_srtp.c:(.text+0xa58): undefined reference to `srtp_deinit'
/usr/local/lib/libpjmedia-i686-pc-linux-gnu.a(transport_srtp.o): In function `transport_send_rtcp2':
transport_srtp.c:(.text+0x17de): undefined reference to `srtp_protect_rtcp'
/usr/local/lib/libpjmedia-i686-pc-linux-gnu.a(transport_srtp.o): In function `transport_send_rtp':
transport_srtp.c:(.text+0x1923): undefined reference to `srtp_protect'
/usr/local/lib/libpjmedia-i686-pc-linux-gnu.a(transport_srtp.o): In function `pjmedia_transport_srtp_start':
transport_srtp.c:(.text+0x209e): undefined reference to `srtp_create'
transport_srtp.c:(.text+0x2239): undefined reference to `srtp_create'
transport_srtp.c:(.text+0x23ae): undefined reference to `srtp_dealloc'
transport_srtp.c:(.text+0x23cd): undefined reference to `octet_string_hex_string'
transport_srtp.c:(.text+0x2464): undefined reference to `octet_string_hex_string'
/usr/local/lib/libpjmedia-i686-pc-linux-gnu.a(transport_srtp.o): In function `srtp_rtp_cb':
transport_srtp.c:(.text+0x251e): undefined reference to `srtp_unprotect'
transport_srtp.c:(.text+0x2644): undefined reference to `srtp_unprotect'
/usr/local/lib/libpjmedia-i686-pc-linux-gnu.a(wsola.o): In function `pjmedia_wsola_create':
wsola.c:(.text+0x828): undefined reference to `cos'
/usr/local/lib/libpjmedia-i686-pc-linux-gnu.a(echo_speex.o): In function `speex_aec_cancel_echo':
echo_speex.c:(.text+0x6d): undefined reference to `speex_echo_cancellation'
echo_speex.c:(.text+0x7f): undefined reference to `speex_preprocess_run'
/usr/local/lib/libpjmedia-i686-pc-linux-gnu.a(echo_speex.o): In function `speex_aec_destroy':
echo_speex.c:(.text+0xe8): undefined reference to `speex_echo_state_destroy'
echo_speex.c:(.text+0xfd): undefined reference to `speex_preprocess_state_destroy'
/usr/local/lib/libpjmedia-i686-pc-linux-gnu.a(echo_speex.o): In function `speex_aec_create':
echo_speex.c:(.text+0x1c7): undefined reference to `speex_echo_state_init'
echo_speex.c:(.text+0x1ec): undefined reference to `speex_echo_ctl'
echo_speex.c:(.text+0x1fb): undefined reference to `speex_preprocess_state_init'
echo_speex.c:(.text+0x21a): undefined reference to `speex_preprocess_ctl'
echo_speex.c:(.text+0x256): undefined reference to `speex_echo_state_destroy'
/usr/local/lib/libpjmedia-i686-pc-linux-gnu.a(echo_speex.o): In function `speex_aec_reset':
echo_speex.c:(.text+0xc0): undefined reference to `speex_echo_state_reset'
/usr/local/lib/libpjmedia-audiodev-i686-pc-linux-gnu.a(errno.o): In function `pjmedia_audiodev_strerror':
errno.c:(.text+0xbb): undefined reference to `Pa_GetErrorText'
/usr/local/lib/libpjmedia-audiodev-i686-pc-linux-gnu.a(pa_dev.o): In function `strm_destroy':
pa_dev.c:(.text+0x7d): undefined reference to `Pa_CloseStream'
pa_dev.c:(.text+0x93): undefined reference to `Pa_CloseStream'
/usr/local/lib/libpjmedia-audiodev-i686-pc-linux-gnu.a(pa_dev.o): In function `strm_stop':
pa_dev.c:(.text+0x19e): undefined reference to `Pa_StopStream'
pa_dev.c:(.text+0x1b4): undefined reference to `Pa_StopStream'
/usr/local/lib/libpjmedia-audiodev-i686-pc-linux-gnu.a(pa_dev.o): In function `strm_start':
pa_dev.c:(.text+0x284): undefined reference to `Pa_StartStream'
pa_dev.c:(.text+0x2c0): undefined reference to `Pa_StartStream'
pa_dev.c:(.text+0x2d1): undefined reference to `Pa_StopStream'
/usr/local/lib/libpjmedia-audiodev-i686-pc-linux-gnu.a(pa_dev.o): In function `strm_get_cap':
pa_dev.c:(.text+0x363): undefined reference to `Pa_GetStreamInfo'
pa_dev.c:(.text+0x3a3): undefined reference to `Pa_GetStreamInfo'
/usr/local/lib/libpjmedia-audiodev-i686-pc-linux-gnu.a(pa_dev.o): In function `pa_get_default_input_dev':
pa_dev.c:(.text+0x3fc): undefined reference to `Pa_GetHostApiCount'
pa_dev.c:(.text+0x414): undefined reference to `Pa_GetHostApiInfo'
pa_dev.c:(.text+0x429): undefined reference to `Pa_GetDeviceInfo'
pa_dev.c:(.text+0x43b): undefined reference to `Pa_GetDeviceCount'
pa_dev.c:(.text+0x45b): undefined reference to `Pa_GetDeviceInfo'
/usr/local/lib/libpjmedia-audiodev-i686-pc-linux-gnu.a(pa_dev.o): In function `pa_get_default_output_dev':
pa_dev.c:(.text+0x49c): undefined reference to `Pa_GetHostApiCount'
pa_dev.c:(.text+0x4b4): undefined reference to `Pa_GetHostApiInfo'
pa_dev.c:(.text+0x4c9): undefined reference to `Pa_GetDeviceInfo'
pa_dev.c:(.text+0x4db): undefined reference to `Pa_GetDeviceCount'
pa_dev.c:(.text+0x4fb): undefined reference to `Pa_GetDeviceInfo'
/usr/local/lib/libpjmedia-audiodev-i686-pc-linux-gnu.a(pa_dev.o): In function `pa_get_dev_count':
pa_dev.c:(.text+0x537): undefined reference to `Pa_GetDeviceCount'
/usr/local/lib/libpjmedia-audiodev-i686-pc-linux-gnu.a(pa_dev.o): In function `pa_destroy':
pa_dev.c:(.text+0x7fa): undefined reference to `Pa_Terminate'
/usr/local/lib/libpjmedia-audiodev-i686-pc-linux-gnu.a(pa_dev.o): In function `pa_init':
pa_dev.c:(.text+0x858): undefined reference to `Pa_Initialize'
pa_dev.c:(.text+0x8b3): undefined reference to `Pa_GetHostApiCount'
/usr/local/lib/libpjmedia-audiodev-i686-pc-linux-gnu.a(pa_dev.o): In function `pa_get_dev_info':
pa_dev.c:(.text+0xd09): undefined reference to `Pa_GetDeviceInfo'
/usr/local/lib/libpjmedia-audiodev-i686-pc-linux-gnu.a(pa_dev.o): In function `strm_get_param':
pa_dev.c:(.text+0xf14): undefined reference to `Pa_GetStreamInfo'
pa_dev.c:(.text+0xf2f): undefined reference to `Pa_GetStreamInfo'
/usr/local/lib/libpjmedia-audiodev-i686-pc-linux-gnu.a(pa_dev.o): In function `pa_create_stream':
pa_dev.c:(.text+0x10d8): undefined reference to `Pa_GetDeviceInfo'
pa_dev.c:(.text+0x1105): undefined reference to `Pa_GetDeviceInfo'
pa_dev.c:(.text+0x12da): undefined reference to `Pa_GetHostApiInfo'
pa_dev.c:(.text+0x1340): undefined reference to `Pa_GetHostApiInfo'
pa_dev.c:(.text+0x1382): undefined reference to `Pa_GetStreamInfo'
pa_dev.c:(.text+0x139c): undefined reference to `Pa_GetStreamInfo'
pa_dev.c:(.text+0x1400): undefined reference to `Pa_GetDeviceInfo'
pa_dev.c:(.text+0x15a6): undefined reference to `Pa_GetHostApiInfo'
pa_dev.c:(.text+0x15f5): undefined reference to `Pa_OpenStream'
pa_dev.c:(.text+0x160a): undefined reference to `Pa_GetStreamInfo'
pa_dev.c:(.text+0x16d6): undefined reference to `Pa_GetDeviceInfo'
pa_dev.c:(.text+0x1882): undefined reference to `Pa_GetHostApiInfo'
pa_dev.c:(.text+0x18d1): undefined reference to `Pa_OpenStream'
pa_dev.c:(.text+0x18e6): undefined reference to `Pa_GetStreamInfo'
pa_dev.c:(.text+0x1a80): undefined reference to `Pa_OpenStream'
pa_dev.c:(.text+0x1ad0): undefined reference to `Pa_OpenStream'
pa_dev.c:(.text+0x1aeb): undefined reference to `Pa_CloseStream'
pa_dev.c:(.text+0x1c68): undefined reference to `Pa_OpenStream'
/home/sun/Downloads/pjsip/trunk/pjlib/lib//libpj-i686-pc-linux-gnu.a(os_core_unix.o): In function `pj_sem_destroy':
os_core_unix.c:(.text+0x429): undefined reference to `sem_destroy'
/home/sun/Downloads/pjsip/trunk/pjlib/lib//libpj-i686-pc-linux-gnu.a(os_core_unix.o): In function `pj_sem_post':
os_core_unix.c:(.text+0x494): undefined reference to `sem_post'
/home/sun/Downloads/pjsip/trunk/pjlib/lib//libpj-i686-pc-linux-gnu.a(os_core_unix.o): In function `pj_sem_trywait':
os_core_unix.c:(.text+0x4d3): undefined reference to `sem_trywait'
/home/sun/Downloads/pjsip/trunk/pjlib/lib//libpj-i686-pc-linux-gnu.a(os_core_unix.o): In function `pj_sem_wait':
os_core_unix.c:(.text+0x549): undefined reference to `sem_wait'
/home/sun/Downloads/pjsip/trunk/pjlib/lib//libpj-i686-pc-linux-gnu.a(os_core_unix.o): In function `pj_sem_create':
os_core_unix.c:(.text+0x61b): undefined reference to `sem_init'
/home/sun/Downloads/pjsip/trunk/pjlib/lib//libpj-i686-pc-linux-gnu.a(os_core_unix.o): In function `pj_rwmutex_destroy':
os_core_unix.c:(.text+0x71d): undefined reference to `pthread_rwlock_destroy'
/home/sun/Downloads/pjsip/trunk/pjlib/lib//libpj-i686-pc-linux-gnu.a(os_core_unix.o): In function `pj_rwmutex_unlock_write':
os_core_unix.c:(.text+0x74d): undefined reference to `pthread_rwlock_unlock'
/home/sun/Downloads/pjsip/trunk/pjlib/lib//libpj-i686-pc-linux-gnu.a(os_core_unix.o): In function `pj_rwmutex_lock_write':
os_core_unix.c:(.text+0x78d): undefined reference to `pthread_rwlock_wrlock'
/home/sun/Downloads/pjsip/trunk/pjlib/lib//libpj-i686-pc-linux-gnu.a(os_core_unix.o): In function `pj_rwmutex_lock_read':
os_core_unix.c:(.text+0x7bd): undefined reference to `pthread_rwlock_rdlock'
/home/sun/Downloads/pjsip/trunk/pjlib/lib//libpj-i686-pc-linux-gnu.a(os_core_unix.o): In function `pj_rwmutex_create':
os_core_unix.c:(.text+0x80c): undefined reference to `pthread_rwlock_init'
/home/sun/Downloads/pjsip/trunk/pjlib/lib//libpj-i686-pc-linux-gnu.a(os_core_unix.o): In function `init_mutex':
os_core_unix.c:(.text+0x98d): undefined reference to `pthread_mutexattr_init'
os_core_unix.c:(.text+0x9c1): undefined reference to `pthread_mutexattr_settype'
os_core_unix.c:(.text+0x9dd): undefined reference to `pthread_mutexattr_destroy'
os_core_unix.c:(.text+0xa04): undefined reference to `pthread_mutexattr_settype'
/home/sun/Downloads/pjsip/trunk/pjlib/lib//libpj-i686-pc-linux-gnu.a(os_core_unix.o): In function `pj_mutex_trylock':
os_core_unix.c:(.text+0xc1c): undefined reference to `pthread_mutex_trylock'
/home/sun/Downloads/pjsip/trunk/pjlib/lib//libpj-i686-pc-linux-gnu.a(os_core_unix.o): In function `pj_thread_local_set':
os_core_unix.c:(.text+0xff4): undefined reference to `pthread_setspecific'
/home/sun/Downloads/pjsip/trunk/pjlib/lib//libpj-i686-pc-linux-gnu.a(os_core_unix.o): In function `pj_thread_local_alloc':
os_core_unix.c:(.text+0x10bd): undefined reference to `pthread_key_create'
/home/sun/Downloads/pjsip/trunk/pjlib/lib//libpj-i686-pc-linux-gnu.a(os_core_unix.o): In function `pj_thread_join':
os_core_unix.c:(.text+0x11fc): undefined reference to `pthread_join'
/home/sun/Downloads/pjsip/trunk/pjlib/lib//libpj-i686-pc-linux-gnu.a(os_core_unix.o): In function `pj_thread_create':
os_core_unix.c:(.text+0x12ef): undefined reference to `pthread_create'
/home/sun/Downloads/pjsip/trunk/pjlib/lib//libpj-i686-pc-linux-gnu.a(os_core_unix.o): In function `pj_thread_local_get':
os_core_unix.c:(.text+0xb98): undefined reference to `pthread_getspecific'
/home/sun/Downloads/pjsip/trunk/pjlib/lib//libpj-i686-pc-linux-gnu.a(os_core_unix.o): In function `pj_thread_local_free':
os_core_unix.c:(.text+0x1098): undefined reference to `pthread_key_delete'
/home/sun/Downloads/pjsip/trunk/pjlib/lib//libpj-i686-pc-linux-gnu.a(os_timestamp_common.o): In function `pj_elapsed_time':
os_timestamp_common.c:(.text+0x123): undefined reference to `fmod'
collect2: ld returned 1 exit status




Many Thanks
Best regards
Shamun

<div><p>Thank you!!! for the details (-L small L and i uses). Now i got more errors.<br><br>[root <at> example mysip]# gcc -L /home/sun/Downloads/pjsip/trunk/pjlib/lib/&nbsp; myapp.c -I/home/sun/Downloads/pjsip/trunk/pjsip/include/ \<br>-lpjsua-i686-pc-linux-gnu \<br>
-lpjsip-ua-i686-pc-linux-gnu \<br>-lpjsip-simple-i686-pc-linux-gnu \<br>-lpjsip-i686-pc-linux-gnu \<br>-lpjmedia-i686-pc-linux-gnu \<br>-lpjmedia-i686-pc-linux-gnu \<br>-lpjmedia-audiodev-i686-pc-linux-gnu \<br>-lpjnath-i686-pc-linux-gnu \<br>
-lpjlib-util-i686-pc-linux-gnu \<br>-lpj-i686-pc-linux-gnu<br><br>/usr/local/lib/libpjsua-i686-pc-linux-gnu.a(pjsua_media.o): In function `pjsua_media_subsys_init':<br>pjsua_media.c:(.text+0x296a): undefined reference to `pjmedia_codec_speex_init'<br>
pjsua_media.c:(.text+0x2a0e): undefined reference to `pjmedia_codec_ilbc_init'<br>pjsua_media.c:(.text+0x2a23): undefined reference to `pjmedia_codec_gsm_init'<br>pjsua_media.c:(.text+0x2a4d): undefined reference to `pjmedia_codec_g722_init'<br>
pjsua_media.c:(.text+0x2a6a): undefined reference to `pjmedia_codec_l16_init'<br>/usr/local/lib/libpjsua-i686-pc-linux-gnu.a(pjsua_media.o): In function `pjsua_media_subsys_destroy':<br>pjsua_media.c:(.text+0x3293): undefined reference to `pjmedia_codec_speex_deinit'<br>
pjsua_media.c:(.text+0x3298): undefined reference to `pjmedia_codec_gsm_deinit'<br>pjsua_media.c:(.text+0x32a6): undefined reference to `pjmedia_codec_g722_deinit'<br>pjsua_media.c:(.text+0x32ab): undefined reference to `pjmedia_codec_l16_deinit'<br>
/usr/local/lib/libpjmedia-i686-pc-linux-gnu.a(resample_resample.o): In function `pjmedia_resample_run':<br>resample_resample.c:(.text+0x16c): undefined reference to `res_Resample'<br>resample_resample.c:(.text+0x204): undefined reference to `res_SrcLinear'<br>
resample_resample.c:(.text+0x268): undefined reference to `res_Resample'<br>resample_resample.c:(.text+0x2b7): undefined reference to `res_SrcLinear'<br>/usr/local/lib/libpjmedia-i686-pc-linux-gnu.a(resample_resample.o): In function `pjmedia_resample_create':<br>
resample_resample.c:(.text+0x52f): undefined reference to `res_GetXOFF'<br>/usr/local/lib/libpjmedia-i686-pc-linux-gnu.a(transport_srtp.o): In function `pjmedia_transport_srtp_decrypt_pkt':<br>transport_srtp.c:(.text+0x318): undefined reference to `srtp_unprotect_rtcp'<br>
transport_srtp.c:(.text+0x37a): undefined reference to `srtp_unprotect'<br>/usr/local/lib/libpjmedia-i686-pc-linux-gnu.a(transport_srtp.o): In function `pjmedia_transport_srtp_stop':<br>transport_srtp.c:(.text+0x42a): undefined reference to `srtp_dealloc'<br>
transport_srtp.c:(.text+0x43e): undefined reference to `srtp_dealloc'<br>/usr/local/lib/libpjmedia-i686-pc-linux-gnu.a(transport_srtp.o): In function `srtp_rtcp_cb':<br>transport_srtp.c:(.text+0x66f): undefined reference to `srtp_unprotect_rtcp'<br>
/usr/local/lib/libpjmedia-i686-pc-linux-gnu.a(transport_srtp.o): In function `generate_crypto_attr_value':<br>transport_srtp.c:(.text+0x8c0): undefined reference to `crypto_get_random'<br>/usr/local/lib/libpjmedia-i686-pc-linux-gnu.a(transport_srtp.o): In function `pjmedia_srtp_init_lib':<br>
transport_srtp.c:(.text+0x9c1): undefined reference to `srtp_init'<br>/usr/local/lib/libpjmedia-i686-pc-linux-gnu.a(transport_srtp.o): In function `pjmedia_srtp_deinit_lib':<br>transport_srtp.c:(.text+0xa58): undefined reference to `srtp_deinit'<br>
/usr/local/lib/libpjmedia-i686-pc-linux-gnu.a(transport_srtp.o): In function `transport_send_rtcp2':<br>transport_srtp.c:(.text+0x17de): undefined reference to `srtp_protect_rtcp'<br>/usr/local/lib/libpjmedia-i686-pc-linux-gnu.a(transport_srtp.o): In function `transport_send_rtp':<br>
transport_srtp.c:(.text+0x1923): undefined reference to `srtp_protect'<br>/usr/local/lib/libpjmedia-i686-pc-linux-gnu.a(transport_srtp.o): In function `pjmedia_transport_srtp_start':<br>transport_srtp.c:(.text+0x209e): undefined reference to `srtp_create'<br>
transport_srtp.c:(.text+0x2239): undefined reference to `srtp_create'<br>transport_srtp.c:(.text+0x23ae): undefined reference to `srtp_dealloc'<br>transport_srtp.c:(.text+0x23cd): undefined reference to `octet_string_hex_string'<br>
transport_srtp.c:(.text+0x2464): undefined reference to `octet_string_hex_string'<br>/usr/local/lib/libpjmedia-i686-pc-linux-gnu.a(transport_srtp.o): In function `srtp_rtp_cb':<br>transport_srtp.c:(.text+0x251e): undefined reference to `srtp_unprotect'<br>
transport_srtp.c:(.text+0x2644): undefined reference to `srtp_unprotect'<br>/usr/local/lib/libpjmedia-i686-pc-linux-gnu.a(wsola.o): In function `pjmedia_wsola_create':<br>wsola.c:(.text+0x828): undefined reference to `cos'<br>
/usr/local/lib/libpjmedia-i686-pc-linux-gnu.a(echo_speex.o): In function `speex_aec_cancel_echo':<br>echo_speex.c:(.text+0x6d): undefined reference to `speex_echo_cancellation'<br>echo_speex.c:(.text+0x7f): undefined reference to `speex_preprocess_run'<br>
/usr/local/lib/libpjmedia-i686-pc-linux-gnu.a(echo_speex.o): In function `speex_aec_destroy':<br>echo_speex.c:(.text+0xe8): undefined reference to `speex_echo_state_destroy'<br>echo_speex.c:(.text+0xfd): undefined reference to `speex_preprocess_state_destroy'<br>
/usr/local/lib/libpjmedia-i686-pc-linux-gnu.a(echo_speex.o): In function `speex_aec_create':<br>echo_speex.c:(.text+0x1c7): undefined reference to `speex_echo_state_init'<br>echo_speex.c:(.text+0x1ec): undefined reference to `speex_echo_ctl'<br>
echo_speex.c:(.text+0x1fb): undefined reference to `speex_preprocess_state_init'<br>echo_speex.c:(.text+0x21a): undefined reference to `speex_preprocess_ctl'<br>echo_speex.c:(.text+0x256): undefined reference to `speex_echo_state_destroy'<br>
/usr/local/lib/libpjmedia-i686-pc-linux-gnu.a(echo_speex.o): In function `speex_aec_reset':<br>echo_speex.c:(.text+0xc0): undefined reference to `speex_echo_state_reset'<br>/usr/local/lib/libpjmedia-audiodev-i686-pc-linux-gnu.a(errno.o): In function `pjmedia_audiodev_strerror':<br>
errno.c:(.text+0xbb): undefined reference to `Pa_GetErrorText'<br>/usr/local/lib/libpjmedia-audiodev-i686-pc-linux-gnu.a(pa_dev.o): In function `strm_destroy':<br>pa_dev.c:(.text+0x7d): undefined reference to `Pa_CloseStream'<br>
pa_dev.c:(.text+0x93): undefined reference to `Pa_CloseStream'<br>/usr/local/lib/libpjmedia-audiodev-i686-pc-linux-gnu.a(pa_dev.o): In function `strm_stop':<br>pa_dev.c:(.text+0x19e): undefined reference to `Pa_StopStream'<br>
pa_dev.c:(.text+0x1b4): undefined reference to `Pa_StopStream'<br>/usr/local/lib/libpjmedia-audiodev-i686-pc-linux-gnu.a(pa_dev.o): In function `strm_start':<br>pa_dev.c:(.text+0x284): undefined reference to `Pa_StartStream'<br>
pa_dev.c:(.text+0x2c0): undefined reference to `Pa_StartStream'<br>pa_dev.c:(.text+0x2d1): undefined reference to `Pa_StopStream'<br>/usr/local/lib/libpjmedia-audiodev-i686-pc-linux-gnu.a(pa_dev.o): In function `strm_get_cap':<br>
pa_dev.c:(.text+0x363): undefined reference to `Pa_GetStreamInfo'<br>pa_dev.c:(.text+0x3a3): undefined reference to `Pa_GetStreamInfo'<br>/usr/local/lib/libpjmedia-audiodev-i686-pc-linux-gnu.a(pa_dev.o): In function `pa_get_default_input_dev':<br>
pa_dev.c:(.text+0x3fc): undefined reference to `Pa_GetHostApiCount'<br>pa_dev.c:(.text+0x414): undefined reference to `Pa_GetHostApiInfo'<br>pa_dev.c:(.text+0x429): undefined reference to `Pa_GetDeviceInfo'<br>
pa_dev.c:(.text+0x43b): undefined reference to `Pa_GetDeviceCount'<br>pa_dev.c:(.text+0x45b): undefined reference to `Pa_GetDeviceInfo'<br>/usr/local/lib/libpjmedia-audiodev-i686-pc-linux-gnu.a(pa_dev.o): In function `pa_get_default_output_dev':<br>
pa_dev.c:(.text+0x49c): undefined reference to `Pa_GetHostApiCount'<br>pa_dev.c:(.text+0x4b4): undefined reference to `Pa_GetHostApiInfo'<br>pa_dev.c:(.text+0x4c9): undefined reference to `Pa_GetDeviceInfo'<br>
pa_dev.c:(.text+0x4db): undefined reference to `Pa_GetDeviceCount'<br>pa_dev.c:(.text+0x4fb): undefined reference to `Pa_GetDeviceInfo'<br>/usr/local/lib/libpjmedia-audiodev-i686-pc-linux-gnu.a(pa_dev.o): In function `pa_get_dev_count':<br>
pa_dev.c:(.text+0x537): undefined reference to `Pa_GetDeviceCount'<br>/usr/local/lib/libpjmedia-audiodev-i686-pc-linux-gnu.a(pa_dev.o): In function `pa_destroy':<br>pa_dev.c:(.text+0x7fa): undefined reference to `Pa_Terminate'<br>
/usr/local/lib/libpjmedia-audiodev-i686-pc-linux-gnu.a(pa_dev.o): In function `pa_init':<br>pa_dev.c:(.text+0x858): undefined reference to `Pa_Initialize'<br>pa_dev.c:(.text+0x8b3): undefined reference to `Pa_GetHostApiCount'<br>
/usr/local/lib/libpjmedia-audiodev-i686-pc-linux-gnu.a(pa_dev.o): In function `pa_get_dev_info':<br>pa_dev.c:(.text+0xd09): undefined reference to `Pa_GetDeviceInfo'<br>/usr/local/lib/libpjmedia-audiodev-i686-pc-linux-gnu.a(pa_dev.o): In function `strm_get_param':<br>
pa_dev.c:(.text+0xf14): undefined reference to `Pa_GetStreamInfo'<br>pa_dev.c:(.text+0xf2f): undefined reference to `Pa_GetStreamInfo'<br>/usr/local/lib/libpjmedia-audiodev-i686-pc-linux-gnu.a(pa_dev.o): In function `pa_create_stream':<br>
pa_dev.c:(.text+0x10d8): undefined reference to `Pa_GetDeviceInfo'<br>pa_dev.c:(.text+0x1105): undefined reference to `Pa_GetDeviceInfo'<br>pa_dev.c:(.text+0x12da): undefined reference to `Pa_GetHostApiInfo'<br>
pa_dev.c:(.text+0x1340): undefined reference to `Pa_GetHostApiInfo'<br>pa_dev.c:(.text+0x1382): undefined reference to `Pa_GetStreamInfo'<br>pa_dev.c:(.text+0x139c): undefined reference to `Pa_GetStreamInfo'<br>
pa_dev.c:(.text+0x1400): undefined reference to `Pa_GetDeviceInfo'<br>pa_dev.c:(.text+0x15a6): undefined reference to `Pa_GetHostApiInfo'<br>pa_dev.c:(.text+0x15f5): undefined reference to `Pa_OpenStream'<br>pa_dev.c:(.text+0x160a): undefined reference to `Pa_GetStreamInfo'<br>
pa_dev.c:(.text+0x16d6): undefined reference to `Pa_GetDeviceInfo'<br>pa_dev.c:(.text+0x1882): undefined reference to `Pa_GetHostApiInfo'<br>pa_dev.c:(.text+0x18d1): undefined reference to `Pa_OpenStream'<br>pa_dev.c:(.text+0x18e6): undefined reference to `Pa_GetStreamInfo'<br>
pa_dev.c:(.text+0x1a80): undefined reference to `Pa_OpenStream'<br>pa_dev.c:(.text+0x1ad0): undefined reference to `Pa_OpenStream'<br>pa_dev.c:(.text+0x1aeb): undefined reference to `Pa_CloseStream'<br>pa_dev.c:(.text+0x1c68): undefined reference to `Pa_OpenStream'<br>
/home/sun/Downloads/pjsip/trunk/pjlib/lib//libpj-i686-pc-linux-gnu.a(os_core_unix.o): In function `pj_sem_destroy':<br>os_core_unix.c:(.text+0x429): undefined reference to `sem_destroy'<br>/home/sun/Downloads/pjsip/trunk/pjlib/lib//libpj-i686-pc-linux-gnu.a(os_core_unix.o): In function `pj_sem_post':<br>
os_core_unix.c:(.text+0x494): undefined reference to `sem_post'<br>/home/sun/Downloads/pjsip/trunk/pjlib/lib//libpj-i686-pc-linux-gnu.a(os_core_unix.o): In function `pj_sem_trywait':<br>os_core_unix.c:(.text+0x4d3): undefined reference to `sem_trywait'<br>
/home/sun/Downloads/pjsip/trunk/pjlib/lib//libpj-i686-pc-linux-gnu.a(os_core_unix.o): In function `pj_sem_wait':<br>os_core_unix.c:(.text+0x549): undefined reference to `sem_wait'<br>/home/sun/Downloads/pjsip/trunk/pjlib/lib//libpj-i686-pc-linux-gnu.a(os_core_unix.o): In function `pj_sem_create':<br>
os_core_unix.c:(.text+0x61b): undefined reference to `sem_init'<br>/home/sun/Downloads/pjsip/trunk/pjlib/lib//libpj-i686-pc-linux-gnu.a(os_core_unix.o): In function `pj_rwmutex_destroy':<br>os_core_unix.c:(.text+0x71d): undefined reference to `pthread_rwlock_destroy'<br>
/home/sun/Downloads/pjsip/trunk/pjlib/lib//libpj-i686-pc-linux-gnu.a(os_core_unix.o): In function `pj_rwmutex_unlock_write':<br>os_core_unix.c:(.text+0x74d): undefined reference to `pthread_rwlock_unlock'<br>/home/sun/Downloads/pjsip/trunk/pjlib/lib//libpj-i686-pc-linux-gnu.a(os_core_unix.o): In function `pj_rwmutex_lock_write':<br>
os_core_unix.c:(.text+0x78d): undefined reference to `pthread_rwlock_wrlock'<br>/home/sun/Downloads/pjsip/trunk/pjlib/lib//libpj-i686-pc-linux-gnu.a(os_core_unix.o): In function `pj_rwmutex_lock_read':<br>os_core_unix.c:(.text+0x7bd): undefined reference to `pthread_rwlock_rdlock'<br>
/home/sun/Downloads/pjsip/trunk/pjlib/lib//libpj-i686-pc-linux-gnu.a(os_core_unix.o): In function `pj_rwmutex_create':<br>os_core_unix.c:(.text+0x80c): undefined reference to `pthread_rwlock_init'<br>/home/sun/Downloads/pjsip/trunk/pjlib/lib//libpj-i686-pc-linux-gnu.a(os_core_unix.o): In function `init_mutex':<br>
os_core_unix.c:(.text+0x98d): undefined reference to `pthread_mutexattr_init'<br>os_core_unix.c:(.text+0x9c1): undefined reference to `pthread_mutexattr_settype'<br>os_core_unix.c:(.text+0x9dd): undefined reference to `pthread_mutexattr_destroy'<br>
os_core_unix.c:(.text+0xa04): undefined reference to `pthread_mutexattr_settype'<br>/home/sun/Downloads/pjsip/trunk/pjlib/lib//libpj-i686-pc-linux-gnu.a(os_core_unix.o): In function `pj_mutex_trylock':<br>os_core_unix.c:(.text+0xc1c): undefined reference to `pthread_mutex_trylock'<br>
/home/sun/Downloads/pjsip/trunk/pjlib/lib//libpj-i686-pc-linux-gnu.a(os_core_unix.o): In function `pj_thread_local_set':<br>os_core_unix.c:(.text+0xff4): undefined reference to `pthread_setspecific'<br>/home/sun/Downloads/pjsip/trunk/pjlib/lib//libpj-i686-pc-linux-gnu.a(os_core_unix.o): In function `pj_thread_local_alloc':<br>
os_core_unix.c:(.text+0x10bd): undefined reference to `pthread_key_create'<br>/home/sun/Downloads/pjsip/trunk/pjlib/lib//libpj-i686-pc-linux-gnu.a(os_core_unix.o): In function `pj_thread_join':<br>os_core_unix.c:(.text+0x11fc): undefined reference to `pthread_join'<br>
/home/sun/Downloads/pjsip/trunk/pjlib/lib//libpj-i686-pc-linux-gnu.a(os_core_unix.o): In function `pj_thread_create':<br>os_core_unix.c:(.text+0x12ef): undefined reference to `pthread_create'<br>/home/sun/Downloads/pjsip/trunk/pjlib/lib//libpj-i686-pc-linux-gnu.a(os_core_unix.o): In function `pj_thread_local_get':<br>
os_core_unix.c:(.text+0xb98): undefined reference to `pthread_getspecific'<br>/home/sun/Downloads/pjsip/trunk/pjlib/lib//libpj-i686-pc-linux-gnu.a(os_core_unix.o): In function `pj_thread_local_free':<br>os_core_unix.c:(.text+0x1098): undefined reference to `pthread_key_delete'<br>
/home/sun/Downloads/pjsip/trunk/pjlib/lib//libpj-i686-pc-linux-gnu.a(os_timestamp_common.o): In function `pj_elapsed_time':<br>os_timestamp_common.c:(.text+0x123): undefined reference to `fmod'<br>collect2: ld returned 1 exit status<br><br><br><br><br>Many Thanks<br>Best regards<br>Shamun<br><br></p></div>
Alejandro Orellana | 1 Aug 2010 17:29

Re: pjsua_create() undefined

You have to add all the path to include files and all the library paths  

You r including only 1

Sent from my iPhone

On Aug 1, 2010, at 10:41 AM, Shamun toha md <shamun.toha <at> gmail.com> wrote:

> Thank you!!! for the details (-L small L and i uses). Now i got more errors.
> 
> [root <at> example mysip]# gcc -L /home/sun/Downloads/pjsip/trunk/pjlib/lib/  myapp.c
-I/home/sun/Downloads/pjsip/trunk/pjsip/include/ \
> -lpjsua-i686-pc-linux-gnu \
> -lpjsip-ua-i686-pc-linux-gnu \
> -lpjsip-simple-i686-pc-linux-gnu \
> -lpjsip-i686-pc-linux-gnu \
> -lpjmedia-i686-pc-linux-gnu \
> -lpjmedia-i686-pc-linux-gnu \
> -lpjmedia-audiodev-i686-pc-linux-gnu \
> -lpjnath-i686-pc-linux-gnu \
> -lpjlib-util-i686-pc-linux-gnu \
> -lpj-i686-pc-linux-gnu
> 
> /usr/local/lib/libpjsua-i686-pc-linux-gnu.a(pjsua_media.o): In function `pjsua_media_subsys_init':
> pjsua_media.c:(.text+0x296a): undefined reference to `pjmedia_codec_speex_init'
> pjsua_media.c:(.text+0x2a0e): undefined reference to `pjmedia_codec_ilbc_init'
> pjsua_media.c:(.text+0x2a23): undefined reference to `pjmedia_codec_gsm_init'
> pjsua_media.c:(.text+0x2a4d): undefined reference to `pjmedia_codec_g722_init'
> pjsua_media.c:(.text+0x2a6a): undefined reference to `pjmedia_codec_l16_init'
> /usr/local/lib/libpjsua-i686-pc-linux-gnu.a(pjsua_media.o): In function `pjsua_media_subsys_destroy':
> pjsua_media.c:(.text+0x3293): undefined reference to `pjmedia_codec_speex_deinit'
> pjsua_media.c:(.text+0x3298): undefined reference to `pjmedia_codec_gsm_deinit'
> pjsua_media.c:(.text+0x32a6): undefined reference to `pjmedia_codec_g722_deinit'
> pjsua_media.c:(.text+0x32ab): undefined reference to `pjmedia_codec_l16_deinit'
> /usr/local/lib/libpjmedia-i686-pc-linux-gnu.a(resample_resample.o): In function `pjmedia_resample_run':
> resample_resample.c:(.text+0x16c): undefined reference to `res_Resample'
> resample_resample.c:(.text+0x204): undefined reference to `res_SrcLinear'
> resample_resample.c:(.text+0x268): undefined reference to `res_Resample'
> resample_resample.c:(.text+0x2b7): undefined reference to `res_SrcLinear'
> /usr/local/lib/libpjmedia-i686-pc-linux-gnu.a(resample_resample.o): In function `pjmedia_resample_create':
> resample_resample.c:(.text+0x52f): undefined reference to `res_GetXOFF'
> /usr/local/lib/libpjmedia-i686-pc-linux-gnu.a(transport_srtp.o): In function `pjmedia_transport_srtp_decrypt_pkt':
> transport_srtp.c:(.text+0x318): undefined reference to `srtp_unprotect_rtcp'
> transport_srtp.c:(.text+0x37a): undefined reference to `srtp_unprotect'
> /usr/local/lib/libpjmedia-i686-pc-linux-gnu.a(transport_srtp.o): In function `pjmedia_transport_srtp_stop':
> transport_srtp.c:(.text+0x42a): undefined reference to `srtp_dealloc'
> transport_srtp.c:(.text+0x43e): undefined reference to `srtp_dealloc'
> /usr/local/lib/libpjmedia-i686-pc-linux-gnu.a(transport_srtp.o): In function `srtp_rtcp_cb':
> transport_srtp.c:(.text+0x66f): undefined reference to `srtp_unprotect_rtcp'
> /usr/local/lib/libpjmedia-i686-pc-linux-gnu.a(transport_srtp.o): In function `generate_crypto_attr_value':
> transport_srtp.c:(.text+0x8c0): undefined reference to `crypto_get_random'
> /usr/local/lib/libpjmedia-i686-pc-linux-gnu.a(transport_srtp.o): In function `pjmedia_srtp_init_lib':
> transport_srtp.c:(.text+0x9c1): undefined reference to `srtp_init'
> /usr/local/lib/libpjmedia-i686-pc-linux-gnu.a(transport_srtp.o): In function `pjmedia_srtp_deinit_lib':
> transport_srtp.c:(.text+0xa58): undefined reference to `srtp_deinit'
> /usr/local/lib/libpjmedia-i686-pc-linux-gnu.a(transport_srtp.o): In function `transport_send_rtcp2':
> transport_srtp.c:(.text+0x17de): undefined reference to `srtp_protect_rtcp'
> /usr/local/lib/libpjmedia-i686-pc-linux-gnu.a(transport_srtp.o): In function `transport_send_rtp':
> transport_srtp.c:(.text+0x1923): undefined reference to `srtp_protect'
> /usr/local/lib/libpjmedia-i686-pc-linux-gnu.a(transport_srtp.o): In function `pjmedia_transport_srtp_start':
> transport_srtp.c:(.text+0x209e): undefined reference to `srtp_create'
> transport_srtp.c:(.text+0x2239): undefined reference to `srtp_create'
> transport_srtp.c:(.text+0x23ae): undefined reference to `srtp_dealloc'
> transport_srtp.c:(.text+0x23cd): undefined reference to `octet_string_hex_string'
> transport_srtp.c:(.text+0x2464): undefined reference to `octet_string_hex_string'
> /usr/local/lib/libpjmedia-i686-pc-linux-gnu.a(transport_srtp.o): In function `srtp_rtp_cb':
> transport_srtp.c:(.text+0x251e): undefined reference to `srtp_unprotect'
> transport_srtp.c:(.text+0x2644): undefined reference to `srtp_unprotect'
> /usr/local/lib/libpjmedia-i686-pc-linux-gnu.a(wsola.o): In function `pjmedia_wsola_create':
> wsola.c:(.text+0x828): undefined reference to `cos'
> /usr/local/lib/libpjmedia-i686-pc-linux-gnu.a(echo_speex.o): In function `speex_aec_cancel_echo':
> echo_speex.c:(.text+0x6d): undefined reference to `speex_echo_cancellation'
> echo_speex.c:(.text+0x7f): undefined reference to `speex_preprocess_run'
> /usr/local/lib/libpjmedia-i686-pc-linux-gnu.a(echo_speex.o): In function `speex_aec_destroy':
> echo_speex.c:(.text+0xe8): undefined reference to `speex_echo_state_destroy'
> echo_speex.c:(.text+0xfd): undefined reference to `speex_preprocess_state_destroy'
> /usr/local/lib/libpjmedia-i686-pc-linux-gnu.a(echo_speex.o): In function `speex_aec_create':
> echo_speex.c:(.text+0x1c7): undefined reference to `speex_echo_state_init'
> echo_speex.c:(.text+0x1ec): undefined reference to `speex_echo_ctl'
> echo_speex.c:(.text+0x1fb): undefined reference to `speex_preprocess_state_init'
> echo_speex.c:(.text+0x21a): undefined reference to `speex_preprocess_ctl'
> echo_speex.c:(.text+0x256): undefined reference to `speex_echo_state_destroy'
> /usr/local/lib/libpjmedia-i686-pc-linux-gnu.a(echo_speex.o): In function `speex_aec_reset':
> echo_speex.c:(.text+0xc0): undefined reference to `speex_echo_state_reset'
> /usr/local/lib/libpjmedia-audiodev-i686-pc-linux-gnu.a(errno.o): In function `pjmedia_audiodev_strerror':
> errno.c:(.text+0xbb): undefined reference to `Pa_GetErrorText'
> /usr/local/lib/libpjmedia-audiodev-i686-pc-linux-gnu.a(pa_dev.o): In function `strm_destroy':
> pa_dev.c:(.text+0x7d): undefined reference to `Pa_CloseStream'
> pa_dev.c:(.text+0x93): undefined reference to `Pa_CloseStream'
> /usr/local/lib/libpjmedia-audiodev-i686-pc-linux-gnu.a(pa_dev.o): In function `strm_stop':
> pa_dev.c:(.text+0x19e): undefined reference to `Pa_StopStream'
> pa_dev.c:(.text+0x1b4): undefined reference to `Pa_StopStream'
> /usr/local/lib/libpjmedia-audiodev-i686-pc-linux-gnu.a(pa_dev.o): In function `strm_start':
> pa_dev.c:(.text+0x284): undefined reference to `Pa_StartStream'
> pa_dev.c:(.text+0x2c0): undefined reference to `Pa_StartStream'
> pa_dev.c:(.text+0x2d1): undefined reference to `Pa_StopStream'
> /usr/local/lib/libpjmedia-audiodev-i686-pc-linux-gnu.a(pa_dev.o): In function `strm_get_cap':
> pa_dev.c:(.text+0x363): undefined reference to `Pa_GetStreamInfo'
> pa_dev.c:(.text+0x3a3): undefined reference to `Pa_GetStreamInfo'
> /usr/local/lib/libpjmedia-audiodev-i686-pc-linux-gnu.a(pa_dev.o): In function `pa_get_default_input_dev':
> pa_dev.c:(.text+0x3fc): undefined reference to `Pa_GetHostApiCount'
> pa_dev.c:(.text+0x414): undefined reference to `Pa_GetHostApiInfo'
> pa_dev.c:(.text+0x429): undefined reference to `Pa_GetDeviceInfo'
> pa_dev.c:(.text+0x43b): undefined reference to `Pa_GetDeviceCount'
> pa_dev.c:(.text+0x45b): undefined reference to `Pa_GetDeviceInfo'
> /usr/local/lib/libpjmedia-audiodev-i686-pc-linux-gnu.a(pa_dev.o): In function `pa_get_default_output_dev':
> pa_dev.c:(.text+0x49c): undefined reference to `Pa_GetHostApiCount'
> pa_dev.c:(.text+0x4b4): undefined reference to `Pa_GetHostApiInfo'
> pa_dev.c:(.text+0x4c9): undefined reference to `Pa_GetDeviceInfo'
> pa_dev.c:(.text+0x4db): undefined reference to `Pa_GetDeviceCount'
> pa_dev.c:(.text+0x4fb): undefined reference to `Pa_GetDeviceInfo'
> /usr/local/lib/libpjmedia-audiodev-i686-pc-linux-gnu.a(pa_dev.o): In function `pa_get_dev_count':
> pa_dev.c:(.text+0x537): undefined reference to `Pa_GetDeviceCount'
> /usr/local/lib/libpjmedia-audiodev-i686-pc-linux-gnu.a(pa_dev.o): In function `pa_destroy':
> pa_dev.c:(.text+0x7fa): undefined reference to `Pa_Terminate'
> /usr/local/lib/libpjmedia-audiodev-i686-pc-linux-gnu.a(pa_dev.o): In function `pa_init':
> pa_dev.c:(.text+0x858): undefined reference to `Pa_Initialize'
> pa_dev.c:(.text+0x8b3): undefined reference to `Pa_GetHostApiCount'
> /usr/local/lib/libpjmedia-audiodev-i686-pc-linux-gnu.a(pa_dev.o): In function `pa_get_dev_info':
> pa_dev.c:(.text+0xd09): undefined reference to `Pa_GetDeviceInfo'
> /usr/local/lib/libpjmedia-audiodev-i686-pc-linux-gnu.a(pa_dev.o): In function `strm_get_param':
> pa_dev.c:(.text+0xf14): undefined reference to `Pa_GetStreamInfo'
> pa_dev.c:(.text+0xf2f): undefined reference to `Pa_GetStreamInfo'
> /usr/local/lib/libpjmedia-audiodev-i686-pc-linux-gnu.a(pa_dev.o): In function `pa_create_stream':
> pa_dev.c:(.text+0x10d8): undefined reference to `Pa_GetDeviceInfo'
> pa_dev.c:(.text+0x1105): undefined reference to `Pa_GetDeviceInfo'
> pa_dev.c:(.text+0x12da): undefined reference to `Pa_GetHostApiInfo'
> pa_dev.c:(.text+0x1340): undefined reference to `Pa_GetHostApiInfo'
> pa_dev.c:(.text+0x1382): undefined reference to `Pa_GetStreamInfo'
> pa_dev.c:(.text+0x139c): undefined reference to `Pa_GetStreamInfo'
> pa_dev.c:(.text+0x1400): undefined reference to `Pa_GetDeviceInfo'
> pa_dev.c:(.text+0x15a6): undefined reference to `Pa_GetHostApiInfo'
> pa_dev.c:(.text+0x15f5): undefined reference to `Pa_OpenStream'
> pa_dev.c:(.text+0x160a): undefined reference to `Pa_GetStreamInfo'
> pa_dev.c:(.text+0x16d6): undefined reference to `Pa_GetDeviceInfo'
> pa_dev.c:(.text+0x1882): undefined reference to `Pa_GetHostApiInfo'
> pa_dev.c:(.text+0x18d1): undefined reference to `Pa_OpenStream'
> pa_dev.c:(.text+0x18e6): undefined reference to `Pa_GetStreamInfo'
> pa_dev.c:(.text+0x1a80): undefined reference to `Pa_OpenStream'
> pa_dev.c:(.text+0x1ad0): undefined reference to `Pa_OpenStream'
> pa_dev.c:(.text+0x1aeb): undefined reference to `Pa_CloseStream'
> pa_dev.c:(.text+0x1c68): undefined reference to `Pa_OpenStream'
> /home/sun/Downloads/pjsip/trunk/pjlib/lib//libpj-i686-pc-linux-gnu.a(os_core_unix.o): In
function `pj_sem_destroy':
> os_core_unix.c:(.text+0x429): undefined reference to `sem_destroy'
> /home/sun/Downloads/pjsip/trunk/pjlib/lib//libpj-i686-pc-linux-gnu.a(os_core_unix.o): In
function `pj_sem_post':
> os_core_unix.c:(.text+0x494): undefined reference to `sem_post'
> /home/sun/Downloads/pjsip/trunk/pjlib/lib//libpj-i686-pc-linux-gnu.a(os_core_unix.o): In
function `pj_sem_trywait':
> os_core_unix.c:(.text+0x4d3): undefined reference to `sem_trywait'
> /home/sun/Downloads/pjsip/trunk/pjlib/lib//libpj-i686-pc-linux-gnu.a(os_core_unix.o): In
function `pj_sem_wait':
> os_core_unix.c:(.text+0x549): undefined reference to `sem_wait'
> /home/sun/Downloads/pjsip/trunk/pjlib/lib//libpj-i686-pc-linux-gnu.a(os_core_unix.o): In
function `pj_sem_create':
> os_core_unix.c:(.text+0x61b): undefined reference to `sem_init'
> /home/sun/Downloads/pjsip/trunk/pjlib/lib//libpj-i686-pc-linux-gnu.a(os_core_unix.o): In
function `pj_rwmutex_destroy':
> os_core_unix.c:(.text+0x71d): undefined reference to `pthread_rwlock_destroy'
> /home/sun/Downloads/pjsip/trunk/pjlib/lib//libpj-i686-pc-linux-gnu.a(os_core_unix.o): In
function `pj_rwmutex_unlock_write':
> os_core_unix.c:(.text+0x74d): undefined reference to `pthread_rwlock_unlock'
> /home/sun/Downloads/pjsip/trunk/pjlib/lib//libpj-i686-pc-linux-gnu.a(os_core_unix.o): In
function `pj_rwmutex_lock_write':
> os_core_unix.c:(.text+0x78d): undefined reference to `pthread_rwlock_wrlock'
> /home/sun/Downloads/pjsip/trunk/pjlib/lib//libpj-i686-pc-linux-gnu.a(os_core_unix.o): In
function `pj_rwmutex_lock_read':
> os_core_unix.c:(.text+0x7bd): undefined reference to `pthread_rwlock_rdlock'
> /home/sun/Downloads/pjsip/trunk/pjlib/lib//libpj-i686-pc-linux-gnu.a(os_core_unix.o): In
function `pj_rwmutex_create':
> os_core_unix.c:(.text+0x80c): undefined reference to `pthread_rwlock_init'
> /home/sun/Downloads/pjsip/trunk/pjlib/lib//libpj-i686-pc-linux-gnu.a(os_core_unix.o): In
function `init_mutex':
> os_core_unix.c:(.text+0x98d): undefined reference to `pthread_mutexattr_init'
> os_core_unix.c:(.text+0x9c1): undefined reference to `pthread_mutexattr_settype'
> os_core_unix.c:(.text+0x9dd): undefined reference to `pthread_mutexattr_destroy'
> os_core_unix.c:(.text+0xa04): undefined reference to `pthread_mutexattr_settype'
> /home/sun/Downloads/pjsip/trunk/pjlib/lib//libpj-i686-pc-linux-gnu.a(os_core_unix.o): In
function `pj_mutex_trylock':
> os_core_unix.c:(.text+0xc1c): undefined reference to `pthread_mutex_trylock'
> /home/sun/Downloads/pjsip/trunk/pjlib/lib//libpj-i686-pc-linux-gnu.a(os_core_unix.o): In
function `pj_thread_local_set':
> os_core_unix.c:(.text+0xff4): undefined reference to `pthread_setspecific'
> /home/sun/Downloads/pjsip/trunk/pjlib/lib//libpj-i686-pc-linux-gnu.a(os_core_unix.o): In
function `pj_thread_local_alloc':
> os_core_unix.c:(.text+0x10bd): undefined reference to `pthread_key_create'
> /home/sun/Downloads/pjsip/trunk/pjlib/lib//libpj-i686-pc-linux-gnu.a(os_core_unix.o): In
function `pj_thread_join':
> os_core_unix.c:(.text+0x11fc): undefined reference to `pthread_join'
> /home/sun/Downloads/pjsip/trunk/pjlib/lib//libpj-i686-pc-linux-gnu.a(os_core_unix.o): In
function `pj_thread_create':
> os_core_unix.c:(.text+0x12ef): undefined reference to `pthread_create'
> /home/sun/Downloads/pjsip/trunk/pjlib/lib//libpj-i686-pc-linux-gnu.a(os_core_unix.o): In
function `pj_thread_local_get':
> os_core_unix.c:(.text+0xb98): undefined reference to `pthread_getspecific'
> /home/sun/Downloads/pjsip/trunk/pjlib/lib//libpj-i686-pc-linux-gnu.a(os_core_unix.o): In
function `pj_thread_local_free':
> os_core_unix.c:(.text+0x1098): undefined reference to `pthread_key_delete'
>
/home/sun/Downloads/pjsip/trunk/pjlib/lib//libpj-i686-pc-linux-gnu.a(os_timestamp_common.o):
In function `pj_elapsed_time':
> os_timestamp_common.c:(.text+0x123): undefined reference to `fmod'
> collect2: ld returned 1 exit status
> 
> 
> 
> 
> Many Thanks
> Best regards
> Shamun
> 
> _______________________________________________
> Visit our blog: http://blog.pjsip.org
> 
> pjsip mailing list
> pjsip <at> lists.pjsip.org
> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org


Gmane