VS2010で開発されたC++プロジェクト(コンソール32ビットアプリケーションのようなもの)は、PC(Windows 7 32-bit) 。私のPCにはMicrosoft SDK 7.0Aがインストールされています。これはVS2010にバンドルされていると思います。
Visual Studioがインストールされていないビルドサーバーでプロジェクトを構築しようとしましたが、そこにはMicrosoft SDK 7.1のみが存在します。
私は(これは最終的にはチームシティーのランナーのための課題となります)のMSBuildの助けを借りて、プロジェクトをビルドしようとすると、ビルドサーバー上で、私はエラー(詳細なログが提供される)以下の取得:私はWindows SDK 7.1(ただし、VS2010なし)のPCでC++プロジェクトを構築
Project "E:\win\core.sln" on node 1 (default targets).
ValidateSolutionConfiguration:
Building solution configuration "Debug|Win32".
Project "E:\win\core.sln" (1) is building "E:\win\core_unittests.vcxproj" (2) on node 1 (default targets).
Project "E:\win\core_unittests.vcxproj" (2) is building "E:\cpptest\win\cpptest.vcxproj" (3) on node 1 (default targets).
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.Targets(847,9): warning MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.0" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend. [E:\cpptest\win\cpptest.vcxproj]
C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(297,5): warning MSB8003: Could not find WindowsSDKDir variable from the registry. TargetFrameworkVersion or PlatformToolset may be set to an invalid version number. [E:\win\cpptest.vcxproj]
InitializeBuildStatus:
Touching "E:\cpptest\win\..\..\..\out\Debug\cpptest\cpptest.unsuccessfulbuild".
ClCompile:
C:\Program Files\Microsoft Visual Studio 10.0\VC\bin\CL.exe /c /ZI /nologo /W3 /WX- /Od /Oy- /D WIN32 /D _DEBUG /D _LIB /D _UNICODE /D UNICODE /Gm /EHsc /RTC1 /MTd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"E:\cpptest\win\..\..\..\out\Debug\cpptest\\" /Fd"E:\cpptest\win\..\..\..\out\Debug\cpptest\vc100.pdb" /Gd /TP /analyze- /errorReport:queue ../missing.cpp
missing.cpp
e:\cpptest\missing.cpp(36): fatal error C1083: Cannot open include file: 'windows.h': No such file or directory [E:\cpptest\win\cpptest.vcxproj]
をmsbuildが"E:\Program Files\Microsoft SDKs\Windows\v7.1"
にインストールされているMicrosoft SDKを見つけることができないことに関連しているとします。
Web上で利用できる、この問題を処理するために、どのようにいくつかのアドバイスがあります
- は
HKCU
にHKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.1
下のレジストリの一部をコピーします(WindowsSdkDir is not set correctly in Visual Studio 2008?を参照してください)。私はこの回避策を試していませんでした。なぜなら、あまりにも醜いので、ビルドプロセスはSYSTEMアカウントの資格情報で実行されるからです。 - TeamCity and MSBuild Quirks #1で提案されているように、MSBuildの追加パラメータとして
WindowsSDKDir
を渡します。 - answer〜Include Search Paths in TeamCity build Configurationsで提案されているように
VCProjectEngine.dll.config.xml
を調整してください(Windows SDKを使用しているPCでそのファイルが見つかりませんでした)。 - the answer〜WindowsSdkDir is not set correctly in Visual Studio 2010で提案されているプロジェクトプロパティのプラットフォームツールセットを変更してください(私のPCにWindows SDK 7.1がインストールされていないため、これが役立つとは思えません)。実際
CL.EXE
すべてをコンパイルする(私は定義されINCLUDE
とLIB
変数を持っているので)罰金になり、環境変数を渡す/使用するMSBuildのを強制的にこの問題を回避するだろう...
あります同様の問題:
- "Differences between building on a machine with VS2010 installed and on a machine with the 7.1 SDK installed"ただし、.NETプロジェクトの場合。
- Erroneous Windows SDK x64 Compilation Warning(64ビットプラットフォーム用の32ビットプロジェクトの構築)
とにかくは、Windows SDKがインストールされたPCにVisual C++ 2010プロジェクトを作成するのに成功しました?
こんにちは、Visual Studio 2010 C++ Team City Agentを使用したビルドサーバーでプロジェクトを実行するMSBuildがmspdb100.dll DLL – Stefano
@Stefanoが見つからない場合、MSBuildは、通常、適切な解決方法は、 '%PATH%'に 'mspdb100.dll'のディレクトリを追加することです。 – AntonK