anyone with experience using ID3 libraries for c++?

Cheetoz

[H]ard|Gawd
Joined
Mar 3, 2003
Messages
1,972
I just want to read ID3 tags from mp3s, but it is becoming a real pain.

I'm trying to use taglib, and I have
Code:
#include </usr/local/include/taglib/tag.h>
#include </usr/local/include/taglib/fileref.h>
and then comping I get
Code:
g++ -c -pipe -g -gdwarf-2 -Wall -W -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Qt4.5/mkspecs/macx-g++ -I. -I/Library/Frameworks/QtCore.framework/Versions/4/Headers -I/usr/include/QtCore -I/Library/Frameworks/QtGui.framework/Versions/4/Headers -I/usr/include/QtGui -I/usr/include -I. -I. -F/Library/Frameworks -o mainwindow.o mainwindow.cpp
In file included from mainwindow.cpp:7:
/usr/local/include/taglib/fileref.h:29:19: error: tfile.h: No such file or directory
/usr/local/include/taglib/fileref.h:30:25: error: tstringlist.h: No such file or directory
/usr/local/include/taglib/fileref.h:107: error: ISO C++ forbids declaration of 'File' with no type
/usr/local/include/taglib/fileref.h:107: error: 'File' declared as a 'virtual' field
/usr/local/include/taglib/fileref.h:107: error: expected ';' before '*' token
/usr/local/include/taglib/fileref.h:127: error: expected `)' before 'fileName'
/usr/local/include/taglib/fileref.h:136: error: expected `)' before '*' token
/usr/local/include/taglib/fileref.h:179: error: ISO C++ forbids declaration of 'File' with no type
/usr/local/include/taglib/fileref.h:179: error: expected ';' before '*' token
/usr/local/include/taglib/fileref.h:216: error: 'StringList' does not name a type
/usr/local/include/taglib/fileref.h:250: error: ISO C++ forbids declaration of 'File' with no type
/usr/local/include/taglib/fileref.h:250: error: expected ';' before '*' token
mainwindow.cpp: In member function 'void MainWindow::sort()':
mainwindow.cpp:70: error: no matching function for call to 'TagLib::FileRef::FileRef(QString&)'
/usr/local/include/taglib/fileref.h:141: note: candidates are: TagLib::FileRef::FileRef(const TagLib::FileRef&)
/usr/local/include/taglib/fileref.h:116: note: TagLib::FileRef::FileRef()
make: *** [mainwindow.o] Error 1
make: Leaving directory `/Volumes/Media/misc/cpp projects/id3sorter'
Exited with code 2.
Error while building project id3sorter
When executing build step 'Make'

i tried id3lib, placed
Code:
#include <id3/tag.h>
and then
Code:
ID3_Tag myTag( "testing.mp3" );
and I get
Code:
g++ -c -pipe -g -gdwarf-2 -Wall -W -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Qt4.5/mkspecs/macx-g++ -I. -I/Library/Frameworks/QtCore.framework/Versions/4/Headers -I/usr/include/QtCore -I/Library/Frameworks/QtGui.framework/Versions/4/Headers -I/usr/include/QtGui -I/usr/include -I. -I. -F/Library/Frameworks -o mainwindow.o mainwindow.cpp
mainwindow.cpp:106: warning: unused parameter 'directory'
g++ -headerpad_max_install_names -o id3sorter.app/Contents/MacOS/id3sorter main.o mainwindow.o moc_mainwindow.o -F/Library/Frameworks -L/Library/Frameworks -framework QtGui -framework Carbon -framework AppKit -framework QtCore -lz -lm -framework ApplicationServices
Undefined symbols:
"ID3_Tag::ID3_Tag(char const*)", referenced from:
MainWindow::sort() in mainwindow.o
"ID3_Tag::~ID3_Tag()", referenced from:
MainWindow::sort() in mainwindow.o
MainWindow::sort() in mainwindow.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [id3sorter.app/Contents/MacOS/id3sorter] Error 1
make: Leaving directory `/Volumes/Media/misc/cpp projects/id3sorter'
Exited with code 2.
Error while building project id3sorter
When executing build step 'Make'

so does anyone know of any other libraries I could try? Pref. something simple with just a header+source file. I tried a couple of old ones written in C, but they didn't work either.
 
Last edited:
Have you found the missing headers that taglib is complaining about? That might clear up the rest of the errors.
 
well, its not that they're missing, but if i change the fileref.h's includes from
Code:
#include <tfile.h>
#include <tstringlist.h>
to
Code:
#include "tfile.h"
#include "tstringlist.h"
I don't get the not found error, but then I get
Code:
g++ -c -pipe -g -gdwarf-2 -Wall -W -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Qt4.5/mkspecs/macx-g++ -I. -I/Library/Frameworks/QtCore.framework/Versions/4/Headers -I/usr/include/QtCore -I/Library/Frameworks/QtGui.framework/Versions/4/Headers -I/usr/include/QtGui -I/usr/include -I. -I. -F/Library/Frameworks -o mainwindow.o mainwindow.cpp
/usr/local/include/taglib/fileref.h:93: warning: 'class TagLib::FileRef::FileTypeResolver' has virtual functions but non-virtual destructor
g++ -headerpad_max_install_names -o id3sorter.app/Contents/MacOS/id3sorter main.o mainwindow.o moc_mainwindow.o -F/Library/Frameworks -L/Library/Frameworks -framework QtGui -framework Carbon -framework AppKit -framework QtCore -lz -lm -framework ApplicationServices
Undefined symbols:
"TagLib::FileRef::~FileRef()", referenced from:
MainWindow::sort() in mainwindow.o
MainWindow::sort() in mainwindow.o
"TagLib::FileRef::FileRef(char const*, bool, TagLib::AudioProperties::ReadStyle)", referenced from:
MainWindow::sort() in mainwindow.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [id3sorter.app/Contents/MacOS/id3sorter] Error 1
make: Leaving directory `/Volumes/Media/misc/cpp projects/id3sorter'
Exited with code 2.
Error while building project id3sorter
When executing build step 'Make'
And I have no idea what those errors mean/how to fix it.
 
Back
Top