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. ATL / WTL / STL
  4. MFC VC2015 How to build from command line both settings: Use Shared DLL and Use Static DLL

MFC VC2015 How to build from command line both settings: Use Shared DLL and Use Static DLL

Scheduled Pinned Locked Moved ATL / WTL / STL
visual-studiotutorialcsharpc++help
3 Posts 2 Posters 21 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.
  • M Offline
    M Offline
    Member 10245587
    wrote on last edited by
    #1

    Hello boys.

    I use Visual Studio 2015.
    Projekt setting: Use MFC in a Shared DLL.

    For building from command line is used:
    msbuild .\my_project.sln /t:Rebuild /p:Configuration=Release /p:Platform=x64
    All is working well, build runs OK.

    I would like to ask you:
    Is there a way how to switch (any parametr for msbuild) between Shared and Static MFC DLL?

    for example:
    msbuild .\my_project.sln /t:Rebuild /p:Configuration=Release /p:Platform=x64 /p:ANYKEYWORD=Shared
    or
    msbuild .\my_project.sln /t:Rebuild /p:Configuration=Release /p:Platform=x64 p:/ANYKEYWORD=Static
    or anything like that.

    I can not find a way, how to build project from command line and switch both possibilities: "Use MFC in a Shared DLL" and "Use MFC in a Static DLL" without opening IDE and switching it there manualy in project setting.

    Thank you for advices and help.
    Lubomir

    J 1 Reply Last reply
    0
    • M Member 10245587

      Hello boys.

      I use Visual Studio 2015.
      Projekt setting: Use MFC in a Shared DLL.

      For building from command line is used:
      msbuild .\my_project.sln /t:Rebuild /p:Configuration=Release /p:Platform=x64
      All is working well, build runs OK.

      I would like to ask you:
      Is there a way how to switch (any parametr for msbuild) between Shared and Static MFC DLL?

      for example:
      msbuild .\my_project.sln /t:Rebuild /p:Configuration=Release /p:Platform=x64 /p:ANYKEYWORD=Shared
      or
      msbuild .\my_project.sln /t:Rebuild /p:Configuration=Release /p:Platform=x64 p:/ANYKEYWORD=Static
      or anything like that.

      I can not find a way, how to build project from command line and switch both possibilities: "Use MFC in a Shared DLL" and "Use MFC in a Static DLL" without opening IDE and switching it there manualy in project setting.

      Thank you for advices and help.
      Lubomir

      J Offline
      J Offline
      Jochen Arndt
      wrote on last edited by
      #2

      There are two solutions:

      1. Create another configuration like ReleaseStatic which has the required setting configured
      2. Open the vcxproj file with a text editor and lookup the property for the setting you want to override (UseOfMfc=Static with VS 2017 here)

      Note also that the Visual Studio Discussion Boards[^] would be the appropriate forum for such questions.

      M 1 Reply Last reply
      0
      • J Jochen Arndt

        There are two solutions:

        1. Create another configuration like ReleaseStatic which has the required setting configured
        2. Open the vcxproj file with a text editor and lookup the property for the setting you want to override (UseOfMfc=Static with VS 2017 here)

        Note also that the Visual Studio Discussion Boards[^] would be the appropriate forum for such questions.

        M Offline
        M Offline
        Member 10245587
        wrote on last edited by
        #3

        Thank you for you advice. Yes, It is a way, which is working well. New configuration with config manager "StaticRelease" + change "Use Static DLL" from IDE. Command line is then: msbuild my_project.vcxproj /t:Rebuild /p:Configuration=ReleaseStatic /p:Platform=x64 Thank you again. Lubomir

        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