Search This Blog

Tuesday, January 17, 2012

Visual C++ compiler Errors & solution DirectShow


I’m trying to compile my directshow application and I got some error when building
I’ll show errors and solutions below

Error 1:
1>SampleGrabberRvDlg.obj : error LNK2001: unresolved external symbol _CLSID_FilterGraph
1>SampleGrabberRvDlg.obj : error LNK2001: unresolved external symbol _CLSID_AsyncReader
1>SampleGrabberRvDlg.obj : error LNK2001: unresolved external symbol _CLSID_SampleGrabber
1>SampleGrabberRvDlg.obj : error LNK2001: unresolved external symbol _IID_ISampleGrabberCB
1>SampleGrabberRvDlg.obj : error LNK2001: unresolved external symbol _IID_IBaseFilter
1>SampleGrabberRvDlg.obj : error LNK2001: unresolved external symbol _IID_IFileSourceFilter
1>SampleGrabberRvDlg.obj : error LNK2001: unresolved external symbol _IID_IMediaSeeking
1>SampleGrabberRvDlg.obj : error LNK2001: unresolved external symbol _IID_IVideoWindow
1>SampleGrabberRvDlg.obj : error LNK2001: unresolved external symbol _IID_IMediaControl
1>SampleGrabberRvDlg.obj : error LNK2001: unresolved external symbol _IID_IMediaEvent

Solution
Link the Strmiids.lib to your project or using the code list below

#pragma comment(lib,"Strmiids.lib")


Error 2:
 1>SampleGrabberRvDlg.obj : error LNK2019: unresolved external symbol "void __stdcall FreeMediaType(struct _AMMediaType &)" (?FreeMediaType@@YGXAAU_AMMediaType@@@Z) referenced in function "int __cdecl GrabBitmaps(wchar_t *)" (?GrabBitmaps@@YAHPA_W@Z)
1>SampleGrabberRvDlg.obj : error LNK2019: unresolved external symbol "public: __thiscall CMediaType::~CMediaType(void)" (??1CMediaType@@QAE@XZ) referenced in function "int __cdecl GrabBitmaps(wchar_t *)" (?GrabBitmaps@@YAHPA_W@Z)
1>SampleGrabberRvDlg.obj : error LNK2019: unresolved external symbol "public: void __thiscall CMediaType::SetSubtype(struct _GUID const *)" (?SetSubtype@CMediaType@@QAEXPBU_GUID@@@Z) referenced in function "int __cdecl GrabBitmaps(wchar_t *)" (?GrabBitmaps@@YAHPA_W@Z)

Solution
Link the Strmbasd.lib to your project or using the code list below

#pragma comment(lib,"Strmbasd.lib")

Error 3:
1>Strmbasd.lib(wxdebug.obj) : error LNK2019: unresolved external symbol __imp__timeGetTime@0 referenced in function "void __stdcall DbgInitialise(struct HINSTANCE__ *)" (?DbgInitialise@@YGXPAUHINSTANCE__@@@Z)
1>Strmbasd.lib(wxutil.obj) : error LNK2001: unresolved external symbol __imp__timeGetTime@0
1>Strmbasd.lib(wxutil.obj) : error LNK2019: unresolved external symbol __imp__timeSetEvent@20 referenced in function "unsigned int __stdcall CompatibleTimeSetEvent(unsigned int,unsigned int,void (__stdcall*)(unsigned int,unsigned int,unsigned long,unsigned long,unsigned long),unsigned long,unsigned int)" (?CompatibleTimeSetEvent@@YGIIIP6GXIIKKK@ZKI@Z)

Solution
Link the winmm.lib to your project or using the code list below

#pragma comment(lib,"winmm.lib")


Wednesday, January 11, 2012

VS2010 shows error Message when editing


Any editing on for the first time after starting VS2010 gives exception message




Visual Studio has encountered an exception. This may be caused by an extension. You can get more information by running the application together with the /log parameter on the command line, and then examining the file 'C:\Users\USERNAME\AppData\Roaming\Microsoft\VisualStudio\10.0\ActivityLog.xml'

Solution:
          It appears to be due to missing registry information. Adding the default value to the below registry key solved the problem.

On 32-Bit Windows: [HKEY_CLASSES_ROOT\CLSID\{73B7DC00-F498-4ABD-AB79-D07AFD52F395}\InProcServer32]
On 64-Bit Windows: [HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{73B7DC00-F498-4ABD-AB79-D07AFD52F395}\InProcServer32]

The "(Default)" value should be one of the following:
On 32-Bit Windows: "C:\Program Files\Common Files\Microsoft Shared\MSEnv\TextMgrP.dll"
On 64-Bit Windows: "C:\Program Files (x86)\Common Files\Microsoft Shared\MSEnv\TextMgrP.dll"