How to read ID3v1 and ID3v2 tags using id3lib in Qt

Posted on Posted in Qt Tutorials, Tutorials

To read ID3 tags from MP3 files using C++ and Qt you can take many routes and here are some of them:

  • You can read the Wikipedia article on ID3 Tags (which is pretty much detailed) and write your own ID3 Tag reader. Simple but takes too long.
  • Or you can use some kind of 3rd party library, like id3lib which encapsulates all the complexities. This is even more simple and doesn’t take that much time 🙂

Here is a simple guide on how to use id3lib with Qt:

  1. Download id3lib binaries and source codes from here.
  2. Copy include folder and binaries to your project folder.
  3. Add the include path and libs to your PRO file.
    • INCLUDEPATH += id3lib/include
    • id3lib/bin/Release/id3lib
  4. Add the following line to the topmost point of your sources, or in other words, before including id3 sources.
    • #define ID3LIB_LINKOPTION 3
  5. Include id3lib main header in your source.
    • #include “id3.h”
  6. Before you try to run the project make sure that id3lib DLL file is copied to the same folder with your project’s executable.

You can download the example Qt project from here:


Leave a Reply

Your email address will not be published. Required fields are marked *