sakhnik / gpwsafe

pwsafe reimplementation compatible with recent PasswordSafe
9 stars 3 forks source link

can't seem to compile #6

Closed gsker closed 9 years ago

gsker commented 9 years ago

I'm unable to compile. Running Ubuntu 14.10. Suggestions would be welcome.

/tmp/gpwsafe-0.20.1/src/CommandList.cc: In member function ‘virtual void gPWS::CommandList::Execute(const gPWS::Command::Params&)’:
/tmp/gpwsafe-0.20.1/src/CommandList.cc:71:33: error: parameter declared ‘auto’
                  [](const auto &a, const auto &b)
                                 ^
/tmp/gpwsafe-0.20.1/src/CommandList.cc:71:48: error: parameter declared ‘auto’
                  [](const auto &a, const auto &b)
                                                ^
/tmp/gpwsafe-0.20.1/src/CommandList.cc: In lambda function:
/tmp/gpwsafe-0.20.1/src/CommandList.cc:73:29: error: ‘a’ was not declared in this scope
                      return a->first.size() < b->first.size();
                             ^
/tmp/gpwsafe-0.20.1/src/CommandList.cc:73:47: error: ‘b’ was not declared in this scope
                      return a->first.size() < b->first.size();
                                               ^
In file included from /usr/include/c++/4.8/algorithm:62:0,
                 from /usr/include/boost/pool/pool.hpp:25,
                 from /usr/include/boost/pool/singleton_pool.hpp:25,
                 from /usr/include/boost/pool/pool_alloc.hpp:78,
                 from /tmp/gpwsafe-0.20.1/src/Memory.hh:25,
                 from /tmp/gpwsafe-0.20.1/src/Defs.hh:24,
                 from /tmp/gpwsafe-0.20.1/src/IEmitter.hh:24,
                 from /tmp/gpwsafe-0.20.1/src/Command.hh:24,
                 from /tmp/gpwsafe-0.20.1/src/CommandList.hh:25,
                 from /tmp/gpwsafe-0.20.1/src/CommandList.cc:22:
/usr/include/c++/4.8/bits/stl_algo.h: In instantiation of ‘_FIter std::max_element(_FIter, _FIter, _Compare) [with _FIter = __gnu_cxx::__normal_iterator<std::_Rb_tree_const_iterator<std::pair<const std::basic_string<char, std::char_traits<char>, gPWS::SecureAllocator<char> >, std::shared_ptrgPWS::Entry > >_, std::vector<std::_Rb_tree_const_iterator<std::pair<const std::basic_string<char, std::char_traits<char>, gPWS::SecureAllocator<char> >, std::shared_ptrgPWS::Entry > > > >; _Compare = gPWS::CommandList::Execute(const gPWS::Command::Params&)::__lambda0]’:
/tmp/gpwsafe-0.20.1/src/CommandList.cc:74:19:   required from here
/usr/include/c++/4.8/bits/stl_algo.h:6316:32: error: no match for call to ‘(gPWS::CommandList::Execute(const gPWS::Command::Params&)::__lambda0) (std::_Rb_tree_const_iterator<std::pair<const std::basic_string<char, std::char_traits<char>, gPWS::SecureAllocator<char> >, std::shared_ptrgPWS::Entry > >&, std::_Rb_tree_const_iterator<std::pair<const std::basic_string<char, std::char_traits<char>, gPWS::SecureAllocator<char> >, std::shared_ptrgPWS::Entry > >&)’
  if (__comp(___result, ___first))
                                ^
/tmp/gpwsafe-0.20.1/src/CommandList.cc:71:19: note: candidates are:
                  [](const auto &a, const auto &b)
                   ^
In file included from /usr/include/c++/4.8/algorithm:62:0,
                 from /usr/include/boost/pool/pool.hpp:25,
                 from /usr/include/boost/pool/singleton_pool.hpp:25,
                 from /usr/include/boost/pool/pool_alloc.hpp:78,
                 from /tmp/gpwsafe-0.20.1/src/Memory.hh:25,
                 from /tmp/gpwsafe-0.20.1/src/Defs.hh:24,
                 from /tmp/gpwsafe-0.20.1/src/IEmitter.hh:24,
                 from /tmp/gpwsafe-0.20.1/src/Command.hh:24,
                 from /tmp/gpwsafe-0.20.1/src/CommandList.hh:25,
                 from /tmp/gpwsafe-0.20.1/src/CommandList.cc:22:
/usr/include/c++/4.8/bits/stl_algo.h:6316:32: note: void (_)() <conversion>
  if (__comp(___result, *__first))
                                ^
/usr/include/c++/4.8/bits/stl_algo.h:6316:32: note:   candidate expects 1 argument, 3 provided
/tmp/gpwsafe-0.20.1/src/CommandList.cc:71:49: note: gPWS::CommandList::Execute(const gPWS::Command::Params&)::__lambda0
                  [](const auto &a, const auto &b)
                                                 ^
/tmp/gpwsafe-0.20.1/src/CommandList.cc:71:49: note:   candidate expects 0 arguments, 2 provided
make[2]: *_\* [src/CMakeFiles/gpwsafe.dir/CommandList.cc.o] Error 1
make[1]: **\* [src/CMakeFiles/gpwsafe.dir/all] Error 2
make: **\* [all] Error 2
sakhnik commented 9 years ago

Thank you for the report! The code clearly uses newer features of C++14. Is it possible to get gcc-4.9 in Ubuntu-14.10? We could implement a more detailed check of compiler features in the build scripts.

gsker commented 9 years ago

As I said in my report, I did try gcc-4.9. I did leave out a word there, though. Sorry for the confusion. I'm trying it again, though. I'll post when I know. What distro are you using that comes with 4.9?

Edit: I must not have installed gcc-4.9 correctly last time. I re-installed and compiled and it worked.

sakhnik commented 9 years ago

I use Arch linux, which ships the latest versions of software. Another reason was to try out some features of the latest C++14. It seemed harmless to me to encourage people to look forward.

I'm sorry for the temporary inconvenience, closing the ticket.