連結器工具錯誤 LNK2033
'type' 的未解析 typeref Token (token)
類型在 MSIL 元資料中沒有定義。
使用 /clr:safe 進行編譯時,可能會發生LNK2033,其中 MSIL 模組中只有類型正向宣告,其中 MSIL 模組中會參考該類型。
類型必須在 /clr:safe 下定義。
如需詳細資訊,請參閱 /clr (Common Language Runtime 編譯)。
範例
下列範例會產生LNK2033。
// LNK2033.cpp
// compile with: /clr:safe
// LNK2033 expected
ref class A;
ref class B {};
int main() {
A ^ aa = nullptr;
B ^ bb = nullptr; // OK
};