2006年7月21日 星期五

BCB6 and ZLib

ZLib 一直是個很受用的程式庫
久沒注意,沒想到已更新到 1.23 了..
入手後馬上就把手邊的工具做個更新順便做一下測試。

沒想到在 BCB6 下居然出現了一個錯誤
[C++ Error] zconf.h(270): E2015 Ambiguity between 'Byte' and 'System::Byte'
意思為.. 編譯器無法確認要使用 Byte 或 System::Byte
這二個定義,因此出現錯誤。
修改方法很簡單,只要令 ZLib 使用 BCB 的定義即可
方法如下:
檔案 Zconf.h
原程式碼

[cpp]
#ifdef SMALL_MEDIUM
/* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
# define Bytef Byte FAR
#else
typedef Byte FAR Bytef;
#endif
[/cpp]

修改成如下即可

[cpp]
#ifdef SMALL_MEDIUM
/* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
# define Bytef Byte FAR
#else
typedef ::Byte FAR Bytef;
#endif
[/cpp]

沒有留言:

張貼留言