1

I cannot compile my project, that uses MPEG2 DirectShow video encoder. I've included Wmcodecdsp.h, but when I compile project, Visual C++ gives undefined symbol error on CLSID_CMPEG2EncoderVideoDS. I've tried to add to project msmpeg2enc.dll, but linker can't link it doesn't have export table.

The error I get is about this:

CaptureGraph.obj : error LNK2001: undefined external symbol "CLSID_CMPEG2EncoderVideoDS

Roman R.
  • 68,205
  • 6
  • 94
  • 158
  • Full/exact error message quote? Or we are supposed to guess? – Roman R. Jan 07 '14 at 21:48
  • Sorry, I have russian-translated Visual Studio, so, description may be not so exact. "CaptureGraph.obj : error LNK2001: undefined external symbol "CLSID_CMPEG2EncoderVideoDS"" – Azat Galiev Jan 07 '14 at 21:51
  • 1
    Next time be sure to check [ask] and [Stack Overflow question checklist](http://meta.stackexchange.com/questions/156810/stack-overflow-question-checklist) – Roman R. Jan 07 '14 at 21:54

1 Answers1

2

Linker error like this means you need to link a missing .LIB

A search on Windows SDK \lib directory gets you wmcodecdspuuid.lib. Hence...

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

... some where on the source code (I prefer below #includes) will do the trick.

Roman R.
  • 68,205
  • 6
  • 94
  • 158