1

警告MSB8012

私はこのエラーについて尋ねる人々への多くの回答を読みましたが、それらのどれも私のような問題を抱えていないようです。プロジェクトでプロパティシートを使用して、毎回プロパティ設定を設定する手間を省こうとしています。これにより、ビルド時に次のようになります。

2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(989,5): warning MSB8012: TargetPath(C:\MyProj\Release\MyProj.dll) does not match the Linker's OutputFile property value (). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(990,5): warning MSB8012: TargetExt(.dll) does not match the Linker's OutputFile property value (). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(991,5): warning MSB8012: TargetName(MyProj) does not match the Linker's OutputFile property value (). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).

リンカのOutputFileプロパティ値を変更するだけで簡単にできますが、ご覧のとおり、Linker's OutputFile property value ()毎回(OutputFile値はnullですか?)と表示されます。これは、$(OutDir)$(TargetName)$(TargetExt)設定したものとは少し異なります...

プロパティシートで構成したのは、デバッグ設定、最適化設定、ビルド後のイベントの追加、Unicodeの無効化だけです。必要なのはそれだけですが、プロパティシートを削除しても、この問題はプロジェクトで解決されません。この警告を受け取った多くの人がそうであるように、私は以前のバージョンのVisual Studioからプロジェクトをまったく変換していませんが、プロパティシートを追加して構成しようとしました。

関連する設定の一部を次に示します。

一般->出力ディレクトリ:$(SolutionDir)$(Configuration)\

一般->ターゲット名:$(ProjectName)

一般->ターゲット拡張:.dll

リンカ->出力ファイル:$(OutDir)$(TargetName)$(TargetExt)

最初はこの警告を無視するつもりでしたが、実際に問題が発生し始めたので、誰かがこのMSパズルを理解できれば本当にありがたいです。

4

1 に答える 1

0

It seemed to start having an effect on all projects, so I reinstalled Visual Studio and the problem is gone... I'm scared to try and use property sheets again now, but it's better than nothing. I guess it was all MS' fault.

于 2013-02-18T01:08:11.800 に答える