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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T19:37:19+00:00 2026-06-07T19:37:19+00:00

I am developing Windows code in C using Visual Studio 2010. I am working

  • 0

I am developing Windows code in C using Visual Studio 2010.

I am working on several related projects: a static library, a DLL, and an executable. The DLL should have the static library linked in, and the executable depends on the DLL. (I am using “implicit” DLL linking; I do not need to control the DLL loading and unloading.)

Right now I have three separate VS2010 projects, but I know it is possible to set things up as “subprojects”: the static library should be a subproject of the DLL, and the DLL should be a subproject of the EXE.

I want to solve the following:

  • When I rebuild the EXE, it should rebuild the DLL if need be, and in turn the DLL build should rebuild the static library if need be. I’d like to just have the EXE open, hit the F7 key, and everything builds.

  • When I rebuild the EXE as Debug, it should link with the Debug .lib file from the DLL; likewise when I rebuild the EXE as Release, it should link with the Release .lib file from the DLL. If I set up the subprojects correctly, will this Just Work automatically?

EDIT: I have made progress. First, in the DLL project, I used File / Add and then chose Add Existing Project to add the static library. (This is only available on the File menu as far as I can tell! It definitely is not in the right-click menu.) Second, I clicked on the DLL project in the “Solution Explorer” sidebar on the left, then right-clicked and chose Project Dependencies... and set that the DLL project depends on the static library project, which should build first. Visual Studio seems to have then magically set up the link dependency for me, and when I hit the F7 key in the DLL project, it will build the static library project.

I tried repeating the above steps for the EXE project. Now it will build the DLL, but it isn’t linking things correctly yet; the linker is complaining that the functions exported from the DLL are not available.

  • 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-07T19:37:20+00:00Added an answer on June 7, 2026 at 7:37 pm

    I have it working. Here are the steps I used to make it work:

    • Choose File / Add / Existing Project... and navigate to the other project that you want as a subproject. Choose the .vcxproj file and okay the dialog. You have just added a project as a subproject.

    • Right-click on the main project in the “Solution Explorer” sidebar pane on the left, and choose Project Dependencies... Click on the subproject to make it a dependency of the main project, then okay the dialog. This is a tabbed dialog, and the other tab is “Build Order”; if you click on that you can make sure that Visual Studio will build the subproject first and then build the main project. You have now set things up so that the subproject builds first, then the main project.

    • Right-click on the main project in the “Solution Explorer” sidebar pane on the left, and choose References... In the references dialog, click on the Add New Reference... button. Make the main project reference the sub-project and okay it. You have now set things so that the linker will link the output file of the sub-project.

    I performed the above steps to make the DLL project have the static library project as a subproject, and I again performed these steps to make the EXE project have the DLL project as a subproject. But I got build errors about the static library file not being found. So I think that, even though I set the static library as a subproject of the DLL library, it is essential to set up that dependency within the EXE project; the dependencies don’t seem to be transitive! I performed the above steps to make it clear that the static library is a subproject of the DLL subproject of the EXE project, and that fixed things.

    Now when I hit the F7 key, everything builds. If I choose Build / Clean Solution it cleans all three projects. When it links, it gets the Debug or Release library files as appropriate and links them in.

    Sometimes when I hit F7 and build, the build fails, saying that the dependent library is outdated; but if I just hit F7 again then Visual Studio rebuilds the dependent library and the build succeeds. If I hit Ctrl+Alt+F7 to force a clean build, the build succeeds every time. I don’t know why Visual Studio has this quirk.

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

Sidebar

Related Questions

I am using Windows 7 and developing a chat-like application with Visual Studio 2010.
I'm starting my first PhoneGap project and am developing using Visual Studio and Windows
I'm developing in Visual Studio 2010 and I've just downloaded and installed Script# 0.6.2
I'm developing COM Interoperable classes using Visual Studio 2008. And consuming these classes on
I am developing a Microsoft Surface 2.0 application using Visual C# 2010 Express Edition.
I am using visual studio 2008 for developing. My program needs to deal with
I am developing on Eclipse on Windows and Code gets deployed on Unix. I
I'm developing a Windows application in VS2005 using C#. In my project, I generate
I am developing a Windows Mobile application using WM6 SDK. The application is a
I am developing a windows application using vb.net, I have a simple html page

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.