user71512
user71512

Reputation: 177

Resolving unresolved external symbol CSourceSeeking::CSourceSeeking(...) despite linking with the right library

Here is the error:

Error 2 error LNK2019: unresolved external symbol "protected: __thiscall CSourceSeeking::CSourceSeeking(char const *,struct IUnknown *,long *,class CCritSec *)" (??
0CSourceSeeking@@IAE@PBDPAUIUnknown@@PAJPAVCCritSec@@@Z) referenced in function "public: __thiscall CPushPin::CPushPin(long *,class CSource *)" (??0CPushPin@@QAE@PAJPAVCSource@@@Z) C:\Users\x\Desktop\PushSource\PushFilter.obj > PushSource

Here are my libs:

gdiplus.lib strmbasd.lib msvcrtd.lib winmm.lib odbc32.lib odbccp32.lib

What lib is CSourceSeeking in?

Upvotes: 1

Views: 989

Answers (3)

vladr
vladr

Reputation: 66661

At the bottom of most C/C++ API Reference pages on MSDN you will find a References section telling you what headers to include and what libraries to link with.

Correspondingly, in the References section of the CSourceSeeking reference page you shall find your answer:

Strmbase.lib (retail builds)
Strmbasd.lib (debug builds)

EDIT

See @Cornstalk's answer for instructions on how to build Strmbase.lib/Strmbased.lib yourself. When you build Strmbase.lib/Strmbased.lib, make sure the library build settings match your program's build settings: 32/64 bit, UNICODE/ANSI, etc. Using different settings for one or the other will cause errors.

Upvotes: 1

Cornstalks
Cornstalks

Reputation: 38218

You have to create Strmbase.lib/Strmbased.lib yourself, apparently. Make sure it's built for your target (i.e. if your program is 32-bit, make sure it's built as a 32-bit library; same for 64-bit).

Upvotes: 2

user405725
user405725

Reputation:

CSourceSeeking class is part of the Strmbase.lib library (or Strmbasd.lib for debug builds). Generally, MSDN states header file(s) and library(ies) requirements under "Requirements" section of a corresponding documentation page.

Upvotes: 0

Related Questions