Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Qt Academy Launch in California!

    Assert error when using id3lib

    General and Desktop
    2
    2
    1461
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • L
      Leodido last edited by

      Hello guys,

      I'm trying to code a little application that reads some mp3 files then decode the id3tag using id3lib and display everything a in table view.

      I'm currently trying to make the id3lib working but I'm having a very weird assert error when iterating on the id3 frames.

      Here is the assert I'm getting.

      Microsoft Visual C++ Debug Library

      Debug Assertion Failed!

      Program: ...sktop_Qt_5_0_1_MSVC2010_32bit-Debug\debug\MusicLibManager.exe
      File: f:\dd\vctools\crt_bld\self_x86\crt\src\dbgheap.c
      Line: 1424

      Expression: _pFirstBlock == pHead

      For information on how your program can cause an assertion
      failure, see the Visual C++ documentation on asserts.

      (Press Retry to debug the application)

      Abort Retry Ignore

      And the code that produces it, which is just a copy/paste from an example on the id3lib page.

      @// Lists all the ID3Frames
      QStringList mp3Tag::listID3Frames(void)
      {
      QStringList frameList;

      if (this->isMp3Loaded())
      {
          // use an std::auto_ptr here to handle object cleanup automatically
          ID3_Tag::Iterator* iter = mp3FileTag.CreateIterator();
          ID3_Frame* myFrame = NULL;
          while (NULL != (myFrame = iter->GetNext()))
          {
              frameList << myFrame->GetTextID();
          }
          delete iter;
          qDebug() <&lt; frameList;
      }
      
      return frameList;
      

      }@

      This is how I added the id3lib to my project

      @win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../libs/id3lib-3.8.3binaries_win/release/ -lid3lib
      else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../libs/id3lib-3.8.3binaries_win/debug/ -lid3lib
      else:unix: LIBS += -L$$PWD/../libs/id3lib-3.8.3binaries_win/ -lid3lib

      INCLUDEPATH += $$PWD/../libs/id3lib-3.8.3/include
      DEPENDPATH += $$PWD/../libs/id3lib-3.8.3/include

      win32:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/../libs/id3lib-3.8.3binaries_win/release/id3lib.lib
      else:win32:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/../libs/id3lib-3.8.3binaries_win/debug/id3lib.lib
      else:unix: PRE_TARGETDEPS += $$PWD/../libs/id3lib-3.8.3binaries_win/libid3lib.a@

      I'm very new to Qt so maybe I did something wrong?
      Could anyone give me an hand?
      The assert happens on the frameList << myFrame->GetTextID(); line

      1 Reply Last reply Reply Quote 0
      • P
        pritamghanghas last edited by

        based on some googling it seems that you need to rebuild all the libs involved, qt as well as libId3tag. Still a guess.

        1 Reply Last reply Reply Quote 0
        • First post
          Last post