Quantcast
Channel: Visual Studio General Questions forum
Viewing all articles
Browse latest Browse all 21115

Inconsistent Behavior with RuntimeLibrary and Props File in Visual C++

$
0
0

I use a props file to help with configuring Visual Studio projects in a moderately large solution.  I am running into an issue where the the selected CRuntime Library is not displaying correctly in the properties, but when I view the macro values the value is set correctly.

The Runtime Library value in the properties page.  The value should be inherited at this point and should be Multi-Threaded Debug Dll:

When I view the Macro values for this configuration I see the following value:

From here it appears that the Properties Editor UI doesn't reflect the actual Runtime library.  

On the other hand I have another project within the solution where the the Runtime Library changes with the configuration and reflects the RuntimeLibrary macro value.

Below is the XML code from the props file that selects the different runtime libraries to use:

<!-- CRT Library Type --><PropertyGroup><!--Should we consider changing to the static linked libraries to reduce dependencies when--> <!--setting up or upgrading a system?--><!--<RuntimeLibrary Condition="'$(Configuration)'=='Debug'">MultiThreadedDebug</RuntimeLibrary>--><!--<RuntimeLibrary Condition="'$(Configuration)'=='Release'">MultiThreaded</RuntimeLibrary>--><RuntimeLibrary Condition="'$(Configuration)'=='Debug'">MultiThreadedDebugDLL</RuntimeLibrary><RuntimeLibrary Condition="'$(Configuration)'=='Release'">MultiThreadedDLL</RuntimeLibrary><TestRunTimeLibrary>$RuntimeLibrary</TestRunTimeLibrary></PropertyGroup>


I suspect that I have a conflict somewhere in the other settings but haven't been able to find it.  Below is the command line for the project that is causing the issue:

/Zi /nologo /W3 /WX /Od /Oy- /D "WIN32" /D "_DEBUG" /D "_LIB" /D "CORRECT_THETA_REVERSAL" /D "_CRT_SECURE_NO_DEPRECATE" /D "_USE_32BIT_TIME_T" /D "_VC80_UPGRADE=0x0710" /D "_MBCS" /Gm- /EHsc /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fp"Debug\XYControlD_vc10_win32.pch" /Fa"Debug\" /Fo"Debug\" /Fd"Debug\vc100.pdb" /FR"Debug\" /Gd /analyze- /errorReport:queue 

I have also tried to use ItemDefinition Groups similar to what is found in the vcxproj file but they end up giving the same result:

<!--Configuration Dependent Properties--><ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"><ClCompile><RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary></ClCompile></ItemDefinitionGroup><ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"><ClCompile><RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary></ClCompile></ItemDefinitionGroup><ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"><ClCompile><RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary></ClCompile></ItemDefinitionGroup><ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"><ClCompile><RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary></ClCompile></ItemDefinitionGroup>

Any thoughts would be appreciated

Thanks.




Viewing all articles
Browse latest Browse all 21115

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>