2012-02-06 45 views
1

我收到此錯誤:編譯器錯誤 - 元數據操作失敗

Joke.obj : error LNK2022: metadata operation failed (80131187) : Inconsistent method declarations in duplicated types (types: SE.Crypt; methods: GetVolumeInformationA): (0x06000008). 
    LINK : fatal error LNK1215: metadata operation failed (8013118A) : 

這裏是在頭文件中的代碼:

private: 
      [System::Runtime::InteropServices::DllImport("kernel32.dll")] 
      static Int64 GetVolumeInformation(String ^PathName, StringBuilder ^VolumeNameBuffer, UInt32 VolumeNameSize, UInt32 %VolumeSerialNumber, UInt32 %MaximumComponentLength, UInt32 %FileSystemFlags, StringBuilder ^FileSystemNameBuffer, UInt32 FileSystemNameSize); 

任何想法?

由於

回答

0

GetVolumeInformation返回BOOL不映射到的Int64。

順便說一句,當你調用ANSI函數的這個函數時,你可能會遇到麻煩。當Windows 7創建一個系統保留分區時,安裝程​​序會根據安裝程序的語言爲其指定一個卷名稱,而不必與要執行的環境相匹配。最好調用Unicode版本。

相關問題