about rohc *.so or *.a library

Asked by sleepswallow

hello Didier:
    I am back and want to get some help,thanks ~~

   I want to make the rohc library to *.so or *.a library, now I meet some matters.

1、 about *.so library
    I build rohc library on my redhat6.2,and test the *.so (in /usr/lib directroy)library is ok .then I copy librohc_common.so,librohc_common.so.0,librohc_comp.so,librohc_comp.so.0,librohc_decomp.so,librohc_decomp.so.0 to another redhat6.2 (no build rohc library) , and copy the all *.so library to /root/downloads/socall (work directory) and /usr/lib, then I insert work directroy to ld.so.conf and run ldconfig. then I test the *.so librry :
      gcc test.c - o test -L/root/downloads/socall -lrohc_common -L/root/downloads/socall -lrohc_comp -L/root/downloads/socall -lrohc_decomp -I/root/downloads/socall/include
 error is:
        /usr/bin/ld: cannot find -lrohc_common
       collect2: ld returnd 1 exit status

 then ,I copy the *.so files to the /lib or the /usr/lib ,and insert the *.so paths to ld.so.conf so on, the error is same .

2、about the *.a library
  In redhat6.2 the three directroys(common,comp,decomp), I usr ar -rc all *.lo to *.a :
  ar -rc libcommon.a lib*.lo *.lo ....
  ar -rc libcomp.a lib*.lo *.lo ....
  ar -rc libdecomp.a lib*.lo ....
 then build libcommon.a libcomp.a libdecomp.a
 I test the *.a library:
  gcc test.c - o test -L/root/downloads/socall -lcommon -L/root/downloads/socall -lcomp -L/root/downloads/socall -ldecomp
 error:
   libcommon.a:could not read symbols:Archive has no idex;run ranlib to add one
   collect2: ld returnd 1 exit status

  thank Didier very much~~

Regards,
sleepswallow

Question information

Language:
English Edit question
Status:
Expired
For:
rohc Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Didier Barvaux (didier-barvaux) said :
#1

Hello,

> 1. about *.so library

Please try:
  $ ls -l /root/downloads/socall/librohc*.so*
  $ ls -l /root/downloads/socall/include/rohc*.h
  $ gcc -Wall -I/root/downloads/socall/include -L/root/downloads/socall \
        -lrohc_decomp -lrohc_comp -lrohc_common -o test test.c

> 2. about the *.a library

Don't create the static archives .a yourself. Use the --enable-static option of the configure script. It will generate the .a for you during the library build.

Regards,
Didier

Revision history for this message
Launchpad Janitor (janitor) said :
#2

This question was expired because it remained in the 'Needs information' state without activity for the last 15 days.