问题描述
这里有没有人使用不带xcode的标准Qt工具链在MacOS上成功构建Google Breakpad?
Is here anyone who successfully build Google Breakpad on MacOS using standard Qt tool chain without xcode?
我正在尝试使该库工作两天,但仍然没有成功.我已经成功编译了它,并在Windows和Linux上运行了它. (来自原始的Google-git存储库).
I'm trying to get work this library for two days now and still without success. I already successfully compiled it and ran it on Windows and Linux. (from original Google-git repository).
但是MacOS版本的库缺少 libbreakpad_client.a 的makefile,并且生成的 libbreakpad.a 不包含异常处理程序.
But MacOS version of library has missing makefile for libbreakpad_client.a and generated libbreakpad.a does not contain the exception handler.
http://screencast.com/t/V0mNiM3kZ
我在此处找到了关于此问题的几个主题,但是有关更新的Makefile的建议对我不起作用(或者我没有正确复制Makefile).
I found few topic about this issue on here on a stackoverflow but advice with updated makefiles didn't work for me (or I didn't copy makefiles correctly).
我还尝试直接从Mozilla存储库(版本10和11beta)下载更新版本.但是,当我尝试编译Mozilla版本时,还有另一个未定义符号的错误(在Mac和Linux上).
I also tried to download updated version directly from Mozilla repository (version 10 and 11beta). But when I tried to compile Mozilla version, there was another errors with undefined symbols (on Mac and also on Linux).
我还找到了 AlekSi-breakpad-qt ,但此版本也只能在Win下正常工作和Linux.在Mac下,存在一些有关未知体系结构-您在PDP-11上吗?"的错误.
I also found AlekSi - breakpad-qt but this version also works correctly only under Win and Linux. Under Mac there is some errors about "Unknown architecture -- are you on a PDP-11?"
我将感谢任何能为我指出如何在Mac上进行编译并使其正常工作的人,或者向我发送打包版的breakpad的人,这些打包版可以在MacOS下使用标准的make进行编译并在Qt应用程序中使用.
I will be gratitude to anyone who can point me how to compile it and get it work under Mac or who can send me a packed version of breakpad which can be compiled under MacOS using standard make and used in Qt application.
谢谢卢德克
推荐答案
AlekSi的breakpad-qt已有3年历史,并且其中的breakpad源不支持OSX上的64位.
AlekSi's breakpad-qt is three years old, and the breakpad source in it doesn't support 64 bits on OSX.
未能检测到处理器类型的原因是它抱怨架构未知-您在PDP-11上吗?".
Failing to detect your processor type is what makes it complain about "Unknown architecture -- are you on a PDP-11?".
您肯定需要更新的Breakpad版本,无论是其svn还是我的breakpad-qt fork: https://github.com/webitup/qt-breakpad
You definitely need a more recent breakpad version, either from their svn, or from my breakpad-qt fork at: https://github.com/webitup/qt-breakpad
现在,如果您还打算支持10.6(MACOSX_DEPLOYMENT_TARGET = 10.6),则需要使用此 https://github.com/webitup/qt-breakpad/commit/71a9fdedd827e5939ba66bfcc0cd6c1c9fbbc87b (->我不认为10.6支持PPC)
Now, if you intend on supporting 10.6 (MACOSX_DEPLOYMENT_TARGET=10.6) as well, you need to patch breakpad source using this https://github.com/webitup/qt-breakpad/commit/71a9fdedd827e5939ba66bfcc0cd6c1c9fbbc87b (-> I don't think 10.6 has PPC support)
然后:
您显然设法直接从源代码进行编译,因此,这样做很有益.
You apparently managed to compile directly from source, so, good for that way.
现在,如果您想改用breakpad构建框架,并从qt app/lib链接到该框架,则Dave Mateer的建议是可行的方法(他值得赞扬).以下对我有用:
Now, if you want to build a framework from breakpad instead, and link to that from your qt app/lib, then Dave Mateer suggestion is the way to go (and he deserves the credit). The following worked for me:
cd $BREAKPAD_SOURCE_TREE
xcodebuild -sdk macosx10.7 -project src/client/mac/Breakpad.xcodeproj -configuration Release -target Breakpad ARCHS=x86_64 ONLY_ACTIVE_ARCH=YES MACOSX_DEPLOYMENT_TARGET=10.6 GCC_VERSION=com.apple.compilers.llvmgcc42
请注意,我只是在构建目标Breakpad而不是All(似乎只需要它-尽管使用All会产生任何可用的框架,但是使用All进行的测试对我来说是失败的).
Note that I'm only building target Breakpad instead of All (it seems you only need that - and a test is failing for me using All, though it does produce a usable framework either way).
请注意,您本身不需要XCode-只需命令行即可构建工具.
And note that you don't require XCode per-se - just the command line builds tools.
为了在您的QT项目中使用该框架,
In order to use that framework in your QT project:
mac {
QMAKE_LFLAGS += -F$$BREAKPAD_PATH/client/mac/build/Release/
LIBS += -framework Breakpad
}
您应该被设置.
最后:我还对breakpad-qt fork源本身进行了一些更改,以使其至少可以在OSX上针对更新的Breakpad版本进行编译,但是我还不知道还如果它正常工作.
Finally: I also pushed a number of changes in my breakpad-qt fork source itself to have it at least compile (on OSX!) against the updated breakpad version, but I have no idea yet if it does work properly.
我只是从那个分支开始-如果您想分享经验和/或在其中做出一些贡献,只需问一问.
I'm just starting with that fork - if you want to share experience and/or commit some stuff in there, just ask.
这篇关于Qt,Google BreakPad和MacOs的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!