tags:

views:

55

answers:

2

Hi, i got a Project to go on coding, so its not my code till now and i can´t explain the following warning message in VS2008 compiling my code:

Warnung 2 warning C4161: #pragma pack(pop...): Mehr pop- als push-Vorgänge c:\programme\microsoft sdks\windows\v6.0a\include\poppack.h 29

/*++

Copyright (c) Microsoft Corporation.  All rights reserved.

Module Name:

    poppack.h

Abstract:

    This file turns packing of structures off.  (That is, it enables
    automatic alignment of structure fields.)  An include file is needed
    because various compilers do this in different ways.

    poppack.h is the complement to pshpack?.h.  An inclusion of poppack.h
    MUST ALWAYS be preceded by an inclusion of one of pshpack?.h, in one-to-one
    correspondence.

    For Microsoft compatible compilers, this file uses the pop option
    to the pack pragma so that it can restore the previous saved by the
    pshpack?.h include file.

--*/

#if ! (defined(lint) || defined(RC_INVOKED))
#if ( _MSC_VER >= 800 && !defined(_M_I86)) || defined(_PUSHPOP_SUPPORTED)
#pragma warning(disable:4103)
#if !(defined( MIDL_PASS )) || defined( __midl )
#pragma pack(pop)
#else
#pragma pack()
#endif
#else
#pragma pack()
#endif
#endif // ! (defined(lint) || defined(RC_INVOKED))

Can you explain why? Isnt this a Microsoft File?

+1  A: 

You need to make sure that you match every

#include <pshpack.h>

with a use of

#include <poppack.h>

If my German is serving me right, it's complaining about a mis-match.

unwind
hmm i don't have a pshpack.h nor a poppack.h included.. What else is possible?The german text says that more pops than pushes were recognized.
camelord
+1  A: 

It seems that you must include pshpack.h at the beginning of your code, and include poppack.h at the end.

Alexandre C.
i cannot find an include of poppack.h nor pshpack.h.. where do i have to include those files?
camelord