Problem mit TagLib



  • Hallo Leute, ich brauch für ein Projekt die TagLib.
    Jedoch will die sich nich Kompilieren lassen. Ich hab sie zwar soweit in mein Projekt "installiert", jedoch habe ich keine Libs die ich linken muss. Ich hab versucht TagLib auf meinem LinuxRoot zo compilen. Das ging auch, jedoch hab ich nur .o und .la files bekommen. Diese kann in VS 2010 ja nicht benutzen.
    Jedoch kann ich auch G++ nicht nutzen, da mein Projekt das Logitech SDK nutzt, und das gibts leider nur als .lib file.

    Ich hoffe ihr könnt mir helfen 😉

    Grüße



  • Tsuyo schrieb:

    Jedoch will die sich nich Kompilieren lassen.
    Ich hab sie zwar soweit in mein Projekt "installiert"

    Das heißt? Welche Fehlermeldung gibt es?



  • Naja, ich bekomme halt immer Linker Errors, weil die dazugehörigen .lib files nicht erstellt werden. Und im Netz gibts auch nichts gescheites.
    Hier sind die Fehler:

    Fehler	9	error LNK1120: 8 nicht aufgelöste externe Verweise.	C:\Users\Chef\documents\visual studio 2010\Projects\Gen_Gamp_Lcd\Debug\gen_gamp_lcd.dll	gen_gamp_lcd
    Fehler	1	error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""__declspec(dllimport) public: virtual __thiscall TagLib::MPEG::File::~File(void)" (__imp_??1File@MPEG@TagLib@@UAE@XZ)" in Funktion ""class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > __cdecl Album(class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >)" (?Album@@YA?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@V12@@Z)".	C:\Users\Chef\documents\visual studio 2010\Projects\Gen_Gamp_Lcd\gen_gamp_lcd\Id3Data.obj	gen_gamp_lcd
    Fehler	2	error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""__declspec(dllimport) public: virtual __thiscall TagLib::String::~String(void)" (__imp_??1String@TagLib@@UAE@XZ)" in Funktion ""class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > __cdecl Album(class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >)" (?Album@@YA?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@V12@@Z)".	C:\Users\Chef\documents\visual studio 2010\Projects\Gen_Gamp_Lcd\gen_gamp_lcd\Id3Data.obj	gen_gamp_lcd
    Fehler	3	error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""__declspec(dllimport) public: class std::_String_iterator<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > __thiscall TagLib::String::begin(void)" (__imp_?begin@String@TagLib@@QAE?AV?$_String_iterator@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@XZ)" in Funktion ""class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > __cdecl Album(class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >)" (?Album@@YA?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@V12@@Z)".	C:\Users\Chef\documents\visual studio 2010\Projects\Gen_Gamp_Lcd\gen_gamp_lcd\Id3Data.obj	gen_gamp_lcd
    Fehler	4	error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""__declspec(dllimport) public: class std::_String_iterator<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > __thiscall TagLib::String::end(void)" (__imp_?end@String@TagLib@@QAE?AV?$_String_iterator@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@XZ)" in Funktion ""class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > __cdecl Album(class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >)" (?Album@@YA?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@V12@@Z)".	C:\Users\Chef\documents\visual studio 2010\Projects\Gen_Gamp_Lcd\gen_gamp_lcd\Id3Data.obj	gen_gamp_lcd
    Fehler	5	error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""__declspec(dllimport) public: virtual class TagLib::Tag * __thiscall TagLib::MPEG::File::tag(void)const " (__imp_?tag@File@MPEG@TagLib@@UBEPAVTag@3@XZ)" in Funktion ""class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > __cdecl Album(class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >)" (?Album@@YA?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@V12@@Z)".	C:\Users\Chef\documents\visual studio 2010\Projects\Gen_Gamp_Lcd\gen_gamp_lcd\Id3Data.obj	gen_gamp_lcd
    Fehler	6	error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""__declspec(dllimport) public: bool __thiscall TagLib::File::isOpen(void)const " (__imp_?isOpen@File@TagLib@@QBE_NXZ)" in Funktion ""class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > __cdecl Album(class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >)" (?Album@@YA?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@V12@@Z)".	C:\Users\Chef\documents\visual studio 2010\Projects\Gen_Gamp_Lcd\gen_gamp_lcd\Id3Data.obj	gen_gamp_lcd
    Fehler	7	error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""__declspec(dllimport) public: __thiscall TagLib::MPEG::File::File(class TagLib::FileName,bool,enum TagLib::AudioProperties::ReadStyle)" (__imp_??0File@MPEG@TagLib@@QAE@VFileName@2@_NW4ReadStyle@AudioProperties@2@@Z)" in Funktion ""class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > __cdecl Album(class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >)" (?Album@@YA?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@V12@@Z)".	C:\Users\Chef\documents\visual studio 2010\Projects\Gen_Gamp_Lcd\gen_gamp_lcd\Id3Data.obj	gen_gamp_lcd
    Fehler	8	error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""__declspec(dllimport) public: __thiscall TagLib::FileName::FileName(wchar_t const *)" (__imp_??0FileName@TagLib@@QAE@PB_W@Z)" in Funktion ""class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > __cdecl Album(class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >)" (?Album@@YA?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@V12@@Z)".	C:\Users\Chef\documents\visual studio 2010\Projects\Gen_Gamp_Lcd\gen_gamp_lcd\Id3Data.obj	gen_gamp_lcd
    

    Die Cpp file sieht so aus:

    #include <iostream>
    #include <string.h>
    #include <cstring>
    #include <windows.h>
    #include <tchar.h>
    #include <stdio.h>
    #include <stdlib.h>
    #include <wchar.h>
    #include "ID3Data.h"
    #include "taglib\include\taglib\mpeg\mpegfile.h"
    #include "taglib\include\taglib\ape\apetag.h"
    
    using namespace TagLib;
    
    std::wstring Album(std::wstring file){
    	MPEG::File f(file.c_str());
    	if(f.isOpen()){
    		Tag *ape = f.tag();
    		if(ape){
    			return std::wstring(ape->album().begin(),ape->album().end());
    		}
    	}
    	return L"";
    
    }
    

    Grüße



  • Was kommen für Fehler beim Kompilieren der TagLib?



  • Okay, bittesehr:

    C:\Users\Chef\Documents\Visual Studio 2010\taglib-1.6.3\taglib-1.6.3\taglib>g++
    tag.cpp
    In file included from tag.h:29,
                     from tag.cpp:26:
    taglib_export.h:42:27: error: taglib_config.h: No such file or directory
    In file included from tag.cpp:26:
    tag.h:30:21: error: tstring.h: No such file or directory
    In file included from tag.cpp:26:
    tag.h:57: error: 'String' does not name a type
    tag.h:63: error: 'String' does not name a type
    tag.h:69: error: 'String' does not name a type
    tag.h:75: error: 'String' does not name a type
    tag.h:81: error: 'String' does not name a type
    tag.h:86: error: 'uint' does not name a type
    tag.h:92: error: 'uint' does not name a type
    tag.h:98: error: ISO C++ forbids declaration of 'String' with no type
    tag.h:98: error: expected ',' or '...' before '&' token
    tag.h:104: error: ISO C++ forbids declaration of 'String' with no type
    tag.h:104: error: expected ',' or '...' before '&' token
    tag.h:110: error: ISO C++ forbids declaration of 'String' with no type
    tag.h:110: error: expected ',' or '...' before '&' token
    tag.h:116: error: ISO C++ forbids declaration of 'String' with no type
    tag.h:116: error: expected ',' or '...' before '&' token
    tag.h:125: error: ISO C++ forbids declaration of 'String' with no type
    tag.h:125: error: expected ',' or '...' before '&' token
    tag.h:130: error: 'uint' has not been declared
    tag.h:135: error: 'uint' has not been declared
    tag.cpp:35: warning: 'TagLib::Tag::Tag()' redeclared without dllimport attribute
    : previous dllimport ignored
    tag.cpp:40: warning: 'virtual TagLib::Tag::~Tag()' redeclared without dllimport
    attribute: previous dllimport ignored
    tag.cpp:45: warning: 'virtual bool TagLib::Tag::isEmpty() const' redeclared with
    out dllimport attribute: previous dllimport ignored
    tag.cpp: In member function 'virtual bool TagLib::Tag::isEmpty() const':
    tag.cpp:47: error: 'title' was not declared in this scope
    tag.cpp:48: error: 'artist' was not declared in this scope
    tag.cpp:49: error: 'album' was not declared in this scope
    tag.cpp:50: error: 'comment' was not declared in this scope
    tag.cpp:51: error: 'genre' was not declared in this scope
    tag.cpp:52: error: 'year' was not declared in this scope
    tag.cpp:53: error: 'track' was not declared in this scope
    tag.cpp: At global scope:
    tag.cpp:56: warning: 'static void TagLib::Tag::duplicate(const TagLib::Tag*, Tag
    Lib::Tag*, bool)' redeclared without dllimport attribute: previous dllimport ign
    ored
    tag.cpp: In static member function 'static void TagLib::Tag::duplicate(const Tag
    Lib::Tag*, TagLib::Tag*, bool)':
    tag.cpp:59: error: 'const class TagLib::Tag' has no member named 'title'
    tag.cpp:60: error: 'const class TagLib::Tag' has no member named 'artist'
    tag.cpp:61: error: 'const class TagLib::Tag' has no member named 'album'
    tag.cpp:62: error: 'const class TagLib::Tag' has no member named 'comment'
    tag.cpp:63: error: 'const class TagLib::Tag' has no member named 'genre'
    tag.cpp:64: error: 'const class TagLib::Tag' has no member named 'year'
    tag.cpp:65: error: 'const class TagLib::Tag' has no member named 'track'
    tag.cpp:68: error: 'class TagLib::Tag' has no member named 'title'
    tag.cpp:69: error: 'const class TagLib::Tag' has no member named 'title'
    tag.cpp:70: error: 'class TagLib::Tag' has no member named 'artist'
    tag.cpp:71: error: 'const class TagLib::Tag' has no member named 'artist'
    tag.cpp:72: error: 'class TagLib::Tag' has no member named 'album'
    tag.cpp:73: error: 'const class TagLib::Tag' has no member named 'album'
    tag.cpp:74: error: 'class TagLib::Tag' has no member named 'comment'
    tag.cpp:75: error: 'const class TagLib::Tag' has no member named 'comment'
    tag.cpp:76: error: 'class TagLib::Tag' has no member named 'genre'
    tag.cpp:77: error: 'const class TagLib::Tag' has no member named 'genre'
    tag.cpp:78: error: 'class TagLib::Tag' has no member named 'year'
    tag.cpp:79: error: 'const class TagLib::Tag' has no member named 'year'
    tag.cpp:80: error: 'class TagLib::Tag' has no member named 'track'
    tag.cpp:81: error: 'const class TagLib::Tag' has no member named 'track'
    
    C:\Users\Chef\Documents\Visual Studio 2010\taglib-1.6.3\taglib-1.6.3\taglib>
    

    Das ist bei GCC und allen anderen MingW compilern so.
    Wichtig ist halt, dass ich es als .lib bekomme damit ich es in VS nutzen kann.

    /Edit:
    Ich steige einfach auf eine andere Library um. Komischerweise geht TagLib wenn man mein Projekt direkt über g++ Compiled.

    Also, Danke für deine Mühe 🙂 Zum glück passiert sowas am anfang und nicht am ende des Projektes


Anmelden zum Antworten