Results 1 to 3 of 3

Thread: linking google breakpad lib in our Qt app on Windows gives Unresolved external symbol

  1. #1
    Join Date
    Aug 2010
    Posts
    8
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default linking google breakpad lib in our Qt app on Windows gives Unresolved external symbol

    We have google breakpad compiled a Windows 7 64-bit desktop and Windows 7 32-bit laptop, both using Visual Studio 2008. We are trying to compile our Qt 4 app to include breakpad. Here’s the pertinent section of the .pro file:

    INCLUDEPATH += ./third_party/google_breakpad/src

    linux-g++:LIBS += -L$${PWD}/third_party/build/google_breakpad/$${BUILD_MODE}/src/client/linux -lbreakpad_client
    win32:LIBS += -L$${PWD}/third_party/google_breakpad/src/client/windows/Debug/lib -lexception_handler -lcrash_generation_client -lcommon

    It compiles, but when we link, we get:
    main.obj:: error: unresolved external symbol “public: __thiscall google_breakpad::ExceptionHandler::ExceptionHandle r(class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > const &,bool (__cdecl*)(void ,struct EXCEPTION_POINTERS *,struct MDRawAssertionInfo *),bool (_cdecl)(unsigned short const *,unsigned short const *,void *,struct _EXCEPTION_POINTERS *,struct MDRawAssertionInfo *,bool),void *,int)” (??0ExceptionHandler@google_breakpad@@QAE@ABV?$bas ic_string@GU?$char_traits@G@std@@V?$allocator@G@2@ @std@@P6A_NPAXPAU_EXCEPTION_POINTERS@@PAUMDRawAsse rtionInfo@@@ZP6A_NPBG5123_N@Z1H@Z) referenced in function _main

    We’ve verified the constructor signature using dumpbin. We’ve also tried bringing our app into Visual Studio 2008 using the Qt plugin and we get the same error. Any ideas? Thanks!

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: linking google breakpad lib in our Qt app on Windows gives Unresolved external sy

    This problem is unrelated to Qt, moving the thread to a more appropriate forum.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Aug 2010
    Posts
    8
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: linking google breakpad lib in our Qt app on Windows gives Unresolved external sy

    Sorry, I didn't know it wasn't a Qt issue - I'm new to C++ and Qt. We found an answer:

    The issue is that the Google Breakpad library is compiled with "Treat wchar_t as Built-in Type" enabled (/Zc:wchar_t). Qt compiles with that option disabled (/Zc:wchar_t-). This means that at compile time, everything matches up: the std::wstring is defined in terms of unsigned short, which is what Qt expects. But at link time, the Breakpad library has defined wstring in terms of __wchar_t (or wchar_t). The effect is that the linker cannot resolve your call to their function, since the parameter types to not match (at link time.)

    The solution is to either:

    • disable the "Treat wchar_t as Built-in Type" in the Google Breakpad library (under Configuration Properties > C/C++ > Language.
    • enable the option in Qt (remove /Zc:wchar_t-)

    For more information:
    http://msdn.microsoft.com/en-us/libr...(v=VS.90).aspx

Similar Threads

  1. Replies: 4
    Last Post: 5th January 2011, 15:51
  2. unresolved external symbol __imp__GetKeyState@4
    By TriKri in forum Qt Programming
    Replies: 0
    Last Post: 10th May 2010, 11:35
  3. unresolved external symbol
    By gridolfi in forum Qt Programming
    Replies: 1
    Last Post: 8th September 2009, 17:58
  4. unresolved external symbol
    By tgreaves in forum Qt Programming
    Replies: 2
    Last Post: 16th January 2009, 19:49
  5. Unresolved External Symbol
    By munna in forum General Discussion
    Replies: 1
    Last Post: 10th May 2006, 19:25

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.