The International Simutrans Forum

 

Author Topic: about the function "gzFile" from libz / zlib update.  (Read 2995 times)

0 Members and 1 Guest are viewing this topic.

darkbill

  • Guest
about the function "gzFile" from libz / zlib update.
« on: March 19, 2012, 12:25:54 PM »
I try to git the codes for GIT server and compile it. But I failed with the message below.

Code: [Select]
===> CXX dataobj/loadsave.cc
dataobj/loadsave.cc: In member function ‘bool loadsave_t::rd_open(const char*)’:
dataobj/loadsave.cc:87:21: error: cannot convert ‘FILE* {aka _IO_FILE*}’ to ‘gzFile’ for argument ‘1’ to ‘char* gzgets(gzFile, char*, int)’
dataobj/loadsave.cc: In member function ‘const char* loadsave_t::close()’:
.......
dataobj/loadsave.cc: In member function ‘bool loadsave_t::is_eof()’:
......
dataobj/loadsave.cc: In member function ‘int loadsave_t::lsgetc()’:
dataobj/loadsave.cc:358:10: error: ‘FILE’ has no member named ‘have’
.....

My computer is Archlinux x86_64, and I tried to google the problem and get the nearly message below from bbs.archlinux.org from another pack.
Code: [Select]
Hello

its due to zlib-1.2.6....

There is a change in zlib.h

-   typedef voidp gzFile;       /* opaque gzip file descriptor */
+ typedef struct gzFile_s *gzFile;    /* semi-opaque gzip file descriptor */

since gzFile is changed from void * to gzFile_s *, implicit casting from FILE * to gzFile_s * will not work
https://bbs.archlinux.org/viewtopic.php?id=136269

Now I am not sure whether it will lead a bug to the executable binaries with zlib-1.2.6 installed. I will test it later.

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4586
  • Languages: EN, DE, AT
Re: about the function "gzFile" from libz / zlib update.
« Reply #1 on: March 19, 2012, 04:07:05 PM »
this was fixed in simutrans standard some time ago, but obviously not merged into the branch you are compiling.