Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Adding a static library build

Adding a static library build

Scheduled Pinned Locked Moved C / C++ / MFC
csharpc++visual-studiotutorialquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    softwaremonkey
    wrote on last edited by
    #1

    Hi, I have a project which I originally built as an MFC extension DLL using Visual Studio 2008 App Wizard. I would now like to be able to build the same project as a static library but I don't know how to do this. Ideally, I would like to retain both DLL and static builds. Can anyone please advise? thanks Tony :thumbsup:

    A 1 Reply Last reply
    0
    • S softwaremonkey

      Hi, I have a project which I originally built as an MFC extension DLL using Visual Studio 2008 App Wizard. I would now like to be able to build the same project as a static library but I don't know how to do this. Ideally, I would like to retain both DLL and static builds. Can anyone please advise? thanks Tony :thumbsup:

      A Offline
      A Offline
      Andrew Brock
      wrote on last edited by
      #2

      In the toolbars at the top there is the configuration boxes, 1 containing Debug or Release and the other containing Win32. Drop down either of those boxes and select Configuration Manager. From the Configuration Manager you can add extra configurations to each individual project. Select the configuration (debug or release) next to your MFC DLL project and select from the dropdown. Call it Static Debug (or anything else if you feel like it) and then change Copy settings from: to Debug. Repeat again for Release, calling it Static Release. If you want to change the default configuration from DLL to static LIB then you can change the Configuration type for the MFC DLL in the Configuraion Manager that is to be build with the Debug and Release compiles. Close the Configuration Manager. Now right click on the MFC DLL project in the solution explorer and select Project Properties. Change the configuration at the top of the properties box to Static Debug, then go to the General page from the list at the left. change Configuration Type to Static Library. Do the same for Static Release. You may need to change a few other things as well, there is probably a definition in the C++>Preprocessor page for DLL or something that you will need to get rid of.

      S 1 Reply Last reply
      0
      • A Andrew Brock

        In the toolbars at the top there is the configuration boxes, 1 containing Debug or Release and the other containing Win32. Drop down either of those boxes and select Configuration Manager. From the Configuration Manager you can add extra configurations to each individual project. Select the configuration (debug or release) next to your MFC DLL project and select from the dropdown. Call it Static Debug (or anything else if you feel like it) and then change Copy settings from: to Debug. Repeat again for Release, calling it Static Release. If you want to change the default configuration from DLL to static LIB then you can change the Configuration type for the MFC DLL in the Configuraion Manager that is to be build with the Debug and Release compiles. Close the Configuration Manager. Now right click on the MFC DLL project in the solution explorer and select Project Properties. Change the configuration at the top of the properties box to Static Debug, then go to the General page from the list at the left. change Configuration Type to Static Library. Do the same for Static Release. You may need to change a few other things as well, there is probably a definition in the C++>Preprocessor page for DLL or something that you will need to get rid of.

        S Offline
        S Offline
        softwaremonkey
        wrote on last edited by
        #3

        Thanks Andrew, this is exactly the information I needed. :thumbsup: :thumbsup: Tony :)

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups