locked
*.targets file to use with WPP RRS feed

  • Question

  • I try to use WPP under user mode, managed to successfully use it in VS10->Release target by adding to the proj file:

      <PropertyGroup>    <WdkDir>c:\work\Proj\wppTest\DDK\</WdkDir>   <MyTargetsDir>c:\work\Proj\wppTest</MyTargetsDir>  </PropertyGroup>

    ...

      <ImportGroup Label="ExtensionTargets">
        <Import Project="$(MyTargetsDir)\Wpp.targets" />
      </ImportGroup>

    Then Wpp.targets is defined like this:

    <?xml version="1.0" encoding="utf-8"?>
    <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
      <PropertyGroup>
          <ExtensionsToDeleteOnClean>$(ExtensionsToDeleteOnClean);*.tmh</ExtensionsToDeleteOnClean>
      </PropertyGroup>
      <ItemGroup>
          <CoreCppClean Include="@(CoreCppClean);$(ProjectDir)">
              <FilePatternsToDelete>*.tmh</FilePatternsToDelete>
         </CoreCppClean>
      </ItemGroup>
      <ItemGroup>
        <TraceWppSources Include="@(ClCompile)" Exclude="stdafx.cpp" />
      </ItemGroup>
      <Target Name="TraceWpp" BeforeTargets="ClCompile" Inputs="@(TraceWppSources)" Outputs="@(TraceWppSources -> '%(Filename).tmh')">
        <Exec Command="cd $(ProjectDir)" />
        <Message Importance="high" Text="Creating tmh"/>
        <Exec Command="$(WdkDir)\bin\x86\tracewpp.EXE -cfgdir:$(WdkDir)\bin\wppconfig\rev1 -odir:. @(TraceWppSources, ' ')" />
        <Message Importance="high" Text="tmh created"/>
      </Target>
    </Project>

    When trying to compile this under VS10->Debug I can see that "tmh" files are being generated only that I get error when actualy I want to log something:

    DoTraceMessage(TRACE_ERROR, L"Aha"); //  error C2065: 'TRACE_ERROR' : undeclared identifier error C3861: 'WPP_CALL_Application_Test_cpp': identifier not found

    As I've said I have no issues with the same code on VS10->Release target. Here is my defines for reference:

    #pragma once
    
    #define WPP_CONTROL_GUIDS \
        WPP_DEFINE_CONTROL_GUID(CtlGuid,(28EE579B, CF67, 43b6, 9D19, 8930E7AAA131),  \
                                                                                \
            WPP_DEFINE_BIT(TRACE_ERROR)                                   \
            WPP_DEFINE_BIT(TRACE_WARNING)                                   \
            WPP_DEFINE_BIT(TRACE_INFO1)                                   \
            WPP_DEFINE_BIT(TRACE_INFO2)                                   \
            )
    Does anyone have any idea why that might work using Release mode but does not work under Debug mode ? I already asked this question on DDK forum but was advised to ask here because it might pertain to *.targets file. Any help is appreciated. Thanks !
    Tuesday, April 24, 2012 9:36 AM

Answers

  • Found out the reason why it was not compiling on DEBUG mode. I had the /ZI compiler flag  set and it was expecting the /Zi format for compiling to work in Debug
    • Marked as answer by raiderG Tuesday, April 24, 2012 2:52 PM
    Tuesday, April 24, 2012 2:51 PM

All replies

  • Found out the reason why it was not compiling on DEBUG mode. I had the /ZI compiler flag  set and it was expecting the /Zi format for compiling to work in Debug
    • Marked as answer by raiderG Tuesday, April 24, 2012 2:52 PM
    Tuesday, April 24, 2012 2:51 PM
  • Hi raiderG,

    I’m glad to hear that you got it working.
    Thank you for sharing your solutions & experience here. It will be very beneficial for other community members who have similar questions.


    Lucy Liu [MSFT]
    MSDN Community Support | Feedback to us

    Wednesday, April 25, 2012 7:07 AM
  • Does anyone know the root cause why we need to change it from /ZI to /Zi?
    Monday, October 8, 2012 3:57 AM