2016-04-29 9 views
0

Kann mir jemand erklären PC-Lint Fehler-Nr. 38 mit einem Beispiel ...Offset des Symbols 'Symbol' inkonsistent

38 Offset of symbol 'Symbol' inconsistent (Location) -- A 
     member of a class or struct appears in a different 
     position (offset from the start of the structure) than an 
     earlier declaration. This could be caused by array 
     dimensions changing from one module to another. 

Ich erhalte immer Fehler wie ...

Offset of symbol 'ClassX::access1' inconsistent (conflicts with line 92, file U:\ABC\ABCApp.h, module U:\ABC\ABCApp.cpp) 

wo access1 eine Variable vom Typ Enum Mitglied ist ACCESS in ClassX erklärt. Und diese Enum ACCESS ist in einer anderen Header-Datei access.h definiert. access.h ist in stdafx.h enthalten.

typedef enum 
{ 
    ACCESS_NONE  = 0, 
    ACCESS_READ  = 1 
} ACCESS; 

Nicht sicher, was das Problem hier ist. Wo ist die Inkonsistenz?

Antwort

0

Es ist nicht die Definition von ACCESS, die das Problem ist, aber die Position access1 Mitglied in Klasse . Entweder haben Sie eine doppelte Deklaration der Klasse oder (höchstwahrscheinlich) eine Rogue #pragma pack, die beim Kompilieren einer .cpp-Datei wirksam ist, aber nicht beim Kompilieren einer anderen.