title: Getting mp3 cover art via TagLib using Qt
body: <p>I'm making an audioplayer for my course project in university. I'm a first-year student, so I'm not a professional programmer.</p>
  
  <p>I'm using Qt 5.4 and QtCreator 3.3.1. I've included bass.dll and TagLib libraries to work with audiofiles. What am I trying to do is to get the song's cover art and pass it to QLabel (or any other widget if more convenient) on my player's GUI.
  I haven't really figured out how to do it. I've been searching for examples for a while but I always end up in having errors or wrong examples. Below is the last code I've tried to use.</p>
  
  <pre><code>TagLib::MPEG::File file(reinterpret_cast&lt;const wchar_t*&gt;(curSong-&gt;path.constData()));
  TagLib::ID3v2::Tag *m_tag = file.ID3v2Tag(true);
  TagLib::ID3v2::FrameList frameList = m_tag-&gt;frameList("APIC");
     if(frameList.isEmpty()) {
         return QImage();
     }
  
     TagLib::ID3v2::AttachedPictureFrame *coverImg = static_cast&lt;TagLib::ID3v2::AttachedPictureFrame *&gt;(frameList.front());
  
     QImage coverQImg;
     coverQImg.loadFromData((const uchar *) coverImg-&gt;picture().data(), coverImg-&gt;picture().size());
  
     return coverQImg;
  </code></pre>
  
  <p>This one doesn't work for me because it causes errors such as</p>
  
  <pre><code>C:\Qt\Projects\audioPlayer\mainwindow.cpp:553: error: undefined reference to `TagLib::List&lt;TagLib::ID3v2::Frame*&gt;::List(TagLib::List&lt;TagLib::ID3v2::Frame*&gt; const&amp;)'
  </code></pre>
  
  <p>I suppose I've messed up with libraries, but I'm sure I've included id3v2frame.h and id3v2tag.h</p>