我正在構建一個拉鍊應用程序,但它有一個聲明,我想將它分離到另一個文件(compress-file.m)中,但僅當我分開文件時出現錯誤時具有可變編譯,看到它:將要組織的分離代碼
[[email protected]:~/Desktop] make
This is gnustep-make 2.0.2. Type 'make print-gnustep-make-help' for help.
Making all for app LeafZip...
Creating LeafZip.app/....
Compiling file main.m ...
main.m: In function ‘main’:
main.m:7: error: ‘PATH_MAX’ undeclared (first use in this function)
main.m:7: error: (Each undeclared identifier is reported only once
main.m:7: error: for each function it appears in.)
main.m:12: warning: implicit declaration of function ‘compressFile’
main.m:7: warning: unused variable ‘outFileName’
make[1]: *** [obj/main.o] Error 1
make: *** [LeafZip.all.app.variables] Error 2
另見main.m文件的第7行:
char outFileName[PATH_MAX] = { 0 };
而看到壓縮-file.m的一些線路:
#include <stdio.h>
#include <zlib.h>
#include <limits.h>
/* Buffer to hold data read */
char buf[BUFSIZ] = { 0 };
size_t bytes_read = 0;
gzFile *out = gzopen(outFileName, "wb");
我知道這是Objective-C擴展,但這只是因爲當我解決這個問題時,我需要繼續在Objective-C中進行開發。 我需要做些什麼來糾正這個問題?
而你的問題是 – 2009-10-28 20:31:08