Re: libvorbisfile dynamic linkage with pkg-config - inter-library dependencies?
Ralph Giles <[email protected]> Mon, 11 Aug 2014 13:03:32 -0700
| Newsgroups | gmane.comp.multimedia.ogg.vorbis.general |
|---|---|
| Message-ID | <[email protected]> |
On 2014-08-09 3:04 PM, Richard Ash wrote: > vorbis_block_init() is called from ExportOGG.cpp, although that file > doesn't #include vorbis/codec.h - the only include from libvorbis is > #include <vorbis/vorbisenc.h>, which presumably brings the necessary > headers in indirectly? Yes, vorbisenc.h includes codec.h. > The only solution I have found is to explicitly ask pkg-config for the > dependent libraries (libvorbis and libogg) when calling pkg-config, so > do > pkg-config --libs --print-errors "vorbisfile vorbis ogg" > in order to get > -lvorbisfile -lvorbis -logg So vorbisfile.pc has vorbis as a Requires.private. I think the way this is supposed to work is that if you're linking to the shared libraries, transitive deps in the .so files will pull in vorbis when you '-l vorbisfile'. When you link statically (so pkg-config --libs --static vorbisfile) then you get -lvorbis -logg -lm, etc. The question is why this isn't working for you. Are you linking statically? Is the build system passing --static to pkg-config? There are systems where the linker doesn't see dependencies inside .so files, but x86_64-pc-linux-gnu isn't one of them. For theora, we use a 'Requires' instead of a 'Requires.private' so it works unconditionally. If my understand above is correct, that's not optimal, but might work around your problem. Try that as well? -r