I am writing a C ++ application in Visual Studio 2008. It has many specific structures in several header files, for example:
#pragma pack( push , 1 )
In the source file, these specific structures are used as such:
void MyFunc( void ) { myStruct_t * myStruct = NULL; myStruct = (myStruct_t *)malloc( sizeof(myStruct_t) ); }
Despite the fact that it compiles successfully with 0 errors and 0 warnings, sometimes when I right-click on a custom data type (for example, in MyFunc ), it gives me an error:
The character 'myStruct_t' is undefined.
Then I click OK to close the dialog box and press Ctrl + Alt + F7 to rebuild the solution. It builds without any errors or warnings, so I know that it finds the definition of myStruct_t at compilation, but cannot find it when I try to use the Go to definition function. The only thing that happens to me is that this application has many defined structures, single-byte aligned, but that should not matter. Does anyone know how to fix this?
c ++ visual-studio-2008
Jim fell
source share