C++ how to manage dependencies (use libraries from github for example)

C++ doesn’t have anything like pip or npm/bower. I don’t know if maven or gradle can be persuaded to handle C++ libraries.

In general, you are going to have to end up with

  • Header files in a directory somewhere
  • library files (either static libraries, or DLLs/shared objects). If the library is a header-only library like some of the boost libraries, then you won’t need this.

You get hold of the library files, either by building them on your machine (typical for open source projects, and projects aimed at Linux platforms), or by downloading the pre-compiled binaries (typical for Windows libraries, particularly paid-for).

Hopefully, the instructions for building the library will be included on the library website. As noted in the comments, ‘meta’ seems to be quite good at that.

When you try to compile with the library, you may need a command line option (eg -I) to specify the directory containing the header files, and you may need a linker option (eg -l) to tell the linker to link against your library.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)