Reputation: 1
I am building a library to act as an AWS wrapper (lets call it awswrp.lib). When I want to use it in an external project, I include the header and reference the lib file. However, it ask me to include all the headers and libs that are already included all the AWS libs that are already included in awswrp.lib.
As far as I understood linking, once you link the top most library you didn't need to link the rest of the libraries. But now I am doubting this.
Am I missing something?
Appreciate any help
Upvotes: 0
Views: 765
Reputation: 1091
It sounds like you are confusing the older system of headers/libraries, and the newer system of modules. Modules contain all the information for linking and would solve your problem. Visual Studio does support modules, so it's something you might consider using. See here for how. However, module support in visual studio is not perfect.
To solve your issue in a more traditional manner, you must understand that each project has it's own settings. In visual studio you can share settings between projects, but is is not done by default. You can place the settings for using your libarary inside a file called a property (or prop) file. This sets the locations of the header directories and the required libraries for building, and even things like compiler flags. It is traditional to then make a single header file that includes all the others, which makes it easier to maintain. In every project that uses your library, include the "props" file. The GUI for managing the properties is called the "property manager" and is hard to find, but it is the easiest way to do this.
Be aware, that you still need to solve your issues one at a time. To fix missing header files add new directories to the prop file, and include your single-include-file to every module that requires it.
If it then fails to link, add any library requirements. If it fails to find the libraries (different error), then use the separate directory setting for libraries to add those locations.
When making a prop-file, it is important to decide whether you need relative or absolute directory names. If you share the code with other people, you must design a directory layout that is relative to some known directory.
Upvotes: 1