Tutorial :bass lib not linking, all other work perfect



Question:

I'm having a wierd problem. i'm developping a nice game with openGL on MFC. i need to use threads for multi sound. so i am trying to use the BASS lib for that.

For a reason that is beyond my comprihention, i can not get the bass.lib to link. all other libs (openGL libs and so on) link perfect.

  1. i'v added "#include "base.h" to my *.h MFC dialog file (tried both the .cpp and the .h).

  2. I am using a global function for the thread declared in the cpp file:

    UINT SetMusicThread(LPVOID Param);

  3. Calling the new thread in the "onInitDialog()":

    AfxBeginThread(SetMusicThread,GetSafeHwnd(),THREAD_PRIORITY_NORMAL,0,0,NULL);

  4. The function for now is just trying to start the first stream: just trying set by step:

    UINT SetMusicThread(LPVOID Param) { //soundTrack* sound = (soundTrack*)Param;

    // Create Handle to the music str=BASS_StreamCreateFile(FALSE,Sound[SoundPosition],0,0,0); // Check if valid if(!str) { // Not valid, Free object //FreeMusicThread(); return FALSE; } }

  5. str is a global HSTEAM.

  6. The program compiles ok, but doesn't link with the messege:

    Error 6 error LNK2019: unresolved external symbol _BASS_StreamCreateFile@20 referenced in function "unsigned int __cdecl SetMusicThread(void *)" (?SetMusicThread@@YAIPAX@Z) MonstersDlg.obj Monsters

  7. added the bass.lib to the "Addisionals dependencies" and even tried to put it both in my project and in the the LIB of the SDKs library....tried every thing i can think of....

Can any one please help me....what am i missing???

10x


Solution:1

I think bass.h creates a static library.

You need to add the actual lib to your project by pressing in your sdk (while your project is open): Project -> Settings, press the Link tab and in your Object/library modules add the actual path of tha bass.lib. (the instructions are on VS 5.0 so diferences may be present in newer SDK versions)


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »