About error MIDL2337 : unsatisfied forward declaration

Discussion in 'C++' started by ÂËÉ«¾µ, Dec 6, 2006.

  1. ÂËÉ«¾µ

    ÂËÉ«¾µ Guest

    in my idl file, i define a user-define data type as bollow:
    typedef struct RasterFileHeader
    {
    DWORD dwVersion;
    LONG nDataOffset;
    LONG nBandCount;
    LONG nWidth;
    LONG nHeight;
    enum PixelDataTypeEnum ePDType; // it's a enum type import from another
    tlb by importlib(...)
    enum ImageModeEnum eImageMode; // it's a enum type import from another
    tlb by importlib(...)
    LONG nTileWidth;
    LONG nTileHeight;
    double dResolutionX;
    double dResolutionY;
    double dOrgX;
    double dOrgY;
    double dDPIX;
    double dDPIY;
    double dInvalidValue;
    LONG nReserve1;
    LONG nReserve2;
    LONG nReserve3;
    } RasterFileHeader;

    when complied, it comes to the error:"error MIDL2337 : unsatisfied forward
    declaration".

    i has found out that
     
    ÂËÉ«¾µ, Dec 6, 2006
    #1
    1. Advertising

  2. ÂËÉ«¾µ

    ÂËÉ«¾µ Guest


    > i has found out that

    when i comment the above two enum data type
    // enum PixelDataTypeEnum ePDType;
    // enum ImageModeEnum eImageMode;

    then compile it again, it works without errors.

    Is there anybody tell me why?

    thanks!
    colorfilter
     
    ÂËÉ«¾µ, Dec 6, 2006
    #2
    1. Advertising

  3. ÂËÉ«¾µ

    Alex Buell Guest

    On Wed, 6 Dec 2006 17:27:58 +0800, I waved a wand and this message
    magically appears in front of __É«__:

    > when i comment the above two enum data type
    > // enum PixelDataTypeEnum ePDType;
    > // enum ImageModeEnum eImageMode;


    You need to give the values for the enumeration, i.e., enum
    PixelDataTypeEnum { 8bit, 16bit, 24bit }, or include the definitions
    for ePDType and eImageMode from elsewhere.

    --
    http://www.munted.org.uk

    You've been eating the cat food again, haven't you?
     
    Alex Buell, Dec 6, 2006
    #3
  4. ÂËÉ«¾µ

    benben Guest

    ÂËÉ«¾µ wrote:
    > in my idl file, i define a user-define data type as bollow:
    > typedef struct RasterFileHeader
    > {
    > DWORD dwVersion;
    > LONG nDataOffset;
    > LONG nBandCount;
    > LONG nWidth;
    > LONG nHeight;
    > enum PixelDataTypeEnum ePDType; // it's a enum type import from another
    > tlb by importlib(...)
    > enum ImageModeEnum eImageMode; // it's a enum type import from another
    > tlb by importlib(...)
    > LONG nTileWidth;
    > LONG nTileHeight;
    > double dResolutionX;
    > double dResolutionY;
    > double dOrgX;
    > double dOrgY;
    > double dDPIX;
    > double dDPIY;
    > double dInvalidValue;
    > LONG nReserve1;
    > LONG nReserve2;
    > LONG nReserve3;
    > } RasterFileHeader;
    >
    > when complied, it comes to the error:"error MIDL2337 : unsatisfied forward
    > declaration".
    >
    > i has found out that


    Judging the error name it seems that the above is MIDL code not C++, or
    you are compiling with a wrong compiler. But, that is just my guess so I
    can be wrong.

    Ben
     
    benben, Dec 6, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mark
    Replies:
    9
    Views:
    719
    Steve W. Jackson
    Jan 16, 2004
  2. allelopath
    Replies:
    1
    Views:
    7,329
    P. Barthelemy
    Jan 4, 2005
  3. Replies:
    1
    Views:
    22,364
    Kari Ikonen
    Feb 6, 2005
  4. cppaddict
    Replies:
    4
    Views:
    20,313
    Gordon Beaton
    May 20, 2005
  5. qazmlp
    Replies:
    1
    Views:
    609
    Jonathan Turkanis
    Feb 15, 2004
Loading...

Share This Page