這個問題有點特別,但是在這裏:我想在SDL中使用ZZipLib。 (http://zziplib.sourceforge.net/)ZZipLib附帶一個名爲SDL_rwops_zzip.c的文件,專門用於簡化插入SDL文件調用的過程。事實上,我在Mac上完成了這個任務,沒有任何問題。在SDL中使用ZZipLib? (編譯SDL_rwops_zzip.c)
問題是在Windows上它不會編譯。有問題的代碼是從SDL_rwops_zzip.c:
#define SDL_RWOPS_ZZIP_DATA(_context) \
((_context)->hidden.unknown.data1)
#define SDL_RWOPS_ZZIP_FILE(_context) (ZZIP_FILE*) \
((_context)->hidden.unknown.data1)
static int _zzip_seek(SDL_RWops *context, int offset, int whence) // line 30
{
return zzip_seek(SDL_RWOPS_ZZIP_FILE(context), offset, whence);
}
的錯誤,我得到的是:
SDL_rwops_zzip.c(31):警告C4028:正式參數1不同於聲明 SDL_rwops_zzip.c(31) :警告C4028:形式參數3不同於聲明 SDL_rwops_zzip.c(31):警告C4029:聲明的形式參數列表與定義不同 SDL_rwops_zzip.c(31):錯誤C2491:'_read':不允許定義dllimport函數
此堆棧溢出pos t給出了一些有關該錯誤的信息: definition of dllimport function not allowed
但我真的不明白在這種特殊情況下如何解決這個錯誤。