2009-06-30 19 views
2

我試圖在z/OS USS(即正確的大型機)上編譯z/lib。我得到了gmake和c89編譯器(我認爲它符合c89標準),USS應該是符合POSIX標準的。z/OS上的zlib USS

但是zlib的似乎與下面的錯誤(或多個)

c89 -O3 -DUSE_MMAP -D_XOPEN_SOURCE_EXTENDED=1 -D_POSIX_SOURCE -c -o example.o example.c 
ERROR CCN3277 ./zlib.h:92 Syntax error: possible missing ';' or ','? 
ERROR CCN3007 ./zlib.h:92 "struct internal_state" is undefined. 
ERROR CCN3166 ./zlib.h:103 Definition of function FAR requires parentheses. 
ERROR CCN3276 ./zlib.h:103 Syntax error: possible missing '{'? 
ERROR CCN3273 ./zlib.h:124 Missing type in declaration of gz_header. 
ERROR CCN3166 ./zlib.h:126 Definition of function gz_header requires parentheses. 
ERROR CCN3276 ./zlib.h:126 Syntax error: possible missing '{'? 
WARNING CCN3137 ./zlib.h:1346 Declaration must declare at least one declarator, tag, or the members of an enumeration. 
ERROR CCN3275 ./zlib.h:1350 Unexpected text z encountered. 
ERROR CCN3282 ./zlib.h:1350 The type of the parameters must be specified in a prototype. 
ERROR CCN3275 ./example.c:95 Unexpected text file encountered. 
ERROR CCN3045 ./example.c:95 Undeclared identifier gzFile. 
ERROR CCN3046 ./example.c:96 Syntax error. 
ERROR CCN3045 ./example.c:98 Undeclared identifier file. 
ERROR CCN3019 ./example.c:523 Expecting an array or a pointer to object type. 
ERROR CCN3280 ./example.c:527 Function argument assignment between types "const char*" and "int" is not allowed. 
CCN0793(I) Compilation failed for file ./example.c. Object file not created. 
FSUM3065 The COMPILE step ended with return code 12. 
FSUM3017 Could not compile example.c. Correct the errors and try again. 
gmake: *** [example.o] Error 3 

當我逐漸取出FAR *(我認爲這是一個遠指針,但IM在

struct internal_state FAR *state; /* not visible by applications */ 

絆倒真的不是那麼肯定)錯誤消失了。但是,因爲這是一個圖書館,我不知道刪除它會產生什麼其他的文物。

有沒有人有任何想法?

任何舊的大型機都在那裏?

+0

這正是我不喜歡C/C++預處理器的原因。 – Malcolm 2009-06-30 08:44:44

回答

2

原來存在的zlib以前的版本上編譯USS,版本1.1.4或接近於此。它是一個後臺,但我認爲這是可行的,因爲它是在最新代碼中實現FAR指針之前。所以atm我認爲我的工作。

感謝您的全力幫助。

Regards

Mark。

1

FAR不是C89關鍵字,它是Microsoft/Intelism,可能是#defined某處。如果沒有,你需要將其定義爲無:

#define FAR 

但是,這可能只會解決許多問題之一。我猜測該庫使用某種形式的條件編譯來處理像FAR指針這樣的東西 - 您需要閱讀文檔以找到哪個配置最適合您的平臺。

1

我會使用xlc而不是c89,因爲xlc是您的系統默認編譯器,但您仍可能有問題。我會訂閱MVS-OE郵件列表,其中的人員非常有幫助。關於列表信息將顯示該鏈接現在是下來,請發送電子郵件至 [email protected] 與消息:INFO MVS-OE