Problem compiling my code with RoHC 1.5.0 library in Eclipse

Asked by Carlos

Hello all,

I am finding problems when compiling my code which uses RoHC compressor and decompressor in Eclipse. I have installed the latest ROHC library (version 1.5.0) on a 64-bit Ubuntu 12.04 following the steps described in the instalation guide. It seems to me that the instalation was successful because I do find the libraries in my file system. However, when compiling the project in Eclipse it seems that the linker is unable to find the libraries. I have included the path and the libraries to the project properties, but still nothing. Could anybody provide me the good project configuration, if any?

Thanks in advance

Carlos

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
Harshavardhan (hbk1517) said :
#1

u hav to do somethin in linkerscript.. somethin lik -l pcap or soemthin

On Thu, Oct 25, 2012 at 5:11 PM, Carlos <
<email address hidden>> wrote:

> New question #212291 on rohc:
> https://answers.launchpad.net/rohc/+question/212291
>
> Hello all,
>
> I am finding problems when compiling my code which uses RoHC compressor
> and decompressor in Eclipse. I have installed the latest ROHC library
> (version 1.5.0) on a 64-bit Ubuntu 12.04 following the steps described in
> the instalation guide. It seems to me that the instalation was successful
> because I do find the libraries in my file system. However, when compiling
> the project in Eclipse it seems that the linker is unable to find the
> libraries. I have included the path and the libraries to the project
> properties, but still nothing. Could anybody provide me the good project
> configuration, if any?
>
> Thanks in advance
>
> Carlos
>
> --
> You received this question notification because you are a member of ROHC
> Team, which is an answer contact for rohc.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~rohc
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~rohc
> More help : https://help.launchpad.net/ListHelp
>

Revision history for this message
Carlos (carhercl) said :
#2

Could you please a bit more specific, please?

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

Hello,

Disclaimer: I didn't use Eclipse myself, so my answer will not be specific.

On the command line, you would need something such as "-lrohc_common -lrohc_comp -lrohc_decomp" for linking with the library. The names of the required libraries are: "rohc_common", "rohc_comp" and "rohc_decomp". Did you specify the 3 libraries?

To help you further, we need to know what you did and what you get:
 - Tell us what you exactly did when you say "I have included the path and the libraries to the project properties,
    but still nothing.",
 - Copy/paste the exact error message you get from the linker,
 - What compiler you use?
 - What version of Eclipse do you use?

Regards,
Didier

Revision history for this message
Carlos (carhercl) said :
#4

Hello Didier,

I am using the latest Eclipse Juno CDT. I have included the three libraries you mentioned in your last anwer. In the library includes in the project settings. I have also added the path /usr/lib, where the libraries are located.
I have realized that my project compiles when adding #include <rohc_comp.h> and #include <rohc_decomp.h>. But the problem arises when I use a function from the RoHC library. For instance, I wrote the following line:
rohc_activate_profile(comp,ROHC_profile);
And this is the error code I got from the compiler:
undefined reference to `rohc_activate_profile(rohc_comp*, int)' collect2: ld returned 1 exit status.
But in Eclipse, I can "jump" / open the declaration of the header function in /usr/include/rohc_comp.h

Revision history for this message
Mikhail Gruzdev (michail-gruzdev) said :
#5

Hi,

try to add rohc_comp, rohc_decomp, rohc_common at 'C/C++
Build'-->'Settings'->'GCC C Linker'->'Libraries' . Just like this:
http://whatwouldnickdo.com/wordpress/wp-content/uploads/2009/02/04-lec-libs.png
.

Revision history for this message
Carlos (carhercl) said :
#6

Hi Mikhail,

Thanks for your response, but that is exactly the way RoHC libraries (among others) are included in my project.

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

Carlos,

Please give us the command line used by Exclipse to link the program.

Regards,
Didier

Revision history for this message
Carlos (carhercl) said :
#8

Didier,

This is the linker command Eclipse uses and the parameters used:

g++ -o "PDCP" $(OBJS) $(USER_OBJS) $(LIBS)

USER_OBJS := $(pkg-config\ rohc\ --libs)
LIBS := -lpthread -lrt -lm -lrohc_common -lrohc_comp -lrohc_decomp

BR

Carlos

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

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