Compile errors when including liblivemedia headers

Bug #684878 reported by JSund
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
liblivemedia (Ubuntu)
Undecided
Unassigned

Bug Description

A simple application that only includes liveMedia/liveMedia.hh and does nothing will induce a compile error.

Output when compiling the attached program:

> g++ test.cpp -o test
In file included from /usr/include/liveMedia/MediaSink.hh:25,
                 from /usr/include/liveMedia/RTPSink.hh:25,
                 from /usr/include/liveMedia/MultiFramedRTPSink.hh:26,
                 from /usr/include/liveMedia/AudioRTPSink.hh:25,
                 from /usr/include/liveMedia/MPEG1or2AudioRTPSink.hh:25,
                 from /usr/include/liveMedia/liveMedia.hh:27,
                 from test.cpp:1:
/usr/include/liveMedia/FramedSource.hh:25: fatal error: NetCommon.h: No such file or directory
compilation terminated.

Revision history for this message
JSund (jonas-sundberg) wrote :
Changed in liblivemedia (Ubuntu):
status: New → Confirmed
Revision history for this message
Alex Stevens (alex-stevens) wrote :

It seems that header redirection is amiss in these packages. For example:
FramedSource.hh includes "Netcommon.h", but Netcommon.h lives in the folder groupsock, which is in the directory above liveMedia.

I've found that a quick and dirty fix is to edit the section in /usr/include/liveMedia/FramedSource.hh from
#includes "Netcommon.h"
to
#includes <groupsock/Netcommon.h>
This method also works with editing the next million header redirection errors that surface.

Although, after editing the header files and then linking to the live555 libraries (-lliveMedia -lgroupsock -lUsageEnvironment -lBasicUsageEnvironment), the compiler spams out undefined reference errors, like:
undefined reference to `BasicUsageEnvironment::createNew(TaskScheduler&)'
undefined reference to `chooseRandomIPv4SSMAddress(UsageEnvironment&)'
undefined reference to `Port::Port(unsigned short)'
... And so forth and so forth.

Yet, libliveMedia.a, libgroupsock.a, etc. all live within /usr/lib

This has me completely baffled.

Revision history for this message
Alex Stevens (alex-stevens) wrote :

Note the error in my comment above, they should be:
#include "Netcommon.h"
to
#include <groupsock/Netcommon.h>

Instead of:
#includes "Netcommon.h"
to
#includes <groupsock/Netcommon.h>

Revision history for this message
Gregory Fong (gvfong) wrote :

Not a bug in Ubuntu 14.04 at least (I can't speak for earlier versions). The package works fine, but usage is not obvious. The include paths and library order should be retrieved using pkgconfig. On an x86_64 system, the pkgconfig file itself will be in /usr/lib/x86_64-linux-gnu/pkgconfig/live555.pc .

Library path can be retrieved:

    $ pkg-config --libs live555
    -lliveMedia -lgroupsock -lBasicUsageEnvironment -lUsageEnvironment

Include flags can be retrieved:

    $ pkg-config --cflags-only-I live555
    -I/usr/include/liveMedia -I/usr/include/groupsock -I/usr/include/BasicUsageEnvironment -I/usr/include/UsageEnvironment

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers