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 5957161
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:21:40+00:00 2026-05-22T18:21:40+00:00

Is it possible to automatically link a c++ static library in Visual Studio 2008?

  • 0

Is it possible to automatically link a c++ static library in Visual Studio 2008? Or, is there an improvement to use from the standard approach?

I am developing a set of c++ libraries and linking/testing them is quite a pain. The usual approach is to specify the .lib files in the test clients, but now the list has grown quite large (my own libs, opencv, boost, and others) and I’m always missing something as I switch between debug and release modes, gpu and non-gpu, etc. When I open the linker in project properties the list scrolls on for some time.

I was hoping that I could automatically specify that if a client #includes something that the project should also link to a specified .lib (debug/release). Is this possible or is there an alternate approach that will help manage linkage with minimal user interaction?

  • 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-05-22T18:21:41+00:00Added an answer on May 22, 2026 at 6:21 pm

    Use #pragma comment(lib, "name_of_the_library.lib"). Other useful options for #pragma comment can be found at the MSDN page.

    With regard to Debug vs. Release configuration: usually a _DEBUG preprocessor macro is used to distinguish. Visual C++ header certainly use it for the same purpose as you want; e.g. this is from VC++ 2010 use_ansi.h file:

    #ifdef _DEBUG
    #pragma comment(lib,"msvcprtd")
    #else   /* _DEBUG */
    #pragma comment(lib,"msvcprt")
    #endif  /* _DEBUG */
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it somehow possible to automatically have a link to GitHub issue number in
Is it possible in Word 2007 to create a revision history table automatically using
Is it possible to convert an existing WPF Application to SilverLight automatically/with minimal effort?
Is it possible to import csv data into mysql and automatically create the column
Is it possible for a Symbian S60 application to automatically add itself to one
Is it possible to control the format of the password that is automatically generated
I'd like to automatically generate database scripts on a regular basis. Is this possible.
Possible Duplicate: Why not use tables for layout in HTML? Under what conditions should
I would like to generate my links automatically via a static class in each
Is it possible to automatically remove the swapfile when the file is saved, and

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.