tags:

views:

44

answers:

1

I follow this PJLIB ( https://trac.pjsip.org/repos/wiki/Getting-Started/Autoconf ). But i cant get this up yet, always its giving undefined reference, can anyone please have a look kindly.

Stackoverlow source code gets broken please find from here details: http://gist.github.com/5765529


[sun@example mysip]$ gcc myapp.c
/tmp/ccEKxwjG.o: In function `main':
myapp.c:(.text+0xa): undefined reference to `pjsua_create'
collect2: ld returned 1 exit status

Thank you

+1  A: 

You are not linking with the library. You need something like:

 gcc myapp.c -lpjlib

but exactly what you need I don't know - it will be described in the library's documentation.

anon
Tried those now so far, please kindly have a look, still no luck.. ex: http://gist.github.com/502544
Stackfan
@Stackfan Most people her (and me in particular) will not look at pages you provide links to.
anon
Sure, i will avoid that. when i remove the line and compile it, it works actually, for example: [root@example lib]# gcc -Wall /home/sun/Downloads/mysip/myapp.c ./libpj-i686-pc-linux-gnu.a/home/sun/Downloads/mysip/myapp.c: In function ‘main’:/home/sun/Downloads/mysip/myapp.c:27: warning: unused variable ‘status’
Stackfan
I have many lib in the path "ls /usr/local/lib/libpj*/usr/local/lib/libpj-i686-pc-linux-gnu.a /usr/local/lib/libpjmedia-i686-pc-linux-gnu.a /usr/local/lib/libpjsip-ua-i686-pc-linux-gnu.a/usr/local/lib/libpjlib-util-i686-pc-linux-gnu.a /usr/local/lib/libpjnath-i686-pc-linux-gnu.a /usr/local/lib/libpjsua-i686-pc-linux-gnu.a/usr/local/lib/libpjmedia-audiodev-i686-pc-linux-gnu.a /usr/local/lib/libpjsip-i686-pc-linux-gnu.a/usr/local/lib/libpjmedia-codec-i686-pc-linux-gnu.a /usr/local/lib/libpjsip-simple-i686-pc-linux-gnu.a"How can mention them all inside -lpjlib? What did you mean there?
Stackfan