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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T13:54:40+00:00 2026-06-10T13:54:40+00:00

I have to maintain some legacy (MS) C++. In that codebase, I stumbled across:

  • 0

I have to maintain some legacy (MS) C++. In that codebase, I stumbled across:

#pragma comment(lib, "OtherLib700.lib")

Where 700 is some versioning. Besides, the lib is a DLL with the same name.

I first thought that the program would be dependent upon the DLL, but after removing it from the system, the program still works. There exists a newer version of the DLL, though, which is named OtherLib900.

It seems as though the program ‘included’ the code of the lib so that it’s no longer dependent upon the external DLL. (Or that the program ‘automatically’ uses the newer DLL.)

Which one is correct? Is there are way to further confirm that ‘assumption’?

  • 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-10T13:54:42+00:00Added an answer on June 10, 2026 at 1:54 pm

    If a program has this pragma it will look for the library OtherLib700.lib. If that is an import library when the program is loaded windows will search for OtherLib700.dll in the path. It will not try to look for OtherLib900.dll during execution so it must be finding your dll in a different folder. This assumes that OtherLib700.lib is an import library and not a static library. If OtherLib700.lib is a static library then that is all it needs.

    The documentation for #pragma comment( lib libname) states the following:

    Places a library-search record in the object file. This comment type
    must be accompanied by a comment-string parameter that has the name
    (and possibly the path) of the library that you want the linker to
    search. The library name follows the default library-search records in
    the object file. The linker searches for this library the same way as
    if you specified it on the command line, as long as the library isn’t
    specified by using /nodefaultlib. You can place multiple
    library-search records in the same source file. Each record appears in
    the object file in the same order it’s found in the source file.

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

Sidebar

Related Questions

I have several Delphi programs that maintain connections to a database (some Oracle, some
I have to maintain some legacy codes,parts of it look like the following: /*
Ok, so I've got some legacy code from another company that I have to
I'm brand new to log4net, and I'm trying to maintain some legacy code that
I have an MFC legacy app that I help to maintain. I'm not quite
How would you maintain the legacy applications that: Has no unit tests have big
Say you have a function that needs to maintain some sort of state and
In a recent project, I have to maintain some PHP code. I set up
I have some mega menu style menus on a site I maintain. These are
I have a legacy code to maintain and while trying to understand the logic

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.