Errors Including vfw.h

Started by
2 comments, last by phresnel 14 years, 7 months ago
I included <vfw.h> header after including <windows.h>, and I also included the vfw32.lib library file. Any ideas why I'm getting the following compile errors?

1>c:\program files\microsoft sdks\windows\v6.0\include\vfw.h(3551) : error C2059: syntax error : 'constant'
1>c:\program files\microsoft sdks\windows\v6.0\include\vfw.h(3551) : error C2238: unexpected token(s) preceding ';'

Both errors occurs on the line shown below:

typedef struct tagCapStatus {
    UINT        uiImageWidth;               // Width of the image
    UINT        uiImageHeight;              // Height of the image
    BOOL        fLiveWindow;                // Now Previewing video?
    BOOL        fOverlayWindow;             // Now Overlaying video?
    BOOL        fScale;                     // Scale image to client?
    POINT       ptScroll;  // <-----Here    // Scroll position

Advertisement
Try the minimum possible code that will compile and see if you still get the error:

#include <windows.h>#include <vfw.h>int main (){    return 0;}

The above code compiles for me without error. If it compiles for you as well, I'd say there's something else in your code that's causing problems - in particular, what have you got #define'd?
It took awhile, but I found a #define POINT in my code which caused the error.
Take this as a lesson to avoid #define where possible in C++. Which is approximately always.

This topic is closed to new replies.

Advertisement