[build2] Need more help(tutorial) about how can I link to libraries that released on cppget.

Boris Kolpackov boris at codesynthesis.com
Wed Dec 15 14:17:43 UTC 2021


good 770326 via users <users at build2.org> writes:

> I've just been trying to use build2 for a few weeks. Recently I try to
> use bdep to create a new project and add SQLite3 dependencies according
> to the chapter toolchain intro 2.3. Although it automatically downloads
> and compiles libsqlite3 from cppget, it always indicates that the header
> file "libsqlite3/sqlite3.h" cannot be found.
>
> I know I must have not configured enough, but I have no idea on how to
> do next.
>
> [...]
>
> 3. [...] and write #include <libsqlite3/sqlite3.h> in the code.

I think you've done everything right except this step: SQLite's header
is included as <sqlite3.h>.


> So more guidances are needed.

The problem here is that in C/C++ there is no standardized way of
how the headers are included. In our own libraries we follow the
<lib-name/header-name> form but that's nowhere universal and we
cannot realistically change that when packaging for build2 (since
that will break a lot of other software).

Another option would be to provide this information in the library's
README file (which we show on cppget.org). But here again we normally
reuse README's provided by upstream so it's up to the individual
library authors, which means it will be all over the place. One way
to rectify this would be to provide a separate manifest value with
usage instructions (e.g., add this to manifest, add this to buildfile,
include this header, etc) which we can then show on cppget.org. This
will place additional burden on package authors but it will likely
help.

BTW, when it comes to library's headers, one place to look is in the
accompanying tests. For example, inside the libsqlite3 package there
is tests/driver.c which includes <sqlite3.h>.



More information about the users mailing list