How to compile as a static library?

Asked by Ahmed Shokry

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:
Last reply:
Revision history for this message
Didier Barvaux (didier-barvaux) said :
#1

Hello,

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

Regards,
Didier

Revision history for this message
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?

Revision history for this message
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?

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

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

Revision history for this message
Didier Barvaux (didier-barvaux) said :
#5

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.