Jump to content
Tuts 4 You

'cmddata' : unknown size


CodeExplorer

Recommended Posts

CodeExplorer

error C2133: 'cmddata' : unknown size

in h file:
extern const t_cmddata cmddata[];

typedef unsigned long  ulong;          // Unsigned long

typedef struct t_cmddata {
  ulong          mask;                 // Mask for first 4 bytes of the command
  ulong          code;                 // Compare masked bytes with this
  char           len;                  // Length of the main command code
  char           bits;                 // Special bits within the command
  char           arg1,arg2,arg3;       // Types of possible arguments
  char           type;                 // C_xxx + additional information
  char           *name;                // Symbolic name for this command
} t_cmddata;


In cpp file:
const t_cmddata cmddata[] = {
  { 0x0000FF, 0x000090, 1,00,  NNN,NNN,NNN, C_CMD+0,        "NOP" },
...
error C2133: 'cmddata' : unknown size
-----------
And also: in h:
extern const char      *regname[3][9];

in cpp:
const char *regname[3][9] = {
  { "AL", "CL", "DL", "BL", "AH", "CH", "DH", "BH", "R8"  },
  { "AX", "CX", "DX", "BX", "SP", "BP", "SI", "DI", "R16" },
  { "EAX","ECX","EDX","EBX","ESP","EBP","ESI","EDI","R32" } };

error C2086: 'regname' : redefinition
 

How to fix the above errors? I'm using Visual C++ 6.0.
 

Link to comment
CodeExplorer

The above declarations are 100% valid,
the problem was invalid instruction on the top of header (.h file)
solved now.
 

Link to comment
54 minutes ago, CodeExplorer said:

the problem was invalid instruction on the top of header (.h file)

and what was it?

Link to comment
CodeExplorer
Just now, jackyjask said:

and what was it?

Quote

#ifndef MAINPROG
#define /*unique*/ extern
#else
#define /*unique*/
#endif

And after it:
 

Quote

unique int       ideal;

I've wrongly replaced "unique" with /*unique*/ on whole project and this was generating problem;
originally first quoted line was without comments:
 

Quote

#ifndef MAINPROG
#define unique extern
#else
#define unique
#endif

All works fine now.

 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...