Pergunta

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>
Foi útil?

Solução 2

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

Outras dicas

For the record, your problem is caused by the quotation marks.

Turn:

""C:\audacity-src-2.0.0\win\Debug\Audacity.vcxproj\analyze.ny""

Into

"C:\audacity-src-2.0.0\win\Debug\Audacity.vcxproj\analyze.ny"

How you do that will depend on how you're passing in the input.

The trick to compiling the very current code from Sourceforge in VS2010 is modifying the ny.props file in 1 place, and expanding the variables in the Pre-Build and Post-Build steps of portaudio-v19 and portmixer. I cannot seem to get the environment variables in VS2010 to take as used below, in the current solution. Expanding them seems to get past this. However, predeclared variables like the SDK directory environment variable work fine.

Also, the single fix for the quotes in the ny.props file fixes all cascades later on. This seems to be the minimal fix to get it to compile properly.

The fix is below:

ny.props original:

<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup
    Condition="'$(copyBeforeTargets)' == '' and '$(copyAfterTargets)' == '' and '$(ConfigurationType)' != 'Makefile'">
    <copyBeforeTargets>Midl</copyBeforeTargets>
    <copyAfterTargets>CustomBuild</copyAfterTargets>
  </PropertyGroup>
  <PropertyGroup>
    <copyDependsOn
      Condition="'$(ConfigurationType)' != 'Makefile'">_SelectedFiles;$(copyDependsOn)</copyDependsOn>
  </PropertyGroup>
  <ItemDefinitionGroup>
    <copy>
      <OutputName>"$(OutDir)$(ProjectFileName)\%(Filename)%(Extension)"</OutputName>
      <CommandLineTemplate>copy /Y [inputs] %(OutputName)</CommandLineTemplate>
      <Outputs>%(OutputName)</Outputs>
      <ExecutionDescription>Copying %(Filename)</ExecutionDescription>
    </copy>
  </ItemDefinitionGroup>
</Project>

ny.props fix:

<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup
    Condition="'$(copyBeforeTargets)' == '' and '$(copyAfterTargets)' == '' and '$(ConfigurationType)' != 'Makefile'">
    <copyBeforeTargets>Midl</copyBeforeTargets>
    <copyAfterTargets>CustomBuild</copyAfterTargets>
  </PropertyGroup>
  <PropertyGroup>
    <copyDependsOn
      Condition="'$(ConfigurationType)' != 'Makefile'">_SelectedFiles;$(copyDependsOn)</copyDependsOn>
  </PropertyGroup>
  <ItemDefinitionGroup>
    <copy>
      <OutputName>$(OutDir)$(ProjectFileName)\%(Filename)%(Extension)</OutputName>
      <CommandLineTemplate>copy /Y [inputs] "%(OutputName)"</CommandLineTemplate>
      <Outputs>%(OutputName)</Outputs>
      <ExecutionDescription>Copying %(Filename)</ExecutionDescription>
    </copy>
  </ItemDefinitionGroup>
</Project>

portaudio-v19 Pre-Build original:

echo on
set CFG="$(ProjectDir)/$(Configuration)/config.h"

echo // Automatically generated file >%CFG%
IF NOT "%DXSDK_DIR%" == "" echo #define PA_USE_DS 1 >>%CFG%
IF NOT "%ASIOSDK_DIR%" == "" echo #define PA_USE_ASIO 1 >>%CFG%
IF NOT "%JACKSDK_DIR%" == "" echo #define PA_USE_JACK 1 >>%CFG%
IF NOT "%JACKSDK_DIR%" == "" echo #define PA_DYNAMIC_JACK 1 >>%CFG%
rem echo #define PA_USE_WDMKS 1 >>%CFG%
echo #define PA_USE_WASAPI 1 >>%CFG%
echo #define PA_USE_WMME 1 >>%CFG%

portaudio-v19 Pre-Build fix:

echo // Automatically generated file >"$(ProjectDir)/$(Configuration)/config.h"
IF NOT "%DXSDK_DIR%" == "" echo #define PA_USE_DS 1 >>"$(ProjectDir)/$(Configuration)/config.h"
IF NOT "%ASIOSDK_DIR%" == "" echo #define PA_USE_ASIO 1 >>"$(ProjectDir)/$(Configuration)/config.h"
IF NOT "%JACKSDK_DIR%" == "" echo #define PA_USE_JACK 1 >>"$(ProjectDir)/$(Configuration)/config.h"
IF NOT "%JACKSDK_DIR%" == "" echo #define PA_DYNAMIC_JACK 1 >>"$(ProjectDir)/$(Configuration)/config.h"
rem echo #define PA_USE_WDMKS 1 >>"$(ProjectDir)/$(Configuration)/config.h"
echo #define PA_USE_WASAPI 1 >>"$(ProjectDir)/$(Configuration)/config.h"
echo #define PA_USE_WMME 1 >>"$(ProjectDir)/$(Configuration)/config.h"

portaudio-v19 Post-Build original:

echo on
set BASE="../../../lib-src/portaudio-v19"
set CFG=$(ProjectDir)$(Configuration)\config.h
set INTDIR=$(Configuration)
set CFLAGS=/O2 /GL /I "%BASE%/include" /I "%BASE%/src/common" /I "%BASE%/src/os/win" /D "WIN32" /D "NDEBUG" /D "_LIB" /D "_MBCS" /GF /FD /EHsc /MD /Gy /Fo"%INTDIR%/" /Fd"%INTDIR%" /W3 /nologo /c /wd4996 /FI "%CFG%" /errorReport:prompt
set LIBS=

find "PA_USE_DS 1" "%CFG%"
IF ERRORLEVEL 1 goto NoDS

cl %CFLAGS% /I "%DXSDK_DIR%/include" "%BASE%/src/hostapi/dsound/pa_win_ds.c"
cl %CFLAGS% /I "%DXSDK_DIR%/include" "%BASE%/src/hostapi/dsound/pa_win_ds_dynlink.c"

set LIBS="%DXSDK_DIR%/lib/x86\dxguid.lib"

:NoDS

find "PA_USE_WASAPI 1" "%CFG%"
IF ERRORLEVEL 1 goto NoWASAPI

cl %CFLAGS% "%BASE%/src/hostapi/wasapi/pa_win_wasapi.c"

:NoWASAPI

find "PA_USE_WDMKS 1" "%CFG%"
IF ERRORLEVEL 1 goto NoWDMKS

cl %CFLAGS% "%BASE%/src/hostapi/wdmks/pa_win_wdmks.c"

:NoWDMKS

find "PA_USE_ASIO 1" "%CFG%"
IF ERRORLEVEL 1 goto NoASIO

cl %CFLAGS% /I "%ASIOSDK_DIR%/common" /I "%ASIOSDK_DIR%/host" /I "%ASIOSDK_DIR%/host/pc" "%BASE%/src/hostapi/asio/pa_asio.cpp"
cl %CFLAGS% /I "%ASIOSDK_DIR%/common" /I "%ASIOSDK_DIR%/host" /I "%ASIOSDK_DIR%/host/pc" "%BASE%/src/hostapi/asio/iasiothiscallresolver.cpp"
cl %CFLAGS% /I "%ASIOSDK_DIR%/common" /I "%ASIOSDK_DIR%/host" /I "%ASIOSDK_DIR%/host/pc" "%ASIOSDK_DIR%/common/asio.cpp"
cl %CFLAGS% /I "%ASIOSDK_DIR%/common" /I "%ASIOSDK_DIR%/host" /I "%ASIOSDK_DIR%/host/pc" "%ASIOSDK_DIR%/host/asiodrivers.cpp"
cl %CFLAGS% /I "%ASIOSDK_DIR%/common" /I "%ASIOSDK_DIR%/host" /I "%ASIOSDK_DIR%/host/pc" "%ASIOSDK_DIR%/host/pc/asiolist.cpp"

:NoASIO

find "PA_USE_JACK 1" "%CFG%" >NUL
IF ERRORLEVEL 1 goto NoJACK

cl %CFLAGS% /I "%JACKSDK_DIR%/includes" "%BASE%/src/hostapi/jack/pa_jack.c"
cl %CFLAGS% /I "%JACKSDK_DIR%/includes" "%BASE%/src/hostapi/jack/pa_jack_dynload.c"

:NoJACK

lib /OUT:"$(TargetPath)" "%INTDIR%/*.obj" %LIBS%

portaudio-v19 Post-Build fix:

find "PA_USE_DS 1" "$(ProjectDir)$(Configuration)/config.h"
IF ERRORLEVEL 1 goto NoDS

cl /O2 /GL /I "../../../lib-src/portaudio-v19/include" /I "../../../lib-src/portaudio-v19/src/common" /I "../../../lib-src/portaudio-v19/src/os/win" /D "WIN32" /D "NDEBUG" /D "_LIB" /D "_MBCS" /GF /FD /EHsc /MD /Gy /Fo"$(IntDir)/" /Fd"$(IntDir)/" /W3 /nologo /c /wd4996 /FI "$(ProjectDir)$(Configuration)/config.h" /errorReport:prompt /I "%DXSDK_DIR%/include" "../../../lib-src/portaudio-v19/src/hostapi/dsound/pa_win_ds.c"
cl /O2 /GL /I "../../../lib-src/portaudio-v19/include" /I "../../../lib-src/portaudio-v19/src/common" /I "../../../lib-src/portaudio-v19/src/os/win" /D "WIN32" /D "NDEBUG" /D "_LIB" /D "_MBCS" /GF /FD /EHsc /MD /Gy /Fo"$(IntDir)/" /Fd"$(IntDir)/" /W3 /nologo /c /wd4996 /FI "$(ProjectDir)$(Configuration)/config.h" /errorReport:prompt /I "%DXSDK_DIR%/include" "../../../lib-src/portaudio-v19/src/hostapi/dsound/pa_win_ds_dynlink.c"

:NoDS

find "PA_USE_WASAPI 1" "$(ProjectDir)$(Configuration)/config.h"
IF ERRORLEVEL 1 goto NoWASAPI

cl /O2 /GL /I "../../../lib-src/portaudio-v19/include" /I "../../../lib-src/portaudio-v19/src/common" /I "../../../lib-src/portaudio-v19/src/os/win" /D "WIN32" /D "NDEBUG" /D "_LIB" /D "_MBCS" /GF /FD /EHsc /MD /Gy /Fo"$(IntDir)/" /Fd"$(IntDir)/" /W3 /nologo /c /wd4996 /FI "$(ProjectDir)$(Configuration)/config.h" /errorReport:prompt "../../../lib-src/portaudio-v19/src/hostapi/wasapi/pa_win_wasapi.c"

:NoWASAPI

find "PA_USE_WDMKS 1" "$(ProjectDir)$(Configuration)/config.h"
IF ERRORLEVEL 1 goto NoWDMKS

cl %CFLAGS% "%BASE%/src/hostapi/wdmks/pa_win_wdmks.c"

:NoWDMKS

find "PA_USE_ASIO 1" "$(ProjectDir)$(Configuration)/config.h"
IF ERRORLEVEL 1 goto NoASIO

cl %CFLAGS% /I "%ASIOSDK_DIR%/common" /I "%ASIOSDK_DIR%/host" /I "%ASIOSDK_DIR%/host/pc" "%BASE%/src/hostapi/asio/pa_asio.cpp"
cl %CFLAGS% /I "%ASIOSDK_DIR%/common" /I "%ASIOSDK_DIR%/host" /I "%ASIOSDK_DIR%/host/pc" "%BASE%/src/hostapi/asio/iasiothiscallresolver.cpp"
cl %CFLAGS% /I "%ASIOSDK_DIR%/common" /I "%ASIOSDK_DIR%/host" /I "%ASIOSDK_DIR%/host/pc" "%ASIOSDK_DIR%/common/asio.cpp"
cl %CFLAGS% /I "%ASIOSDK_DIR%/common" /I "%ASIOSDK_DIR%/host" /I "%ASIOSDK_DIR%/host/pc" "%ASIOSDK_DIR%/host/asiodrivers.cpp"
cl %CFLAGS% /I "%ASIOSDK_DIR%/common" /I "%ASIOSDK_DIR%/host" /I "%ASIOSDK_DIR%/host/pc" "%ASIOSDK_DIR%/host/pc/asiolist.cpp"

:NoASIO

find "PA_USE_JACK 1" "$(ProjectDir)$(Configuration)/config.h"
IF ERRORLEVEL 1 goto NoJACK

cl %CFLAGS% /I "%JACKSDK_DIR%/includes" "%BASE%/src/hostapi/jack/pa_jack.c"
cl %CFLAGS% /I "%JACKSDK_DIR%/includes" "%BASE%/src/hostapi/jack/pa_jack_dynload.c"

:NoJACK

lib /OUT:"$(TargetPath)" "$(IntDir)/*.obj" "%DXSDK_DIR%/lib/x86/dxguid.lib"


portmixer Post-Build original:

set BASE="../../../lib-src/portmixer"
set CFLAGS=/O2 /GL /I "%BASE%/../portaudio-v19/include" /I "%BASE%/include" /D "WIN32" /D "NDEBUG" /D "_LIB" /D "PX_USE_WIN_MME" /D "_MBCS" /GF /FD /EHsc /MD /Gy /Fo"$(IntDir)" /Fd"$(IntDir)" /W3 /nologo /c /wd4996 /FI "$(ProjectDir)/$(Configuration)/config.h" /errorReport:prompt

if "%DXSDK_DIR%"=="" goto NoDX

cl %CFLAGS% /I "%DXSDK_DIR%/include" "%BASE%/src/px_win_ds.c"

set LIBS="%DXSDK_DIR%/lib/x86/dxguid.lib"

:NoDX

lib /OUT:"$(TargetPath)" "$(IntDir)*.obj" %LIBS%


portmixer Post-Build fix:

if "%DXSDK_DIR%"=="" goto NoDX

cl /O2 /GL /I "../../../lib-src/portmixer/../portaudio-v19/include" /I "../../../lib-src/portmixer/include" /D "WIN32" /D "NDEBUG" /D "_LIB" /D "PX_USE_WIN_MME" /D "_MBCS" /GF /FD /EHsc /MD /Gy /Fo"$(IntDir)/" /Fd"$(IntDir)/" /W3 /nologo /c /wd4996 /FI "$(ProjectDir)/$(Configuration)/config.h" /errorReport:prompt /I "%DXSDK_DIR%/include" "../../../lib-src/portmixer/src/px_win_ds.c"

:NoDX

lib /OUT:"$(TargetPath)" "$(IntDir)/*.obj" "%DXSDK_DIR%/lib/x86/dxguid.lib"

portmixer Post-Build original:

set BASE="../../../lib-src/portmixer"
set CFLAGS=/O2 /GL /I "%BASE%/../portaudio-v19/include" /I "%BASE%/include" /D "WIN32" /D "NDEBUG" /D "_LIB" /D "PX_USE_WIN_MME" /D "_MBCS" /GF /FD /EHsc /MD /Gy /Fo"$(IntDir)" /Fd"$(IntDir)" /W3 /nologo /c /wd4996 /FI "$(ProjectDir)/$(Configuration)/config.h" /errorReport:prompt

if "%DXSDK_DIR%"=="" goto NoDX

cl %CFLAGS% /I "%DXSDK_DIR%/include" "%BASE%/src/px_win_ds.c"

set LIBS="%DXSDK_DIR%/lib/x86/dxguid.lib"

:NoDX

lib /OUT:"$(TargetPath)" "$(IntDir)*.obj" %LIBS%

portmixer Post-Build fix:

if "%DXSDK_DIR%"=="" goto NoDX

cl /O2 /GL /I "../../../lib-src/portmixer/../portaudio-v19/include" /I "../../../lib-src/portmixer/include" /D "WIN32" /D "NDEBUG" /D "_LIB" /D "PX_USE_WIN_MME" /D "_MBCS" /GF /FD /EHsc /MD /Gy /Fo"$(IntDir)/" /Fd"$(IntDir)/" /W3 /nologo /c /wd4996 /FI "$(ProjectDir)/$(Configuration)/config.h" /errorReport:prompt /I "%DXSDK_DIR%/include" "../../../lib-src/portmixer/src/px_win_ds.c"

:NoDX

lib /OUT:"$(TargetPath)" "$(IntDir)/*.obj" "%DXSDK_DIR%/lib/x86/dxguid.lib"

I don't have enough reputation to comment on Tom Bonner's answer, but using that information, I found the solution for my identical problem (with a different code base) was to find the .props file in the same directory as the .targets file, and with the same name (i.e. QtUIBuild.props and QtUIBuild.targets), and look for the offending path. In my case it was a matter of changing

<Outputs>".\..\..\source\qt\GeneratedFiles\ui_%(Filename).h"</Outputs>

to

<Outputs>.\..\..\source\qt\GeneratedFiles\ui_%(Filename).h</Outputs>
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top