← Back to team overview

rohc team mailing list archive

Re: Problem Regarding ROHC Implementation

 

Advar,

> I solved the problem. FINALLY!! :-) uh-hu
> I tried almost everything: re-install a entire Ubuntu 12.04 system,
> upgrade the gcc compiler, re-install the rohc library several times...
> 
> After reading a lot about linking libraries in Ubuntu, i found that
> the problem was in the command.
> 
> The correct input for Ubuntu (12.04 or 13.04) must be: gcc -Wall
> rohc_hello_world.c -o rohc_hello_world $(pkg-config rohc --cflags
> --libs)
> 
> The command "gcc -o rohc_hello_world -Wall $(pkg-config rohc --cflags
> --libs) rohc_hello_world.c" doesn't work in Ubuntu systems!

You did a great job for the analysis!

I did some searches. Ubuntu is right on the parameter order. Linker
flags shall come after the source files that require them. Linkers on
other Linux seem able to cope with it. Maybe different linker
versions...

So, the best syntax seems to be:
 $ gcc -o rohc_hello_world -Wall \
     $(pkg-config rohc --cflags) \
     rohc_hello_world.c \
     $(pkg-config rohc --libs)

Could you please test this command on your Ubuntu system?


> I suggest you put a note with this observation on the "getting
> started" section for future users.

I updated the tutorial in consequence:
http://rohc-lib.org/presentation/getting-started/

Regards,
Didier


-- 
Opensource ROHC library - http://rohc-lib.org/

Attachment: signature.asc
Description: PGP signature


References