1

I have problems with porting Windows application to Linux (GCC).

I have the following code in Windows (Visual Studio 2010 compiling it well): I have template class, that contains a structure.

    template<typename bidtype>
    class pst_bc_block : public pst_entries_block<bidtype>
    {
public:
    ...
    struct tag_bc
        {
            WORD  ID;
            WORD  type;
            DWORD  value;
        };
    ...
    }

When I'm trying to do something like this:

pst_bc_block<bidtype>::tag_bc tag_value;
tag_value.ID = 6;

GCC can't resolve ID member.

P.S. All windows types are defined and VS comple it well.

Cœur
  • 37,241
  • 25
  • 195
  • 267
IStar
  • 184
  • 1
  • 15

1 Answers1

4

tag_bc is a template-dependent type. Try this :

typename pst_bc_block<bidtype>::tag_bc tag_value;

Edit: you will probably encounter trouble if you forgot to redefine Windows' WORD, DWORD and such.

Quentin
  • 62,093
  • 7
  • 131
  • 191
  • You could consider improving your answer by extending the explanation for both the typename and the WORD ;) – Theolodis Jun 03 '14 at 13:07
  • 1
    I'm not much of a good teacher to be honest, so I'm used to leaving clear keywords for further research instead of trying and patching together an explanation... As for WORD, I just know that it's some Windowsian type, no more. uint32 ? – Quentin Jun 03 '14 at 13:12
  • WORD is unsigned short – IStar Jun 03 '14 at 13:22