Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8126361
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T07:07:15+00:00 2026-06-06T07:07:15+00:00

In order to be able to reuse segments of code through multiple application, I

  • 0

In order to be able to reuse segments of code through multiple application, I have decided to create Static Libraries of the functions/classes I often require. Consequently, I can change the code of a static library and all the applications referencing that library have updated functions.

The Architecture conceptually looks like the following graph :

AppA -> LibA
     \
      -> LibCommon -> LibX
     /             -> LibY
AppB

Each applications (AppA, AppB) reside in different solutions to keep stuff clearly separated.

In order to get that fully working in Visual Studio 2010, I have to add the project of each Lib used by the application in it’s solution, add the folder containing it’s header files in the Additional Include Directories and add a reference to the project directly used.

Ex. For AppA, I would;

  1. include the projects of LibA, LibCommon, LibX and LibY;
  2. Add the path of LibA and LibCommon in the Additional Include Directories property
  3. Add a reference to LibA and LibCommon in the main application, then add references to LibX and LibY in the LibCommon’s project.

My first question is : Is there a way to only import the library the application directly requires? (LibA and LibCommon)

My second question : Is there a better way to easily manage reusable code in Visual Studio 2010? (Junior Programmer Here!)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T07:07:17+00:00Added an answer on June 6, 2026 at 7:07 am

    You don’t really need to include the projects of those libs. You only need the .h files for the compiler, and the .lib files for the linker. What I would do is first organize the libs projects at some fixed directory structure. Then, I’d add something along these lines to LibCommon.h:

    #include "LibXDir/LibX.h"
    #include "LibYDir/LibY.h"
    #ifdef _DEBUG
    #pragma comment (lib, "LibCommon.lib")
    #pragma comment (lib, "LibXDir/Debug/LibX.lib")
    #pragma comment (lib, "LibXDir/Debug/LibY.lib")
    #else
    #pragma comment (lib, "LibCommon.lib")
    #pragma comment (lib, "LibXDir/Release/LibX.lib")
    #pragma comment (lib, "LibXDir/Release/LibY.lib")
    #endif
    

    With this, you’d only have to include LibCommon.h in your apps, and it will take care of bringing in the rest of the libs. You might have to set up the additional include and library directories, depending on your setup. Alternatively, you can have all the .lib files created or copied to some central lib directory, which could then be the only lib directory you have to add.

    I’m assuming you’re not going to modify the libs while working on the apps. If you are, you’ll have to recreated the libs after they are changed, and that could be done by indeed adding their projects to the solution. But you can still have most of the dependencies set up on a single file, rather than on the project settings.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have set up Heroku & Railgun in order to be able to take
I designed a series of related classes, and in order to be able to
I have written a little jQuery in order to be able to upload a
I have recently installed mono on my Linux box, in order to be able
In order to be able to use this awesome plugin: Jquery iphone contacts i
I am trying to understand how stringstream works in order to be able to
We are creating typical web applications secured by https. In order to be able
Possible Duplicate: How to invalidate the file system cache? In order to be able
I am using Able Commerce and need to customize the Customer Order Notification email
So I've resigned myself to not being able to use the order of a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.