How to compile as a static library?

Asked by Ahmed Shokry on 2016-03-29

Is there a handy way to compile the source code as a static library that can be built with a standalone executable?

Question information

Language:
English Edit question
Status:
Answered
For:
rohc Edit question
Assignee:
No assignee Edit question
Last query:
2016-04-01
Last reply:
2016-05-07

Hello,

Yes, use option --enable-static to the ./configure or ./autogen.sh scripts.

Regards,
Didier

Ahmed Shokry (a-shokry) said : #2

Thanks for the timely response and for the info.

After doing so, I found the following files under the "lib" directory in the installation path:
lib/librohc.a
lib/librohc_common.a
lib/librohc_comp.a
lib/librohc_decomp.a

I'm assuming that these are all the static libraries needed, and that I need to link my executable with the four of them. Is this correct?

Ahmed Shokry (a-shokry) said : #3

Another thing, what's the minimal set of header files I need to include in my application when using the static libraries for both compression and decompression?

Launchpad Janitor (janitor) said : #4

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

Hello,

> After doing so, I found the following files under the "lib" directory in the
> installation path:
> lib/librohc.a
> lib/librohc_common.a
> lib/librohc_comp.a
> lib/librohc_decomp.a
>
> I'm assuming that these are all the static libraries needed, and that I need
> to link my executable with the four of them. Is this correct?

If you are using a version 1.7.x, you need to use the 4 static libraries. If you
are using a Git version (future 2.0.0 version), you need only the lib/librohc.a
static library.

> Another thing, what's the minimal set of header files I need to include in
> my application when using the static libraries for both compression and
> decompression?

#include <rohc/rohc.h>
#include <rohc/rohc_comp.h>
#include <rohc/rohc_decomp.h>

Look at the tutorial on the website: https://rohc-lib.org/presentation/getting-started/#preparation
Look also at the examples in the examples/ subdir of the sources.

Regards,
Didier

Can you help with this problem?

Provide an answer of your own, or ask Ahmed Shokry for more information if necessary.

To post a message you must log in.