-1

だから私には2つの問題があります。1 つ目は、次のような名前空間using内のものに対するステートメントが多数あるコードがあることです。Windows

using namespace Windows::System;
using namespace Windows::Storage;
using namespace Windows::ApplicationModel;

何らかの理由で、これは次のような大量のコンパイラ エラーを引き起こしています。

error C2039: 'System' : is not a member of 'Windows'
error C2871: 'System' : a namespace with this name does not exist
error C2039: 'Storage' : is not a member of 'Windows'
error C2871: 'Storage' : a namespace with this name does not exist
error C2039: 'ApplicationModel' : is not a member of 'Windows'
error C2871: 'ApplicationModel' : a namespace with this name does not exist
error C3083: 'ApplicationModel': the symbol to the left of a '::' must be a type

プロジェクトの「Windows Store App Support」プロパティをtrueに設定することで、この問題の修正を見つけました。Windowsストアアプリケーションではないので、これを行う必要があるのは本当に奇妙ですが、コンパイラエラーを修正するために私が見つけた唯一のものです.

2 つ目の問題は、Visual Studio を再起動すると、プロジェクトの読み込みに失敗し、「プロジェクトは Visual Studio の現在のエディションと互換性がありません」というエラー メッセージが表示されることです。これが Visual Studio 2012 のバグなのかどうかはわかりませんが、次回プロジェクトを開いたときにプロジェクトに互換性がなくなる場合に、このオプションを設定できるのは非常に奇妙に思えます。

ストア アプリのプロパティをオンにすることを伴わないコンパイラ エラーを修正する別の解決策がある場合は、それが推奨される解決策ですが、現時点では何でも構いません。

4

1 に答える 1