how to link library for linux

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

 



Hi,
Thanks Peter,

these are the various ways i had try.
please tell me where i am going wrong...

[pranoti at pranoti p]$ gcc -Wall -I/usr/local/include -L/usr/local/lib exec.c
-llibpj
/usr/bin/ld: cannot find -llibpj
collect2: ld returned 1 exit status


[pranoti at pranoti p]$ gcc -Wall -I/home/pranoti/pjproject/pjlib/include
-L/home/pranoti/pjproject/pjlib/lib exec.c -llibpj
/usr/bin/ld: cannot find -llibpj
collect2: ld returned 1 exit status


[pranoti at pranoti p]$ gcc -Wall -I/usr/local/include exec.c
/usr/local/lib/libpj.a
/usr/local/lib/libpj.a(os_core_unix.o): In function `pj_sem_destroy':
os_core_unix.c:(.text+0x429): undefined reference to `sem_destroy'
/usr/local/lib/libpj.a(os_core_unix.o): In function `pj_sem_post':
os_core_unix.c:(.text+0x494): undefined reference to `sem_post'
/usr/local/lib/libpj.a(os_core_unix.o): In function `pj_sem_trywait':
os_core_unix.c:(.text+0x4d3): undefined reference to `sem_trywait'
[and so on....]



[pranoti at pranoti p]$ gcc -Wall -I/usr/local/include -L/usr/local/lib exec.c
-llibpj.a
/usr/bin/ld: cannot find -llibpj.a
collect2: ld returned 1 exit status
[pranoti at pranoti p]$ gcc -Wall exec.c /usr/local/lib/libpj.a -o exec
/usr/local/lib/libpj.a(os_core_unix.o): In function `pj_sem_destroy':
os_core_unix.c:(.text+0x429): undefined reference to `sem_destroy'
[and so on..]

I had another confusion, that which path should give to gcc, where i stored
library eg. /home/.../....
or user path i.e usr/local/include.

I did not have much knowledge of linux
Please help.
Thanks
Pranoti
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20100324/88f17128/attachment.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