Reputation: 886
I have a Visual Studio solution with many projects (c++ if it makes a difference). Some of the projects generate a .lib file that is needed during the linking step of other projects. The person who created this solution had build steps that copied these .lib files into a single folder. He also added that folder to each project's Additional Library Directories property.
Is there a cleaner way to include these files across the solution?
Edit: Not sure if it matters, but the projects produce DLLs and the .lib files that are included by other projects are only intermediate files.
Upvotes: 1
Views: 95
Reputation: 538
Projects which are configured as static library generates .lib files. Generally, these are the core parts that may be used in future for another project/application. While using those projects for an application, you can add them to your current solution in Visual Studio. In that case, your application is the startup project and others are static or dynamic library projects.
In order to build and run your application, you have to add other required projects as references. Those projects will be built before your application and will generate .lib or .dll files next to your application exe. In other words in release folder. Once they are compiled, they wont be compiled again if there is no change in them.
This approach make sure that applications are self-contained and may be deployed/released directly.
In VS 2013, after adding related projects to solution you have to choose your application project as startUp project. Navigate to Properties/CommonProperties/References and add required projects (they have to be added to solution previously).
Links:
How to add reference: https://msdn.microsoft.com/en-us/library/wkze6zky.aspx
More info: https://msdn.microsoft.com/en-us/library/ez524kew.aspx
Upvotes: 1