Reputation: 187
I'm currently working on a static library in C++. My library uses externel libraries (precompiled). The question is; where should I put these external libraries? I just want to adapt to a common scheme for the directory structure.
Currently, my directory structure looks like this:
build // Object files
include // Header files
lib // Compiled library
src // Source directory
test // Test sources
tools // Helpful scripts etc.
Upvotes: 2
Views: 2975
Reputation: 238291
Generally, external libraries are stored externally. i.e. outside of the project.
Different systems have different conventions. On POSIX systems for example, the library archives are typically stored in /usr/lib and headers in /usr/include. Such external libraries are typically installed using a package manager provided by the system. The downside of using system provided libraries (besides their location and management being system specific) is that sometimes you don't have much control over the version that you get. The upside is the benefit of sharing the libraries through dynamic linking.
There are cross-platform package managers for libraries as well, which work well with static linking, and allow for using specific version of a library. Such package managers also have their own convention of where they download the libraries.
Upvotes: 5
Reputation: 795
Using a directory called external
or third_party
is quite common in many projects.
Upvotes: 2