kiwix / kiwix-tools

Command line Kiwix tools: kiwix-serve, kiwix-manage, ...
https://download.kiwix.org/release/kiwix-tools/
GNU General Public License v3.0
428 stars 83 forks source link

Can't compile kiwix-tools - deprecated warnings as errors #532

Closed juuz0 closed 2 years ago

juuz0 commented 2 years ago

Log

[1/8] Compiling C++ object src/reader/kiwix-read.p/kiwix-read.cpp.o
FAILED: src/reader/kiwix-read.p/kiwix-read.cpp.o 
c++ -Isrc/reader/kiwix-read.p -Isrc/reader -I../src/reader -I/usr/local/include/ -I/usr/local/include -I/usr/include/x86_64-linux-gnu -I/usr/include/p11-kit-1 -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -Werror -std=c++11 -g '-DKIWIX_TOOLS_VERSION="3.2.0"' -pthread -MD -MQ src/reader/kiwix-read.p/kiwix-read.cpp.o -MF src/reader/kiwix-read.p/kiwix-read.cpp.o.d -o src/reader/kiwix-read.p/kiwix-read.cpp.o -c ../src/reader/kiwix-read.cpp
../src/reader/kiwix-read.cpp: In function ‘int main(int, char**)’:
../src/reader/kiwix-read.cpp:83:38: error: ‘kiwix::Reader::Reader(std::string)’ is deprecated [-Werror=deprecated-declarations]
   83 |   reader = new kiwix::Reader(filePath);
      |                                      ^
In file included from ../src/reader/kiwix-read.cpp:21:
/usr/local/include/kiwix/reader.h:90:23: note: declared here
   90 |   explicit DEPRECATED Reader(const string zimFilePath);
      |                       ^~~~~~
cc1plus: all warnings being treated as errors
[2/8] Compiling C++ object src/searcher/kiwix-search.p/kiwix-search.cpp.o
FAILED: src/searcher/kiwix-search.p/kiwix-search.cpp.o 
c++ -Isrc/searcher/kiwix-search.p -Isrc/searcher -I../src/searcher -I/usr/local/include/ -I/usr/local/include -I/usr/include/x86_64-linux-gnu -I/usr/include/p11-kit-1 -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -Werror -std=c++11 -g '-DKIWIX_TOOLS_VERSION="3.2.0"' -pthread -MD -MQ src/searcher/kiwix-search.p/kiwix-search.cpp.o -MF src/searcher/kiwix-search.p/kiwix-search.cpp.o.d -o src/searcher/kiwix-search.p/kiwix-search.cpp.o -c ../src/searcher/kiwix-search.cpp
../src/searcher/kiwix-search.cpp: In function ‘int main(int, char**)’:
../src/searcher/kiwix-search.cpp:99:39: error: ‘kiwix::Reader::Reader(std::string)’ is deprecated [-Werror=deprecated-declarations]
   99 |     reader = new kiwix::Reader(zimPath);
      |                                       ^
In file included from ../src/searcher/kiwix-search.cpp:21:
/usr/local/include/kiwix/reader.h:90:23: note: declared here
   90 |   explicit DEPRECATED Reader(const string zimFilePath);
      |                       ^~~~~~
../src/searcher/kiwix-search.cpp:106:36: error: ‘kiwix::Searcher::Searcher()’ is deprecated [-Werror=deprecated-declarations]
  106 |     searcher = new kiwix::Searcher();
      |                                    ^
In file included from ../src/searcher/kiwix-search.cpp:22:
/usr/local/include/kiwix/searcher.h:68:14: note: declared here
   68 |   DEPRECATED Searcher();
      |              ^~~~~~~~
cc1plus: all warnings being treated as errors
kelson42 commented 2 years ago

@juuz0 These are warnings. This should not stop you to compile. This is strange that warnings are treated as error, I guess this is something related to your environement. Maybe you have -Werror in your CFLAGS env. variable? That said, what would be even better would be to adapt kiwix-tools to not use deprecated libkiwix API :)

veloman-yunkan commented 2 years ago

@juuz0 Your kiwix-tools is old. See https://github.com/kiwix/kiwix-tools/pull/520