Control: tags -1 + moreinfo

On Sat, 30 Jan 2016 23:18:28 +0100 Giuseppe Bilotta 
<giuseppe.bilo...@gmail.com> wrote:
> Package: libgit2-dev
> Version: 0.23.1-1+b1
> Severity: important
> 
> libgit2 depends on libhttp-parser, and libgit2-dev depends on
> libhttp-parser-dev. However, the pkg-config information for libgit2 does
> not include -lhttp_parser among the needed libraries, hence trying to
> compile a program that depends on libgit2 using $(pkg-config --libs
> libgit2) to get the compile flags will fail due to undefined references
> to http_parser_init and http_parser_execute methods.
> 
> This should be trivial to fix, by moving -lhttp_parser from the
> Libs.private to the Libs field in the .pc file.

Are you trying to link statically or dynamically?

If you're trying to link dynamically, the libgit2 dynamic library
already depends on libhttp_parser at runtime.  libgit2 doesn't directly
expose any symbols or types from libhttp_parser, so callers of libgit2
don't need to care that it uses libhttp_parser internally.  So, you
shouldn't pass -lhttp_parser unless you directly call symbols from
libhttp_parser yourself.  Doing so would introduce an unnecessary
dependency in your program or library, which (among other problems)
complicates transitions.

If you're trying to link statically, you need to use $(pkg-config
--static --libs libgit2) , which produces the following here:

-lgit2 -lcurl -lhttp_parser -lssh2 -lrt -lz

Reply via email to