Sign in to follow this  

which .lib file do I include?

This topic is 4687 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

This topic is 4687 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this