List Archive

Thread

Thread Index

Message

From: "Peter Bohning" <peter.bohning%gmx.com@localhost>
To: libzip-discuss%nih.at@localhost
Subject: mingw errors 1.3.0 1.4.0
Date: Wed, 3 Jan 2018 21:43:05 +0100

I'm having a hell of a time compiling this.  Is there a non-cmake version out there?
 
I got this compiled and running with mingw and wrote some software with it some six months ago, but my motherboard failed and now I have to set everything up again.
 
I had libzip-1.3.0 source but it won't compile, and libzip-1.4.0 uses this cmake garbage.  And I try to get cmake and it's this huge thing to compile it and I keep thinking, if all the compilers work to throw this together, why not fix them, fix Make and configure... not put this whole cmake thing together and force people to install it and learn whatever nuances and, it's so tiring...
 
but then cmake won't compile, there's a C++ missing cast, and I fix that, but then it crashes, like segmentation faults and dumps a lot of garbage and then there's some undefined reference to InterlockedOr... and I just... I don't understand why I can't just use Make.
 
But libzip-1.3.0 gives me the following:
 
/bin/sh ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..  -I./gladman-fcrypt  -fvisibility=hidden -g -O2 -I/usr/local/include -MT libzip_la-zip_random_win32.lo -MD -MP -MF .deps/libzip_la-zip_random_win32.Tpo -c -o libzip_la-zip_random_win32.lo `test -f 'zip_random_win32.c' || echo './'`zip_random_win32.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I./gladman-fcrypt -fvisibility=hidden -g -O2 -I/usr/local/include -MT libzip_la-zip_random_win32.lo -MD -MP -MF .deps/libzip_la-zip_random_win32.Tpo -c zip_random_win32.c  -DDLL_EXPORT -DPIC -o .libs/libzip_la-zip_random_win32.o
In file included from zip.h:62:0,
                 from zipint.h:49,
                 from zip_random_win32.c:34:
c:\mingw\include\stdio.h:345:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__mingw__snprintf'
 extern int __mingw_stdio_redirect__(snprintf)(char*, size_t, const char*, ...);
            ^
In file included from zip_random_win32.c:35:0:
zipwin32.h:38:0: warning: "_WIN32_WINNT" redefined
 #define _WIN32_WINNT 0x0501
In file included from c:\mingw\include\w32api.h:59:0,
                 from c:\mingw\include\_mingw.h:73,
                 from c:\mingw\include\io.h:51,
                 from compat.h:47,
                 from zipint.h:41,
                 from zip_random_win32.c:34:
c:\mingw\include\sdkddkver.h:185:0: note: this is the location of the previous definition
 #  define _WIN32_WINNT _WIN32_WINNT_WIN2K
zip_random_win32.c: In function 'zip_random':
zip_random_win32.c:40:5: error: unknown type name 'HCRYPTPROV'
zip_random_win32.c:41:10: warning: implicit declaration of function 'CryptAcquireContext' [-Wimplicit-function-declaration]
     if (!CryptAcquireContext(&hprov, NULL, NULL, PROV_RSA_AES, CRYPT_VERIFYCONTEXT | CRYPT_SILENT)) {
          ^~~~~~~~~~~~~~~~~~~
zip_random_win32.c:41:50: error: 'PROV_RSA_AES' undeclared (first use in this function)
     if (!CryptAcquireContext(&hprov, NULL, NULL, PROV_RSA_AES, CRYPT_VERIFYCONTEXT | CRYPT_SILENT)) {
                                                  ^~~~~~~~~~~~
zip_random_win32.c:41:50: note: each undeclared identifier is reported only once for each function it appears in
zip_random_win32.c:41:64: error: 'CRYPT_VERIFYCONTEXT' undeclared (first use in this function)
     if (!CryptAcquireContext(&hprov, NULL, NULL, PROV_RSA_AES, CRYPT_VERIFYCONTEXT | CRYPT_SILENT)) {
                                                                ^~~~~~~~~~~~~~~~~~~
zip_random_win32.c:41:86: error: 'CRYPT_SILENT' undeclared (first use in this function)
     if (!CryptAcquireContext(&hprov, NULL, NULL, PROV_RSA_AES, CRYPT_VERIFYCONTEXT | CRYPT_SILENT)) {
                                                                                      ^~~~~~~~~~~~
zip_random_win32.c:44:10: warning: implicit declaration of function 'CryptGenRandom' [-Wimplicit-function-declaration]
     if (!CryptGenRandom(hprov, length, buffer)) {
          ^~~~~~~~~~~~~~
zip_random_win32.c:47:10: warning: implicit declaration of function 'CryptReleaseContext' [-Wimplicit-function-declaration]
     if (!CryptReleaseContext(hprov, 0)) {
          ^~~~~~~~~~~~~~~~~~~
make[4]: *** [libzip_la-zip_random_win32.lo] Error 1

Made by MHonArc.