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

  • Home
  • SEARCH
  • 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 830841
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T04:06:35+00:00 2026-05-15T04:06:35+00:00

In Visual Studio (C++) the other day, I was trying to build some example

  • 0

In Visual Studio (C++) the other day, I was trying to build some example code and it would not work, even though I was pointing at the right include and lib directories (I got linker errors).

I asked a friend who fixed the problem by specifying the necessary .lib files in the General Properties->Linker->Input field of the project settings.

My questions:

Isn’t simply pointing to the directory with the .lib files enough? Do you need to specifically tell the linker which lib files to link?

By listing the .lib files in the additional dependencies field, am I specifying exactly which static libs get built into the exe? If the answer to this is yes, then will these be the ONLY lib files that get built into the exe? Why is it called additional dependencies? Is there another place to specify lib files to include? I used to think this was done by including the necessary header file.

  • 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-15T04:06:36+00:00Added an answer on May 15, 2026 at 4:06 am

    Including the header in your source code makes declarations from that header available to the compiler. If the compiler can’t find a declaration for a library function (constant, macro, whatever) you used, it can’t generate object code that refers to that function.

    Once compilation succeeds, you’ve got object code that has a bunch of symbols in it. In order for the object code to be useful, those symbols actually need to refer to something. That’s where the linker comes in — it resolves the symbols in the code you just compiled to their corresponding object code in the binary libraries you’re using.

    So, yes, you do need to tell the linker which .lib files to link — analogous to how you told the compiler (by way of your #include directives) which header files to refer to. If the linker can’t resolve a symbol, linking will fail (which I’m guessing is the linker error you got).

    I don’t actually use Visual Studio, but according to this MSDN article, VS links by default to LIBC.LIB and a whole bunch of other libraries. If you’re using some other static library that isn’t linked by default, that’s an additional dependency.

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

Sidebar

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.