Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make examples error #80

Open
thucgn opened this issue Aug 26, 2020 · 1 comment
Open

Make examples error #80

thucgn opened this issue Aug 26, 2020 · 1 comment

Comments

@thucgn
Copy link

thucgn commented Aug 26, 2020

error when cd examples && make

In file included from /usr/include/x86_64-linux-gnu/c++/7/bits/c++allocator.h:33:0,
                 from /usr/include/c++/7/bits/allocator.h:46,
                 from /usr/include/c++/7/string:41,
                 from /usr/include/c++/7/bits/locale_classes.h:40,
                 from /usr/include/c++/7/bits/ios_base.h:41,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/istream:38,
                 from /usr/include/boost/random/additive_combine.hpp:19,
                 from /usr/include/boost/random.hpp:36,
                 from /home/g/install/libscapi-master/examples/Commitment/../../include/interactive_mid_protocols/../infra/Common.hpp:33,
                 from /home/g/install/libscapi-master/examples/Commitment/../../include/interactive_mid_protocols/RandomValue.hpp:30,
                 from /home/g/install/libscapi-master/examples/Commitment/../../include/interactive_mid_protocols/CommitmentScheme.hpp:29,
                 from /home/g/install/libscapi-master/examples/Commitment/CommitmentExample.hpp:30,
                 from /home/g/install/libscapi-master/examples/Commitment/CommitmentExample.cpp:29:
/usr/include/c++/7/ext/new_allocator.h: In instantiation of ‘void __gnu_cxx::new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = CmtSimpleHashCommitter; _Args = {std::shared_ptr<CommParty>&}; _Tp = CmtSimpleHashCommitter]’:
/usr/include/c++/7/bits/alloc_traits.h:475:4:   required from ‘static void std::allocator_traits<std::allocator<_CharT> >::construct(std::allocator_traits<std::allocator<_CharT> >::allocator_type&, _Up*, _Args&& ...) [with _Up = CmtSimpleHashCommitter; _Args = {std::shared_ptr<CommParty>&}; _Tp = CmtSimpleHashCommitter; std::allocator_traits<std::allocator<_CharT> >::allocator_type = std::allocator<CmtSimpleHashCommitter>]’
/usr/include/c++/7/bits/shared_ptr_base.h:526:39:   required from ‘std::_Sp_counted_ptr_inplace<_Tp, _Alloc, _Lp>::_Sp_counted_ptr_inplace(_Alloc, _Args&& ...) [with _Args = {std::shared_ptr<CommParty>&}; _Tp = CmtSimpleHashCommitter; _Alloc = std::allocator<CmtSimpleHashCommitter>; __gnu_cxx::_Lock_policy _Lp = (__gnu_cxx::_Lock_policy)2]’
/usr/include/c++/7/bits/shared_ptr_base.h:637:4:   required from ‘std::__shared_count<_Lp>::__shared_count(std::_Sp_make_shared_tag, _Tp*, const _Alloc&, _Args&& ...) [with _Tp = CmtSimpleHashCommitter; _Alloc = std::allocator<CmtSimpleHashCommitter>; _Args = {std::shared_ptr<CommParty>&}; __gnu_cxx::_Lock_policy _Lp = (__gnu_cxx::_Lock_policy)2]’
/usr/include/c++/7/bits/shared_ptr_base.h:1295:35:   required from ‘std::__shared_ptr<_Tp, _Lp>::__shared_ptr(std::_Sp_make_shared_tag, const _Alloc&, _Args&& ...) [with _Alloc = std::allocator<CmtSimpleHashCommitter>; _Args = {std::shared_ptr<CommParty>&}; _Tp = CmtSimpleHashCommitter; __gnu_cxx::_Lock_policy _Lp = (__gnu_cxx::_Lock_policy)2]’
/usr/include/c++/7/bits/shared_ptr.h:344:64:   required from ‘std::shared_ptr<_Tp>::shared_ptr(std::_Sp_make_shared_tag, const _Alloc&, _Args&& ...) [with _Alloc = std::allocator<CmtSimpleHashCommitter>; _Args = {std::shared_ptr<CommParty>&}; _Tp = CmtSimpleHashCommitter]’
/usr/include/c++/7/bits/shared_ptr.h:690:14:   required from ‘std::shared_ptr<_Tp> std::allocate_shared(const _Alloc&, _Args&& ...) [with _Tp = CmtSimpleHashCommitter; _Alloc = std::allocator<CmtSimpleHashCommitter>; _Args = {std::shared_ptr<CommParty>&}]’
/usr/include/c++/7/bits/shared_ptr.h:706:39:   required from ‘std::shared_ptr<_Tp> std::make_shared(_Args&& ...) [with _Tp = CmtSimpleHashCommitter; _Args = {std::shared_ptr<CommParty>&}]’
/home/g/install/libscapi-master/examples/Commitment/CommitmentExample.cpp:63:52:   required from here
/usr/include/c++/7/ext/new_allocator.h:136:4: error: invalid new-expression of abstract class type ‘CmtSimpleHashCommitter’ 
  { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
In file included from /home/gw/install/libscapi-master/examples/Commitment/CommitmentExample.hpp:37:0,
                 from /home/gw/install/libscapi-master/examples/Commitment/CommitmentExample.cpp:29:
/home/gw/install/libscapi-master/examples/Commitment/../../include/interactive_mid_protocols/CommitmentSchemeEquivocal.hpp:43:7: note:   because the following virtual functions are pure within ‘CmtEquivocalCommitter’:
 class CmtEquivocalCommitter : public CmtCommitter, public EquivocalCmt {
       ^~~~~~~~~~~~~~~~~~~~~
In file included from /home/gw/install/libscapi-master/examples/Commitment/CommitmentExample.hpp:30:0,
                 from /home/gw/install/libscapi-master/examples/Commitment/CommitmentExample.cpp:29:
/home/gw/install/libscapi-master/examples/Commitment/../../include/interactive_mid_protocols/CommitmentScheme.hpp:360:40: note:         virtual std::shared_ptr<CmtCCommitmentMsg> CmtCommitter::generateCommitmentMsg(const std::shared_ptr<CmtCommitValue>&, biginteger, long int)
  virtual shared_ptr<CmtCCommitmentMsg> generateCommitmentMsg(const shared_ptr<CmtCommitValue> & input, biginteger r, long id) = 0;
                                        ^~~~~~~~~~~~~~~~~~~~~
CMakeFiles/libscapi_example.dir/build.make:107: recipe for target 'CMakeFiles/libscapi_example.dir/Commitment/CommitmentExample.cpp.o' failed

Machine details

  • ubuntu 18.04
  • gcc 7.5
  • boost 1.71.0, and I tried boost 1.69.0, but the error remains.

Thank You

@thucgn
Copy link
Author

thucgn commented Aug 26, 2020

I may found the problems.
A pure virtual function **virtual shared_ptr generateCommitmentMsg(const shared_ptr & input, biginteger r, long id) = 0 ** was added to the declaration of CmtCommiter for an extra parameter, but the original Equivocal didn't override the function. Solution can be adding a definition(just throw error) in CmtEquivocalCommiter, or just move the pure virtual tag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant