First off, make sure you have the latest windows sdk.
The direct show base classes are in there now and not directx sdk.
There are required headers in direct show base classes in the samples directory of the sdk.
Thus, you need to reference the header files in
C:\Program Files\Microsoft SDKs\Windows\v7.0\Samples\multimedia\directshow\baseclasses
You will also to build that solution and link the lib file:
- Drop down the Tools menu, and select Options [ from http://www.lavishsoft.com/wiki/index.php/Visual_Studio_Paths ]
- In the box on the left is a list of option categories. Select “Projects and Solutions” and then the sub-category “VC++ Directories”
- In the upper right hand corner is a drop-down box that selects a particular set of default directories, including “Executable files”, “Include files”, “Reference files”, “Library files”, and “Source files”. Generally, you only want to add to the “Include files” or “Library files” lists. Select “Include files”
- In the middle of the right hand side of the window is a list of directories.
- Add the include path by pressing the “New Line” button above the window, or by pressing “Ctrl-Insert” or clicking under the last entry.
- A blank entry appears for you to either type the path or navigate by clicking the “…” button.
- Generally the final path you want will end with a folder called “include”. Enter the path now (e.g., c:\program files\isxdk\include)
- For direct show base classes, enter C:\Program Files\Microsoft SDKs\Windows\v7.0\Samples\multimedia\directshow\baseclasses
- Select “Library files” in the drop-down box
- In the same fashion as done for the include file path, add the path to the library files. (e.g., c:\program files\isxdk\lib\vs80)
- Add the direct show path C:\Program Files\Microsoft SDKs\Windows\v7.0\Samples\multimedia\directshow\baseclasses\release_mbcs
- You’re done, click OK
These includes need to be before the windows sdk includes, or you will have issues with definitions in refclock.h as there is another header of this name in the sdk.
I ran into this too. I found that you need to have the baseclasses directory (samples/multimedia/directshow) *before* the sdk include directory, since they both have a schedule.h file and refclock.h uses <> not ” for the include. I was slightly surprised to see that no-one else had mentioned this. [ http://social.msdn.microsoft.com/Forums/en/windowsdirectshowdevelopment/thread/5da8f0b8-d2a9-4caf-81e1-7f5788fa1c00 ]
The exact error reads as follows:
c1xx : fatal error C1083: Cannot open source file: ‘WIN32’: No such file or directory
After I get this error once, I can recompile again, and since the changed file has now been compiled, it goes directly to linking and doesn’t spit this error out again.
I also found reference to other potential causes for this error online:
- –Make sure the compiler sees /D “WIN32”, without /D it will try to compile WIN32. Project + properties, C/C++, Command line.
- –/I “” is your problem, it swallows the next /D. I tried it and got the same error message. Not sure how you got it, there’s probably something wrong with Project + properties, C/C++, Additional include directories.
- – I’d added an environment variable which had now been removed, thus creating an empty /I “”.
And that’s about all I took note of.