在Windows上将TagLib编译为Qt C ++项目 [英] Compiling TagLib into Qt C++ Project on Windows
问题描述
我正在使用TagLibSharp在我的旧项目中,我正在尝试从C#移动,从我的平台边界脱离使用Qt / C ++。但我现在尝试使用这里找到的原始C ++源代码:
http://developer.kde.org/~wheeler/taglib.html
我在一个受伤的世界试图编译到我的应用程序。这个基于Linux的C ++大多数对我来说是愚蠢的,我不知道如何正确地包括这个库到我的项目与Qt。我使用Qt Creator的大部分工作(可能的一切)。
任何人都可以指点我一些有用的教程或指南?任何事情,帮助我了解我甚至与这个源做什么将非常感谢。我对C#和Windows编程有一个非常透彻的理解,但是我对这些类型的开源项目并没有很好的处理。
谢谢!
编辑 - 这里的答案
我决定发布另一个问题,
http://stackoverflow.com/questions/3878883/compiling-static-taglib-1-6-3-libraries-for-windows
em> 一些旧的编辑...
现在我已经使用Qt编译TagLib,错误。
* .pro
INCLUDEPATH + = ../$${TARGET}/taglib-win32
LIBS + = -L.. \\ $$ {TARGET} \\taglib-win32
LIBS + = -llibtag #It似乎想要这是一个* .dll,而不是* .a?
DEFINES + = TAGLIB_NO_CONFIG
* .cpp >
#include< tag.h>
#include< fileref.h>
...
//这些都不起作用,即使它们类似于TagLib源中给出的示例。
TagLib :: FileRef f(03.flac);
TagLib :: String test = f.tag() - > album();
TagLib :: FileName * n = new TagLib :: FileName(test);
TagLib :: FileRef * f = new TagLib :: FileRef();
以下是一些确切错误的示例:
./ debug\mythread.o:C:\Users\jocull\Documents\My Dropbox\Code\QT\QtTrayTime-build-desktop / ../QtTrayTime/mythread.cpp:20:未定义引用`_imp___ZN6TagLib7FileRefC1ENS_8FileNameEbNS_15AudioProperties9ReadStyleE'
./debug\mythread.o:C:\Users\jocull\Documents\My Dropbox\Code\ QT \QtTrayTime-build-desktop /../ QtTrayTime / mythread.cpp:21:未定义引用`_imp___ZNK6TagLib7FileRef3tagEv'
./debug\mythread.o:C:\Users\jocull\Documents \My Dropbox \Code\QT\QtTrayTime-build-desktop /../ QtTrayTime / mythread.cpp:42:未定义的引用`_imp___ZN6TagLib6StringD1Ev'
./debug\mythread.o:C: \Users\jocull\Documents\My Dropbox\Code\QT\QtTrayTime-build-desktop /../ QtTrayTime / mythread.cpp:42:未定义的引用`_imp___ZN6TagLib7FileRefD1Ev'
collect2: ld return 1 exit status
使用g ++(Mac / Linux)执行命令行步骤
- ./ configure --enable-shared = false --enable-static = true
- make
- ?没有* .a或* .lib档案建立
a href =http://joelverhagen.com/blog/2010/11/how-to-compile-taglib-on-windows/ =nofollow>此信息。我已经概述了如何通过Windows 7 QtCreator编译TagLib。
I am currently trying to make the move from C# and break free from my platform boundaries by using Qt / C++.
I was using TagLibSharp in my old project, but I'm now trying to use the original C++ source found here:
http://developer.kde.org/~wheeler/taglib.html
I am in a world of hurt trying to compile this into my application. Most of this Linux based C++ is gibberish to me and I don't know how to properly include this library into my project with Qt. I'm using Qt Creator for the bulk of my work (everything I possibly can).
Can anyone please point me to some helpful tutorial or guides? Anything to help me understand what I am even doing with this source would be greatly appreciated. I have a very thorough understanding of C# and Windows programming, but I don't exactly have a good handle on what I'm doing with these types of open source projects.
Thanks!
EDIT - THE ANSWER IS HERE I decided to post another question that was a bit more refined for it.
http://stackoverflow.com/questions/3878883/compiling-static-taglib-1-6-3-libraries-for-windows
Some older edits...
I now have TagLib compiled with Qt, but am running into "Undefined reference" errors.
*.pro
INCLUDEPATH += ../$${TARGET}/taglib-win32
LIBS += -L"..\\$${TARGET}\\taglib-win32"
LIBS += -llibtag #It seems to want this to be a *.dll, not a *.a?
DEFINES += TAGLIB_NO_CONFIG
*.cpp
#include <tag.h>
#include <fileref.h>
...
//None of these work, even though they are similar to examples given in TagLib source.
TagLib::FileRef f("03.flac");
TagLib::String test = f.tag()->album();
TagLib::FileName *n = new TagLib::FileName("test");
TagLib::FileRef *f = new TagLib::FileRef();
Here are some examples of the exact errors:
./debug\mythread.o:C:\Users\jocull\Documents\My Dropbox\Code\QT\QtTrayTime-build-desktop/../QtTrayTime/mythread.cpp:20: undefined reference to `_imp___ZN6TagLib7FileRefC1ENS_8FileNameEbNS_15AudioProperties9ReadStyleE'
./debug\mythread.o:C:\Users\jocull\Documents\My Dropbox\Code\QT\QtTrayTime-build-desktop/../QtTrayTime/mythread.cpp:21: undefined reference to `_imp___ZNK6TagLib7FileRef3tagEv'
./debug\mythread.o:C:\Users\jocull\Documents\My Dropbox\Code\QT\QtTrayTime-build-desktop/../QtTrayTime/mythread.cpp:42: undefined reference to `_imp___ZN6TagLib6StringD1Ev'
./debug\mythread.o:C:\Users\jocull\Documents\My Dropbox\Code\QT\QtTrayTime-build-desktop/../QtTrayTime/mythread.cpp:42: undefined reference to `_imp___ZN6TagLib7FileRefD1Ev'
collect2: ld returned 1 exit status
Command line steps using g++ (Mac/Linux)
- ./configure --enable-shared=false --enable-static=true
- make
- ??? No *.a or *.lib files created
For future reference, check out this post. I've outlined how I compiled TagLib through Windows 7 QtCreator.
这篇关于在Windows上将TagLib编译为Qt C ++项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!