Author Topic: Trying to teach old programmer new tricks  (Read 4643 times)

TEW

  • Posts: 12
Trying to teach old programmer new tricks
« on: 25 Dec '12 - 00:40 »
Hi,
I am an old retired programmer.  I used to program in C as well as other languages.  I have stumbled across BASS and want to discover what I might be able to do with it.

I am using Microsoft Visual C++ express (not quite what I am used to) and just flat stuck (don't know what I am doing yet)

I am sure the problem is simple but I just can't see what's not working.  I have ordered a book,
but if this problem jumps right up and someone knows, I can use some help. 

I don't expect anyone to spend a lot of time.  I will have book in a few days.

I am fairly sure the problem is that I am not linking the Bass.dll. But don't know how to fix it.
Here are the errors:

1>TomsPlayer.obj : error LNK2028: unresolved token (0A000011) "extern "C" unsigned long __stdcall BASS_StreamCreateFile(int,void const *,unsigned __int64,unsigned __int64,unsigned long)" (?BASS_StreamCreateFile@@$$J228YGKHPBX_K1K@Z) referenced in function "private: void __clrcall TomsPlayer::Form1::button1_Click(class System::Object ^,class System::EventArgs ^)" (?button1_Click@Form1@TomsPlayer@@$$FA$AAMXP$AAVObject@System@@P$AAVEventArgs@4@@Z)
1>TomsPlayer.obj : error LNK2019: unresolved external symbol "extern "C" unsigned long __stdcall BASS_StreamCreateFile(int,void const *,unsigned __int64,unsigned __int64,unsigned long)" (?BASS_StreamCreateFile@@$$J228YGKHPBX_K1K@Z) referenced in function "private: void __clrcall TomsPlayer::Form1::button1_Click(class System::Object ^,class System::EventArgs ^)" (?button1_Click@Form1@TomsPlayer@@$$FA$AAMXP$AAVObject@System@@P$AAVEventArgs@4@@Z)
1>C:\Users\Toms\documents\visual studio 2010\Projects\TomsKaroakePlayer\Debug\TomsPlayer.exe : fatal error LNK1120: 2 unresolved externals
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========


Here is the code.  I have included the BASS.H which the compiler does appear to find.
I tried and commented out BASS_INIT and BASS_StreamCreateFile

private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e)
      {
        int stream = BASS_StreamCreateFile(false, "c:\\temp\\test.mp3", 0L, 0L, 0);
            if (stream != 0)
         {
         }
         //BASS_Init(-1, 44100, 0, NULL ,NULL);
   
      //   BASS_StreamCreateFile(FALSE,"test.mp3",0,0,0);
                     
      }

Thanks I have enjoyed reading this forum.
Tom
      

(: JOBnik! :)

  • Posts: 1065
Re: Trying to teach old programmer new tricks
« Reply #1 on: 27 Dec '12 - 14:07 »
Hi ;D

Did you also include BASS.LIB in your project?
btw, BASS related posts please open in BASS forum and not in General Discussion :)

TEW

  • Posts: 12
Re: Trying to teach old programmer new tricks
« Reply #2 on: 27 Dec '12 - 18:39 »
Hi,
I tried adding bass.lib in the referecences under Linker - Input - Additional dependencies
and in the code as #pragma comment( lib,"bass.lib" )
I have the bass.lib in the source directory, in Windows/system and Windows/system32.

Now I get the error 1>LINK : fatal error LNK1104: cannot open file 'bass.lib'

Thanks for your help. I will post the question in the BASS forum.  I wasn't really sure if I should post it there or in the General.  I felt it was more of a question regarding MS C++ IDE