小编use*_*569的帖子

将Qt应用程序链接到Google Breakpad时出现未解决的符号错误

我试图将我的Qt应用程序静态链接到Windows下的Google Breakpad,但我总是得到未解决的符号错误.我正在使用qmake和VC++ 2008,我的项目文件似乎有些问题.似乎链接器忽略了我的LIBS规范,因为无论我是否将库添加到LIBS,我都会收到错误.

我用以下方法编译了Breakpad:

vcbuild /platform:Win32
Run Code Online (Sandbox Code Playgroud)

Google Breakpead在src\processor\test_app.cc中包含一个示例.如果我按照建议编译它,一切都很顺利:

C:\test>cl /Zi test_app.cc /Fetest_app.exe /I C:\google-breakpad\src C:\google-breakpad\src\client\windows\Release\lib\exception_handler.lib C:\google-breakpad\src\client\windows\Release\lib\crash_generation_client.lib C:\google-breakpad\src\client\windows\Release\lib\common.lib
Run Code Online (Sandbox Code Playgroud)

但是,如果我尝试使用类似的.pro文件使用qmake构建它,我会得到相同的未解决的符号错误.这是我用来的.pro文件:

TEMPLATE = app
TARGET = 
DEPENDPATH += .
INCLUDEPATH += .
INCLUDEPATH += C:/google-breakpad/src
SOURCES += test_app.cc

LIBS += C:/google-breakpad/src/client/windows/Release/lib/exception_handler.lib
LIBS += C:/google-breakpad/src/client/windows/Release/lib/crash_generation_client.lib
LIBS += C:/google-breakpad/src/client/windows/Release/lib/common.lib
PRE_TARGETDEPS += C:/google-breakpad/src/client/windows/Release/lib/exception_handler.lib
PRE_TARGETDEPS += C:/google-breakpad/src/client/windows/Release/lib/crash_generation_client.lib
PRE_TARGETDEPS += C:/google-breakpad/src/client/windows/Release/lib/common.lib
Run Code Online (Sandbox Code Playgroud)

建立它:

C:\test>qmake -config release

C:\test>nmake

Microsoft (R) Program Maintenance Utility Version 9.00.21022.08
Copyright (C) Microsoft Corporation.  All rights reserved.

        "C:\Program files\Microsoft Visual Studio 9.0\VC\BIN\nmake.exe" -
f Makefile.Release …
Run Code Online (Sandbox Code Playgroud)

qmake linker-errors visual-studio-2008 google-breakpad

4
推荐指数
1
解决办法
1876
查看次数