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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T11:20:43+00:00 2026-06-04T11:20:43+00:00

I have legacy MSVS solution with C++ projects. When I take it from Version

  • 0

I have legacy MSVS solution with C++ projects. When I take it from Version Control System and try to build it for the very first time (when it’s clean) – I get error: LNK 1104 library can’t be found.

When I try to build it for the second time – everything is built ok.

Project “A” (C++) depends on library (lib file) that is Project “B” (also C++).

“A” has code like that in one of it’s cpp files (may be stdafx.h is the better place for #pragma comments?):

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

that causes Linker error for the very first built

I investigated the first built results: “B” project is successfully compiled, “lib” file is produced, and “A” project (that depends on “B”) is the last project in solutions projects build order.

I wonder why “A” doesn’t see “B” library for the very first time as “B” should be built earlier than “A”. When I build the same solution for the second time – no linker errors.

  • 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-04T11:20:44+00:00Added an answer on June 4, 2026 at 11:20 am

    This has to do with the build order. If project A is built first, B.lib doesn’t yet exist. So you get the error. Then project B is built, and B.lib generated. When you build again, as the library exists, the error is gone.

    To solve this, you need to tell the solution that A depends on B. Right click on the solution, go to project dependencies, select A in “Projects” and check B in “Depends on”. Something like:

    enter image description here

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

Sidebar

Related Questions

I have a legacy VB6 ActiveX control used in IE to provide control of
I have legacy system where all date fields are maintained in YMD format. Example:
I installed silverlight 4 recently, but we still have legacy projects need to be
I have legacy ASP.NET web site, upgraded from ASP.NET 2.0 to ASP.NET 4.0 target
I have a legacy application to maintain. Currently, releases are built from one particular
I have legacy asp.net 1.1 website. It has a very poor VB layered achitecture.
I have A Legacy system that runs on a SQL Server 2005. Current table
I have a legacy user database from a Magnolia CMS that needs to be
I have a legacy system that I'd like to extend with an application written
I have legacy database and tables that I would like to try to import

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.