编译Audacity的错误MSB4023项目元数据无法应用于MSVC 2010

时间:2012-04-10 15:49:22

标签: c++ c xml compilation audacity

我正在尝试编译Audacity 2.0.0并收到以下错误。我是C / C ++的新手,所以我不确定如何解决它。我正在使用VS 2010 Professional SP1。

  

错误449错误MSB4023:无法评估项目元数据“%(扩展名)”。项元数据“%(扩展名)”无法应用于路径“”C:\ audacity-src-2.0.0 \ win \ Debug \ Audacity.vcxproj \ analyze.ny“”。路径中的非法字符。 C:\ audacity-src-2.0.0 \ win \ ny.targets 65 6 Audacity

这是我的ny.targets文件。我做了一些谷歌搜索,但到目前为止它没有结果。

<?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>

4 个答案:

答案 0 :(得分:4)

对于记录,您的问题是由引号引起的。

转到:

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

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

你如何做到这将取决于你如何传入输入。

答案 1 :(得分:1)

虽然我没有找出错误的根源,但我确实找到了解决方法。

解决方法是不要使用VS2010来编译Audacity。

使用VS2008 - 它与2008年一起发挥作用。

此链接http://wiki.audacityteam.org/wiki/Developing_On_Windows#What_about_Visual_Studio_2010.3F__Or_64-bit.3F提供详细说明。

VC ++ 2008 Express与2010并排安装,没有任何问题。

以下是他们试图让它与2010年一起使用的主题,http://forum.audacityteam.org/viewtopic.php?f=19&t=61946

答案 2 :(得分:1)

在VS2010中编译来自Sourceforge的当前代码的技巧是将ny.props文件修改为1个位置,并在portaudio-v19和portmixer的Pre-Build和Post-Build步骤中扩展变量。在当前的解决方案中,我似乎无法在VS2010中获取环境变量,如下所示。扩展他们似乎已经过了这个。但是,像SDK目录环境变量这样的预先声明的变量可以正常工作。

此外,ny.props文件中引号的单个修复程序稍后会修复所有级联。这似乎是让它正确编译的最小修复。

修复方法如下:

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预制原版:

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预构建修复:

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构建后原创:

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构建后修复:

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原文:

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修复:

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"

答案 3 :(得分:0)

我没有足够的声誉来评论Tom Bonner的答案,但是使用这些信息,我发现我的相同问题(使用不同的代码库)的解决方案是找到.props文件在与.targets文件相同的目录中,并使用相同的名称(即QtUIBuild.props和QtUIBuild.targets),并查找有问题的路径。就我而言,这是一个改变的问题

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

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