commonsmachinery / hmsearch

C++ implementation of hamming distance algorithm HmSearch using Kyoto Cabinet
MIT License
42 stars 12 forks source link

compilation error #11

Open patatetom opened 6 years ago

patatetom commented 6 years ago

hello,

hmsearch no longer compile under linux 4.9.75-1-lts with g++ 7.2.1 and kyotocabinet 1.2.76 :

hmsearch-master $ LANG=us make
g++ -g -Wall -D_FILE_OFFSET_BITS=64   -c -o hmsearch.o hmsearch.cc
In file included from hmsearch.cc:15:0:
/usr/include/kcdbext.h: In member function 'char* kyotocabinet::IndexDB::get(const char*, size_t, size_t*)':
/usr/include/kcdbext.h:1281:14: error: cannot convert 'bool' to 'char*' in return
       return false;
              ^~~~~
hmsearch.cc: In static member function 'static bool HmSearch::init(const string&, unsigned int, unsigned int, uint64_t, std::__cxx11::string*)':
hmsearch.cc:120:10: warning: 'template<class> class std::auto_ptr' is deprecated [-Wdeprecated-declarations]
     std::auto_ptr<kyotocabinet::HashDB> db(new kyotocabinet::HashDB);
          ^~~~~~~~
In file included from /usr/include/c++/7.2.1/memory:80:0,
                 from hmsearch.cc:12:
/usr/include/c++/7.2.1/bits/unique_ptr.h:51:28: note: declared here
   template<typename> class auto_ptr;
                            ^~~~~~~~
hmsearch.cc: In static member function 'static HmSearch* HmSearch::open(const string&, HmSearch::OpenMode, std::__cxx11::string*)':
hmsearch.cc:188:10: warning: 'template<class> class std::auto_ptr' is deprecated [-Wdeprecated-declarations]
     std::auto_ptr<kyotocabinet::PolyDB> db(new kyotocabinet::PolyDB);
          ^~~~~~~~
In file included from /usr/include/c++/7.2.1/memory:80:0,
                 from hmsearch.cc:12:
/usr/include/c++/7.2.1/bits/unique_ptr.h:51:28: note: declared here
   template<typename> class auto_ptr;
                            ^~~~~~~~
make: *** [<builtin>: hmsearch.o] Error 1

regards, lacsaP.

artfwo commented 6 years ago

@patatetom apparently kyotocabinet fails to build with GCC 6 and above, but this bug is fixed at least in Debian and Fedora. Could you check if your distribution package of kyotocabinet is up to date?

patatetom commented 6 years ago

according to the pkgbuild, I think the patch is not built in : I'm gonna get closer to the maintainer. thanks Artem.