Thursday, January 3, 2013

Build directshow strmbase.lib in Windows 8

To build directshow strmbase.lib, here is the step when using dx9b.
Open \dx90bsdk\Samples\C++\DirectShow\BaseClasses\baseclasses.sln
in Visual Studio 2012.
Compile and fix error:
1. add c/c++ prepocessor definitions:
    POINTER_64=__ptr64
2. fix for loop variable declare

outputq.cpp:
for (long iDone = 0;
-->
long iDone;
for (iDone = 0;

winutil.cpp:
for (UINT Count = 0;Count < Result;Count++) {
->
UINT Count = 0;
for (Count = 0;Count < Result;Count++) { 


wxdebug.cpp
static g_dwLastRefresh = 0;
->
static int g_dwLastRefresh = 0;



3. sysclock.cpp, add g_Templates & g_cTemplates to fix link error
//#ifdef FILTER_DLL
/* List of class IDs and creator functions for the class factory. This
   provides the link between the OLE entry point in the DLL and an object
   being created. The class factory will call the static CreateInstance
   function when it is asked to create a CLSID_SystemClock object */
CFactoryTemplate g_Templates[1] = {
    {NULL, &CLSID_SystemClock, CSystemClock::CreateInstance}
};
int g_cTemplates = sizeof(g_Templates) / sizeof(g_Templates[0]);
//#endif    


No comments: