|
Please help me; I have a .asn1 file with the following types: McMsisdn ::= OCTET STRING
(SIZE(3..20)); I’m using eSNACC 1.7 with patch 1.7.4 with Red Hat
Enterprise Linux 4, g++ (GCC) 3.4.3 20041212 (Red Hat 3.4.3-9.EL4). I ran esnacc to obtain the .h and .cpp files. In another
file I wrote my application with the following calls: char myBuffer[] =
{0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x31,0x32,0x33,0x34,0x35}; size_t sizeBuffer = sizeof(myBuffer); McMsisdn myMcMsisdn(myBuffer,sizeBuffer); When I compile it produces an error: /tmp/ccxwGq5g.o(.gnu.linkonce.t._ZN5SNACC8McMsisdnD1Ev+0xb):
In function `SNACC::McMsisdn::~McMsisdn()': : undefined reference to `vtable for
SNACC::McMsisdn' /tmp/ccxwGq5g.o(.gnu.linkonce.t._ZN5SNACC8McMsisdnC1EPKcj+0x1f):
In function `SNACC::McMsisdn::McMsisdn(char const*, unsigned int)': : undefined reference to `vtable for
SNACC::McMsisdn' collect2: ld returned 1 exit status I read a lot and tried to find the solution myself but in
the gcc documentation explain about virtual functions, etc. etc. I think that
is not the problem, I am not sure. The declaration of my class generated by esnacc is the
following /* OCTET STRING SIZE 3..20 */ class McMsisdn: public AsnOcts { public: McMsisdn ():AsnOcts() {
} McMsisdn
(const char *str):AsnOcts(str) { } McMsisdn
(const char *str, const size_t len):AsnOcts(str, len) { } McMsisdn
(const McMsisdn &o):AsnOcts(o){ } const SizeConstraint*
SizeConstraints(int &sizeList)const; McMsisdn
&operator = (const AsnOcts &o) {
SetEqual(o); return *this;} McMsisdn
&operator = (const char *str) {
SetEqual(str); return *this; } }; When I comment the function “const SizeConstraint*
SizeConstraints(int &sizeList)const;” my application compile fine,
but I think that It is necessary to handle the maximum an minimum size of the
types. I don’t understand why this error. I need your help,
please. Andrés Fuentes |