0

Thanks for looking

I trying to create a class

long lPrime,lGenerator;
    lPrime = atol(vOut[1].c_str());
ZZ alicePrime;
    alicePrime = new ZZ(99999,lPrime);

I not sure what does INIT_VAL_TYPE asking me to input.

I got this error:

UDPEchoClient.cpp:85:34: error: no matching function for call to ‘NTL::ZZ::ZZ(int, long int&)’
UDPEchoClient.cpp:85:34: note: candidates are:
/sw/include/NTL/ZZ.h:113:1: note: NTL::ZZ::ZZ(NTL::ZZ&, NTL::INIT_TRANS_TYPE)
/sw/include/NTL/ZZ.h:113:1: note:   no known conversion for argument 1 from ‘int’ to ‘NTL::ZZ&’
/sw/include/NTL/ZZ.h:176:8: note: NTL::ZZ::ZZ(NTL::INIT_VAL_TYPE, double)
/sw/include/NTL/ZZ.h:176:8: note:   no known conversion for argument 1 from ‘int’ to ‘NTL::INIT_VAL_TYPE {aka const NTL::INIT_VAL_STRUCT&}’
/sw/include/NTL/ZZ.h:180:8: note: NTL::ZZ::ZZ(NTL::INIT_VAL_TYPE, float)
/sw/include/NTL/ZZ.h:180:8: note:   no known conversion for argument 1 from ‘int’ to ‘NTL::INIT_VAL_TYPE {aka const NTL::INIT_VAL_STRUCT&}’
/sw/include/NTL/ZZ.h:172:8: note: NTL::ZZ::ZZ(NTL::INIT_VAL_TYPE, const char*)
/sw/include/NTL/ZZ.h:172:8: note:   no known conversion for argument 1 from ‘int’ to ‘NTL::INIT_VAL_TYPE {aka const NTL::INIT_VAL_STRUCT&}’
/sw/include/NTL/ZZ.h:61:1: note: NTL::ZZ::ZZ(NTL::INIT_VAL_TYPE, unsigned int)
/sw/include/NTL/ZZ.h:61:1: note:   no known conversion for argument 1 from ‘int’ to ‘NTL::INIT_VAL_TYPE {aka const NTL::INIT_VAL_STRUCT&}’
/sw/include/NTL/ZZ.h:60:1: note: NTL::ZZ::ZZ(NTL::INIT_VAL_TYPE, long unsigned int)
/sw/include/NTL/ZZ.h:60:1: note:   no known conversion for argument 1 from ‘int’ to ‘NTL::INIT_VAL_TYPE {aka const NTL::INIT_VAL_STRUCT&}’
/sw/include/NTL/ZZ.h:58:1: note: NTL::ZZ::ZZ(NTL::INIT_VAL_TYPE, int)
/sw/include/NTL/ZZ.h:58:1: note:   no known conversion for argument 1 from ‘int’ to ‘NTL::INIT_VAL_TYPE {aka const NTL::INIT_VAL_STRUCT&}’
/sw/include/NTL/ZZ.h:57:1: note: NTL::ZZ::ZZ(NTL::INIT_VAL_TYPE, long int)
/sw/include/NTL/ZZ.h:57:1: note:   no known conversion for argument 1 from ‘int’ to ‘NTL::INIT_VAL_TYPE {aka const NTL::INIT_VAL_STRUCT&}’
/sw/include/NTL/ZZ.h:49:1: note: NTL::ZZ::ZZ(const NTL::ZZ&)
/sw/include/NTL/ZZ.h:49:1: note:   candidate expects 1 argument, 2 provided
/sw/include/NTL/ZZ.h:37:1: note: NTL::ZZ::ZZ(NTL::INIT_SIZE_TYPE, long int)
/sw/include/NTL/ZZ.h:37:1: note:   no known conversion for argument 1 from ‘int’ to ‘NTL::INIT_SIZE_TYPE {aka const NTL::INIT_SIZE_STRUCT&}’
/sw/include/NTL/ZZ.h:33:1: note: NTL::ZZ::ZZ()
/sw/include/NTL/ZZ.h:33:1: note:   candidate expects 0 arguments, 2 provided
user1777711
  • 1,604
  • 6
  • 22
  • 32

1 Answers1

0

Firstly new is wrong. You aren't allocating an object, you are constructing an object.

Secondly, assuming I'm reading the header file right, and assuming I understand what you are trying to do, you just want

ZZ alicePrime(INIT_VAL, lPrime);

INTI_VAL is just a constant that forces the compile to choose the constructor that gives alicePrime an initial value, instead of, say, an initial bit size.

NTL documentation is poor.

john
  • 85,011
  • 4
  • 57
  • 81