0

Hi All,
I'm trying to make commandline mp3 player using libwmp3. I use codeblocks and have tried alot and I get error below. I have tried to include libwmp3.h, add libwmp3.a try changing compiler; but no success :(

Please help me to get through. I use the code for mp3 player posted at their site.

Thanks

expected constructor or destructor or type conversion before "->" token .

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by Stefano Mtangoo
0

<psychic_debugging>
I'm willing to bet that you copied the code from that site without adding the necessary scaffolding. For example, executable (as opposed to declarative) code needs to be wrapped in a function:

#include <windows.h> // Assuming this for Sleep
#include "libwmp3.h"

int main()
{
  /* create class instance */
  CWMp3* mp3 = CreateCWMp3();

  /* open file from disk */
  mp3->OpenFile("mysong.mp3",800, 0, 0);
  mp3->Play();

  /* ... wait here in some loop */
  MP3_STATUS status;

  mp3->GetStatus(&status);

  while(status.fPlay)
  {
      Sleep(200);
      mp3->GetStatus(&status);
  }

  /* destroy class instance */
  mp3->Release();
}

</psychic_debugging>

0

I'm willing to bet that you copied the code from that site without adding the necessary scaffolding.

You bet it! You are really here to prove me wrong. It is kinda foolish to forgot main. It is like trying entering without a door ;)

Thanks Narue

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.