Jump to content

MFH

Members
  • Posts

    1
  • Joined

  • Last visited

Posts posted by MFH

  1. On 7/9/2018 at 2:40 PM, hisoka said:

    OK , I read them as you told me . and in the README file it is mentioned how to compile it . Now , however , I have another problem which is more complicated than the first :

    During the building process in cygwin , I got this error :

    (...snip...)
    gcc -O3  -c -o zutil.o zutil.c
    gcc -O3  -c -o compress.o compress.c
    gcc -O3  -c -o uncompr.o uncompr.c
    gcc -O3  -c -o gzclose.o gzclose.c
    gcc -O3  -c -o gzlib.o gzlib.c
    gzlib.c: In function ‘gz_open’:
    gzlib.c:243:20: warning: implicit declaration of function ‘_wopen’; did you mean  ‘fwopen’? [-Wimplicit-function-declaration]
             fd == -2 ? _wopen(path, oflag, 0666) :
                        ^~~~~~
                        fwopen
    gcc -O3  -c -o gzread.o gzread.c
    gcc -O3  -c -o gzwrite.o gzwrite.c
    ar rc libz.a adler32.o crc32.o deflate.o infback.o inffast.o inflate.o inftrees.     o trees.o zutil.o compress.o uncompr.o gzclose.o gzlib.o gzread.o gzwrite.o
    gcc -O3 -o example.exe example.o -L. libz.a
    libz.a(gzlib.o):gzlib.c:(.text+0xab2): undefined reference to `_wopen'
    libz.a(gzlib.o):gzlib.c:(.text+0xab2): relocation truncated to fit: R_X86_64_PC3  2 against undefined symbol `_wopen'
    libz.a(gzlib.o):gzlib.c:(.text+0xc50): undefined reference to `_wopen'
    libz.a(gzlib.o):gzlib.c:(.text+0xc50): relocation truncated to fit: R_X86_64_PC3  2 against undefined symbol `_wopen'
    collect2: error: ld returned 1 exit status
    make: *** [Makefile:289: example.exe] Error 1

    I got the same problem, the following command fixed it:

    $ cd /tmp/zlib-1.2.11                                                                       
    $ sed -i 's/defined(_WIN32) || defined(__CYGWIN__)/defined(_WIN32)/g' gzguts.h                         

    HTH!

×
×
  • Create New...