scarsty / kys-cpp

《金庸群侠传》c++复刻版,已完工
BSD 3-Clause "New" or "Revised" License
2.58k stars 372 forks source link

Can not build object file "Zip.cpp.o" duing to "dos_date" on Arch Linux #5

Closed ghost closed 6 years ago

ghost commented 6 years ago

Hi there,

I can't quite find out that how to build certain object files of this game on Linux. Could you please provide a more detail instructions?

Here are the logs I found from console:

[ 88%] Building CXX object CMakeFiles/kys.dir/Zip.cpp.o
/usr/bin/c++   -I/home/foobar/kys-cpp-git/kys-cpp/src/../include -I/home/foobar/kys-cpp-git/kys-cpp/src/. -I/home/foobar/kys-cpp-git/kys-cpp/src/./others  -O3 -std=c++11 -pthread   -o CMakeFiles/kys.dir/Zip.cpp.o -c /home/foobar/kys-cpp-git/kys-cpp/src/Zip.cpp
/home/foobar/kys-cpp-git/kys-cpp/src/Zip.cpp: In static member function 'static int Zip::zip(std::__cxx11::string, std::vector<std::__cxx11::basic_string<char> >)':
/home/foobar/kys-cpp-git/kys-cpp/src/Zip.cpp:31:45: error: 'struct zip_fileinfo' has no member named 'dos_date'; did you mean 'dosDate'?
         get_file_date(zip_file.c_str(), &zi.dos_date);
                                             ^~~~~~~~
                                             dosDate
/home/foobar/kys-cpp-git/kys-cpp/src/Zip.cpp: In static member function 'static int Zip::unzip(std::__cxx11::string, std::vector<std::__cxx11::basic_string<char> >)':
/home/foobar/kys-cpp-git/kys-cpp/src/Zip.cpp:49:54: warning: passing NULL to non-pointer argument 3 of 'int unzLocateFile(unzFile, const char*, int)' [-Wconversion-null]
         if (unzLocateFile(zip, filename.c_str(), NULL) != UNZ_OK)
                                                      ^
make[2]: *** [CMakeFiles/kys.dir/build.make:573: CMakeFiles/kys.dir/Zip.cpp.o] Error 1
make[2]: Leaving directory '/home/foobar/kys-cpp-git/kys-cpp/src'
make[1]: *** [CMakeFiles/Makefile2:71: CMakeFiles/kys.dir/all] Error 2
make[1]: Leaving directory '/home/foobar/kys-cpp-git/kys-cpp/src'
make: *** [Makefile:87: all] Error 2

Whereas "error: 'struct zip_fileinfo' has no member named 'dos_date'" , I found that the "dos_date" was defined in "src/others/minishared.c" and declared in "src/others/minishared.h",

Any ideas how I can resolve this ?

Target: x86_64-pc-linux-gnu
Thread model: posix
gcc version 8.1.1 20180531 (GCC)
cmake 3.11.4
minizip 1.2.11

Thanks, -Lin

scarsty commented 6 years ago

这里看起来是使用的接口不一样,需要一两天换成zlib的。或者你暂时注释掉那行也行,因为压缩部分没有使用过。

ghost commented 6 years ago

Thanks for your help ! Issue closed for https://github.com/scarsty/kys-cpp/commit/115b27b8a7e685c07fe2e533b781e0737fe14f07