0

我正在努力为我正在进行的项目创建一个使用 C++ 编程将歌词嵌入 *.mp3 文件的程序。经过搜索,我找到了一个名为“ TAGLIB ”的库,可以处理 ID3v2.3 标准元数据。根据 LIBTAG 安装指南,我运行了 CMAKE 并配置了 like this imagethis image并使用 mingw 构建

C:\Desktop\taglib> mingw32-makeC:\Desktop\taglib> mingw32-make install

我得到了这个文件夹C:\Program Files (x86)\taglib,里面有内容,包括,

bin\libtag.dll
bin\libtag_c.dll
bin\libtag_c.dll

include\*.h files

lib\pkgconfig\taglib.pc
lib\pkgconfig\taglib_c.pc
lib\libtag.a
lib\libtag.dll.a
lib\libtag_c.dll.a

在 Codeblocks 中,我将搜索目录链接和配置libtag.a到当前项目,libtag.dll.a并对当前项目执行相同操作。但是编译器多次给出这种类型的错误libtag_c.dll.aC:\Program Files (x86)\taglib

undefined reference to _imp___ZN6TagLib6StringC1EPKcNS0_4TypeE'|

当我尝试编译库提供的示例代码时。

然后我用来GCC编译代码。但是这次没有运气..

C:\Program Files (x86)\taglib>gcc -o f.exe framelist.cpp -L"C:/Program Files (x86)/taglib/lib/" -libta.a -I"C:/Program Files (x86)/taglib/include/taglib"

收到此错误:

`
framelist.cpp:32:10: error: #include expects "FILENAME" or <FILENAME>
 #include C:/Program Files (x86)/taglib/include/taglib/id3v2tag.h>
          ^
framelist.cpp: In function 'int main(int, char**)':
framelist.cpp:59:23: error: invalid use of incomplete type 'class TagLib::ID3v2:
:Tag'
            << id3v2tag->header()->majorVersion()
                       ^
In file included from framelist.cpp:30:0:
C:/Program Files (x86)/taglib/include/taglib/mpegfile.h:37:27: note: forward dec
laration of 'class TagLib::ID3v2::Tag'
   namespace ID3v2 { class Tag; class FrameFactory; }
                           ^
framelist.cpp:61:23: error: invalid use of incomplete type 'class TagLib::ID3v2:
:Tag'
            << id3v2tag->header()->revisionNumber()
                       ^
In file included from framelist.cpp:30:0:
C:/Program Files (x86)/taglib/include/taglib/mpegfile.h:37:27: note: forward dec
laration of 'class TagLib::ID3v2::Tag'
   namespace ID3v2 { class Tag; class FrameFactory; }
                           ^
framelist.cpp:63:23: error: invalid use of incomplete type 'class TagLib::ID3v2:
:Tag'
            << id3v2tag->header()->tagSize()
                       ^
In file included from framelist.cpp:30:0:
C:/Program Files (x86)/taglib/include/taglib/mpegfile.h:37:27: note: forward dec
laration of 'class TagLib::ID3v2::Tag'
   namespace ID3v2 { class Tag; class FrameFactory; }
                           ^
framelist.cpp:67:14: error: 'TagLib::ID3v2::FrameList' has not been declared
       ID3v2::FrameList::ConstIterator it = id3v2tag->frameList().begin();
              ^
framelist.cpp:68:13: error: 'it' was not declared in this scope
       for(; it != id3v2tag->frameList().end(); it++)
             ^
framelist.cpp:68:27: error: invalid use of incomplete type 'class TagLib::ID3v2:
:Tag'
       for(; it != id3v2tag->frameList().end(); it++)
                           ^
In file included from framelist.cpp:30:0:
C:/Program Files (x86)/taglib/include/taglib/mpegfile.h:37:27: note: forward dec
laration of 'class TagLib::ID3v2::Tag'
   namespace ID3v2 { class Tag; class FrameFactory; }
                           ^
`

如您所知,我对添加外部库还很陌生,请帮我弄清楚,如何正确安装“LIBTAG”以开始在 Codeblocks 中编码。

4

0 回答 0