MFC VC2015 How to build from command line both settings: Use Shared DLL and Use Static DLL
-
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 -
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.
LubomirThere are two solutions:
- Create another configuration like ReleaseStatic which has the required setting configured
- 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.
-
There are two solutions:
- Create another configuration like ReleaseStatic which has the required setting configured
- 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.
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