Reputation: 94
I'm having problems when trying to build it on Windows 10 x64.
My environ is
MingGW 3.20
CMake 3.3.0
libzip-1.0.1
What I did was download the project in libzip site, open to CLion IDE (last version) and try to compile.
The entire build process with errors, can be found in the link. http://pastebin.com/KTPtm5z3
A number of undeclared variables appears as error:
error: 'EOPNOTSUPP' undeclared (first use in this function)
What is causing this problem and why ?
I can compile the library version libzip without any problem in this repository mirror repo libzip v0.9, but I want to the latest version of libzip.
Upvotes: 0
Views: 6579
Reputation: 7164
The libzip developers have been made aware of this question but seem to be troubled with finding the right fix as neither of them is very familiar with Windows or MinGW: http://nih.at/listarchive/libzip-discuss/msg00559.html
I'm not familiar with either myself but was recently able to successfully compile libzip on Windows 7 (without MinGW) using this answer (also see my comment to that answer): https://stackoverflow.com/a/30245321/784669
Finally, since you might want to get things running right now, try to do the following:
swprintf
in lib/zip_source_win32w.c
, line 36, try to just delete the second argument to the function len
as your compiler seems to assume an older version of swprintf
GetFileSizeEx
(credit: https://sourceforge.net/p/tdm-gcc/bugs/250/):_
bool GetFileSizeEx(HANDLE hFile, PLARGE_INTEGER fsize){
LPDWORD tSize;
DWORD t = fsize->HighPart;
*tSize = t;
int ret = GetFileSize(hFile, tSize);
fsize->HighPart = *tSize;
delete tSize;
return ret;
}
GetFileSizeEx
from stackoverflow: https://stackoverflow.com/a/28028376/784669 So the problem might be your Windows version. Indeed in winbase.h
it says to only define GetFileSizeEx
if _WIN32_WINNT >= 0x0500
. Maybe your Windows version is too old or you need to:_
#define _WIN32_WINNT 0x0500
Good luck!
Upvotes: 1