Game Development Community

Lib adding & Linker errors for Direct Show??

by Mike Wigand · in Torque Game Engine · 02/27/2002 (5:24 pm) · 2 replies

Im trying to implement Direct Show with the following:

/*
// Add MP3/AVI/MPG
// direct show header

CoInitialize(NULL);

// create the filter graph
CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, IID_IGraphBuilder, (void**)pGraph);

// get the media control interface
pGraph->QueryInterface(IID_IMediaControl, (void**)&pMediaControl);

// get the media event
pGraph->QueryInterface(IID_IMediaEvent, (void**)&pEvent);

// play file
pGraph->RenderFile(L"file2.avi", NULL);
pMediaControl->Run();

// error code
long evCode;

// wait til file is complete
pEvent->WaitForCompletion(INFINITE, &evCode);

// cleanup
pEvent->Release();
pMediaControl->Release();
pGraph->Release();
CoUninitialize();
*/

I've added the library "strmiids.lib" to the project using: project settings -> Link, but I continue to get linking errors:

winWindow.obj : error LNK2001: unresolved external symbol __imp__CoUninitialize@0
winWindow.obj : error LNK2001: unresolved external symbol __imp__CoCreateInstance@20
winWindow.obj : error LNK2001: unresolved external symbol __imp__CoInitialize@4

Im I going about adding the library the wrong way??? I've also tried #pragma comment (lib, "strmiids.lib"), what do I need to do to get my links to behave correctly? Im probably missing something so simple. Please help.

#1
02/27/2002 (7:45 pm)
MSDN says to use ole32.dll, so you might want to try adding that.

Josh
#2
02/28/2002 (9:38 am)
I knew I was being stupid... Thank you. =)