Search code examples
c++cxmlcompilationaudacity

Error compiling Audacity MSB4023 item metadata cannot be applied with MSVC 2010


I am attempting to compile Audacity 2.0.0 and am receiving the following error. I am new to C/C++ so am unsure how to troubleshoot it. I am using VS 2010 Professional SP1.

Error 449 error MSB4023: Cannot evaluate the item metadata "%(Extension)". The item metadata "%(Extension)" cannot be applied to the path ""C:\audacity-src-2.0.0\win\Debug\Audacity.vcxproj\analyze.ny"". Illegal characters in path. C:\audacity-src-2.0.0\win\ny.targets 65 6 Audacity

Here is my ny.targets file. I have done some Googling, but so far it has been fruitless.

<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ItemGroup>
    <PropertyPageSchema
      Include="$(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml" />
    <AvailableItemName
      Include="copy">
      <Targets>_copy</Targets>
    </AvailableItemName>
  </ItemGroup>
  <UsingTask
    TaskName="copy"
    TaskFactory="XamlTaskFactory"
    AssemblyName="Microsoft.Build.Tasks.v4.0">
    <Task>$(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml</Task>
  </UsingTask>
  <Target
    Name="_copy"
    BeforeTargets="$(copyBeforeTargets)"
    AfterTargets="$(copyAfterTargets)"
    Condition="'@(copy)' != ''"
    DependsOnTargets="$(copyDependsOn);ComputecopyOutput"
    Outputs="@(copy-&gt;'%(Outputs)')"
    Inputs="@(copy);%(copy.AdditionalDependencies);$(MSBuildProjectFile)">
    <ItemGroup
      Condition="'@(SelectedFiles)' != ''">
      <copy
        Remove="@(copy)"
        Condition="'%(Identity)' != '@(SelectedFiles)'" />
    </ItemGroup>
    <ItemGroup>
      <copy_tlog
        Include="%(copy.Outputs)"
        Condition="'%(copy.Outputs)' != '' and '%(copy.ExcludedFromBuild)' != 'true'">
        <Source>@(copy, '|')</Source>
      </copy_tlog>
    </ItemGroup>
    <Message
      Importance="High"
      Text="%(copy.ExecutionDescription)" />
    <WriteLinesToFile
      Condition="'@(copy_tlog)' != '' and '%(copy_tlog.ExcludedFromBuild)' != 'true'"
      File="$(IntDir)$(ProjectName).write.1.tlog"
      Lines="^%(copy_tlog.Source);@(copy_tlog-&gt;'%(Fullpath)')" />
    <copy
      Condition="'@(copy)' != '' and '%(copy.ExcludedFromBuild)' != 'true'"
      CommandLineTemplate="%(copy.CommandLineTemplate)"
      OutputName="%(copy.OutputName)"
      AdditionalOptions="%(copy.AdditionalOptions)"
      Inputs="@(copy)" />
  </Target>
  <PropertyGroup>
    <ComputeLinkInputsTargets>
      $(ComputeLinkInputsTargets);
      ComputecopyOutput;
    </ComputeLinkInputsTargets>
    <ComputeLibInputsTargets>
      $(ComputeLibInputsTargets);
      ComputecopyOutput;
    </ComputeLibInputsTargets>
  </PropertyGroup>
  <Target
    Name="ComputecopyOutput"
    Condition="'@(copy)' != ''">
    <ItemGroup>
      <copyDirsToMake
        Condition="'@(copy)' != '' and '%(copy.ExcludedFromBuild)' != 'true'"
        Include="%(copy.Outputs)" />
      <Link
        Include="%(copyDirsToMake.Identity)"
        Condition="'%(Extension)'=='.obj' or '%(Extension)'=='.res' or '%(Extension)'=='.rsc' or '%(Extension)'=='.lib'" />
      <Lib
        Include="%(copyDirsToMake.Identity)"
        Condition="'%(Extension)'=='.obj' or '%(Extension)'=='.res' or '%(Extension)'=='.rsc' or '%(Extension)'=='.lib'" />
      <ImpLib
        Include="%(copyDirsToMake.Identity)"
        Condition="'%(Extension)'=='.obj' or '%(Extension)'=='.res' or '%(Extension)'=='.rsc' or '%(Extension)'=='.lib'" />
    </ItemGroup>
    <MakeDir
      Directories="@(copyDirsToMake-&gt;'%(RootDir)%(Directory)')" />
  </Target>
</Project>

Solution

  • While I didn't figure out the root of the error, I did find the workaround.

    The workaround is don't use VS2010 to compile Audacity.

    Use VS2008 — it worked right off the bat with 2008.

    This link, http://wiki.audacityteam.org/wiki/Developing_On_Windows#What_about_Visual_Studio_2010.3F__Or_64-bit.3F, gives detailed instructions.

    VC++ 2008 Express installs side by side with 2010, no problems.

    Here is the thread where they are trying to get it to work with 2010, http://forum.audacityteam.org/viewtopic.php?f=19&t=61946