which .lib file do I include?
I am using direct sound in my project and am getting this link error:
error LNK2019: unresolved external symbol "public: long __thiscall CMusicManager::Initialize(struct HWND__ *,unsigned long,unsigned long,struct IDirectSound *)" (?Initialize@CMusicManager@@QAEJPAUHWND__@@KKPAUIDirectSound@@@Z) referenced in function "long __cdecl OnInitDialog(struct HWND__ *)" (?
OnInitDialog@@YAJPAUHWND__@@@Z)
I am including dsound.h and dsound.lib into my project. Do I have to include any other files to make my program link properly? Also, here is a section of the code where I use this function:
HRESULT hr;
CMusicManager* g_pMusicManager;
g_pMusicManager = new CMusicManager();
if( FAILED( hr = g_pMusicManager->Initialize( hDlg ) ) )
return DXTRACE_ERR( TEXT("Initialize"), hr );
hDlg is a pre declared var of type HWND
Quote:error LNK2019: unresolved external symbol "public: long __thiscall CMusicManager::Initialize(struct HWND__ *,unsigned long,unsigned long,struct IDirectSound *)" (?Initialize@CMusicManager@@QAEJPAUHWND__@@KKPAUIDirectSound@@@Z) referenced in function "long __cdecl OnInitDialog(struct HWND__ *)" (?
OnInitDialog@@YAJPAUHWND__@@@Z)
I might be wrong, but I'd read that lovely looking error as meaning your compiler can't find CMusicManager::Initialize(), and nothing (directly) to do with DirectSound.
Get rid of the obfuscated/mangled bits and parameter lists:
Quote:unresolved external symbol "public: long __thiscall CMusicManager::Initialize(...)" referenced in function "long __cdecl OnInitDialog(...)"
Are you sure that you've actually implemented that member function and that your compiler can find where its implemented?
hth
Jack
yeah, that member function actually comes from dmutil.h which I also included. I fixed the problem though. the function declaration inside of dmutil.h wasn't taking as many arguments as it needed to so I added the extra argument to the declaration and implementation of "Initialize" and that solved the problem.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement