Strange compiler error Dev-C++ 4.9.9.1

2012-09-07
2012-09-26
  • Johan Erlank
    Johan Erlank
    2012-09-07

    I'm trying to do the following:

    In a class, I define a struct as
    class Txn
    {
    public:
    static unsigned char ucName;
    static unsigned char ucSurname;

    struct TXN
    {
    unsigned int iPosition;
    unsigned char *ucElement;
    };

    struct TXN TxnData;

    ...

    };

    in my .cpp file:

    struct Txn::TXN Txn::TxnData =
    {
    { 1, Txn::ucName },
    { 2, Txn::ucSurname }
    };

    so that in my app, I can load data, for instance

    LoadData(1,"Joe");
    LoadData(2,"Soap");

    will render ucName = "Joe" and ucSurname = "Soap"

    On compile, however, I get:

    under the Message column:
    ` Txn::TXN
    Error 1

    No other explanations.

    Any ideas? This is quite urgent.

    Thanks