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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T03:34:03+00:00 2026-05-19T03:34:03+00:00

e.exe is linked against my custom static library, c.lib , which uses Win32 API

  • 0

e.exe is linked against my custom static library, c.lib, which uses Win32 API defined in w.dll. w.dll is located in C:\Windows\System32 and its import library is w.lib, located in Windows SDK directory. Shell w.lib be listed as Additional Dependency in c.lib or e.exe project? (e.exe builds successfully in both cases.) What is the best practice and why? I guess e.exe should not know about w.lib.

c.lib is intended to be shared among a group of developers only (not to be shipped to customers).

TEST: I used VS2008 and dumpbin utility to test both cases and here are results:

  • Case 1: w.lib added as Additional Dependency in c.lib project.

dumpbin /archivemembers c.lib output lists both offsets in w.dll and .obj files from c.lib project as Archive members.

  • Case 2: w.lib not added as Additional Dependency in c.lib but in e.exe project:

This time, dumpbin output contains only .obj files of c.lib and the size of c.lib is smaller than in Case 1

(c.lib was added as Additional Dependency in w.exe project in both cases.)

NOTE: I used w.lib and w.dll here as fictional, generic names for Windows libraries but they could be e.g. Userenv.lib and Userenv.dll or Version.lib and Version.dll…

  • 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-19T03:34:04+00:00Added an answer on May 19, 2026 at 3:34 am

    I think you’re misunderstanding what creating an archive and an import archive does.

    Creating an archive, as you’ve rightly surmised in comments, creates a unified file containing compiled .objs. Now, this can contain any code you like, including but not limited to dynamic calls to libraries. An import library is a library that contains an obj that exclusively makes such calls, the idea being that by importing it, your exe can find the appropriate symbols (they must be in the executable you create).

    The process of creating c.lib from w.lib simply extracts w.lib‘s objects and appends them to the collection of objects in c.lib. In effect, c.lib becomes an import library + code.

    Do I think you should do this? Not really – it might lead to confusion as to what e.exe depends on; I think you should explicitly make this visible rather than trying to hide it. That said, that’s a recommendation only, not a rule.

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

Sidebar

Related Questions

I am writing an executable which uses dlopen() (LoadLibrary() on Windows) to dynamically load
I have a .exe and many plug-in .dll modules that the .exe loads. (I
I have a solution consisting of 3 projects. One is a static library, and
What options set, to statically linked the library curl ? Library should be integrated
Simple exe for a tray icon, that works fine independently I call it using
Is Microsoft sort.exe 5.1.2600.0 (xpclient.010817-1148) able to sort UTF-16 (LE) files?
Shell (explorer.exe www.google.com) is how I'm currently opening my products ad page after successful
I'd like my .exe to have access to a resource string with my svn
I'm using xsd.exe to make the C# classes for our settings. I have a
In cmd.exe, I can execute the command copy c:\hello.txt c:\hello2.txt and it worked fine.

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.