为Windows编译静态TagLib 1.6.3库 [英] Compiling static TagLib 1.6.3 libraries for Windows

查看:721
本文介绍了为Windows编译静态TagLib 1.6.3库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个超级难的时间编译和使用TagLib 1.6.3在我的Qt项目。我试过了我能想到的一切。 TagLib声称它是通过CMake支持,但我没有任何运气。此外,我很困惑什么类型的文件,我甚至需要我的Qt库!

I am having a super hard time compiling and using TagLib 1.6.3 in my Qt project. I've tried everything I can think of. TagLib claims that it is supported through CMake but I'm not having any luck. Furthermore, I'm confused about what kinds of files I even need for my Qt libs!

我已经构建了* .a文件,* .lib和*。 dll。从我到目前为止的了解...我相信,因为我在Windows * .lib工作是我想要的。不管我做什么,我总是最终得到对我尝试编译我的Qt项目时尝试使用的任何TagLib函数的未定义的引用。我试过MinGW32,MSYS,Visual Studio 2008,甚至在Linux上的Windows的交叉编译。

I've built *.a files, *.lib, and *.dll. From what I understand thus far... I believe that since I'm working in Windows *.lib is what I want. No matter what I do, I always end up with "undefined references" to any TagLib functions I try to use when I try to compile my Qt project. I have tried MinGW32, MSYS, Visual Studio 2008, and even cross-compiling for Windows on Linux. All turning up nothing.

对我来说更不重要的是,如果我在Mac上使用Qt编译相同的TagLib源代码(g ++我认为?)它工作正常!在我的Windows编译过程中的某个地方我必须出错。

What makes even less sense to me is that if I compile the same TagLib source with Qt on Mac (g++ I think?) it works fine! Somewhere in my Windows compilation procedures I have to be going wrong. I have been smacking my face on my desk for probably about 30 (on and off) hours trying to figure this out.

因为Qt使用minGW,我必须用TagLib编译器来编译TagLib相同的编译器?

Since Qt uses minGW must I compile TagLib with the same compiler?

如果我使用Visual Studio编译* .lib,它们不兼容?

If I compile *.lib's with Visual Studio are they not compatible?

Are *。一个库甚至可以在Windows中使用? (假设minGW)

Are *.a libraries even usable in Windows? (assuming minGW)

我仍然试图获得这个C ++东西的句柄,但阅读无数的论坛主题和其他问题后,我还是来了。这是我一直在CMake目前工作...

I'm still trying to get a handle on this C++ stuff, but after reading countless forum threads and other questions I'm still coming up short. Here is what I have been working with in CMake currently...

cmake -G "MinGW Makefiles" -DENABLE_STATIC=ON -DHAVE_ZLIB=0 -DWITH_MP4=1 -DMAKE_TAGLIB_LIB=1
cmake --build ./

这将生成一个大小为2MB的单个* .a文件。 Mac上的工作库是〜3MB,而Visual Studio的* .lib在发布模式下约为4MB。请有人救我从这个C ++跨平台命令行疯狂,因为我在我的机智的尽头。我可能甚至会付给你只是编译我一些%!$#&的库。感谢。

This generates a single *.a file of ~2MB in size. The working library on Mac was ~3MB, and the *.lib from Visual Studio was ~4MB in Release mode. Please someone save me from this C++ cross platform command line madness because I am at my wit's end. I would probably even pay you to just compiling me some %!$#&ing libraries. Thanks.

推荐答案

由于Mac为您工作,我只是在谈论Win32。

Since Mac works for you, I'm just talking about Win32.

好吧,这是我的Taglib.pro和我的project.pro的摘录: https:// gist.github.com/449ea81ce92f52399f41 。去看一下。我的Taglib可能有点过时,所以小心,一些文件,你可能有可能丢失那里。还要照顾相对路径。它们都是相对于.pro文件。

Ok, this are my Taglib.pro and an excerpt of my project.pro: https://gist.github.com/449ea81ce92f52399f41. Check them out. My Taglib may be a bit outdated, so take care, some files you may have could be missing there. Also take care of the relative paths. They are all relative to the .pro file.

我只是在taglib目录中运行 cmake。。这将导致 config.h taglib_config.h

I just ran cmake . inside the taglib directory. This should result in a config.h and a taglib_config.h

当你使用QtCreator和mingw-gcc时,你只需要 libTaglib.a 。 * .lib是MSVC特有的!

You definitly only need the libTaglib.a when you use QtCreator and mingw-gcc. *.lib are MSVC specific!

这篇关于为Windows编译静态TagLib 1.6.3库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆