Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Linking static library for BugSplat fails
QtWS25 Last Chance

Linking static library for BugSplat fails

Scheduled Pinned Locked Moved General and Desktop
6 Posts 3 Posters 1.5k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    SebastianS
    wrote on last edited by
    #1

    Hy folks,

    I am trying to include BugSplat into my project. I use Qt Creator for development and followed the instructions from the link.

    When I want to build the project, I get the following error:

    main.cpp:27: Fehler: undefined reference to `_imp___ZN13MiniDmpSenderC1EPKwS1_S1_S1_m'
    

    Here is the project file:

    QT       += core gui sql network
    
    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    
    TARGET = Mars
    TEMPLATE = app
    CONFIG += c++11
    
    SOURCES +=\
        main.cpp \
        ...
    
    HEADERS  += \
        ...
        ../BugSplat/inc/BugSplat.h
    
    win32 {
        RC_FILE = Mars.rc
        QMAKE_CXXFLAGS *= -fstack-protector-all --param ssp-buffer-size=1
        QMAKE_LFLAGS *= -fstack-protector-all --param ssp-buffer-size=1
    }
    
    DEFINES += QT_NO_DEBUG_OUTPUT \
               QT_NO_WARNING_OUTPUT
    
    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../BugSplat/lib/ -lBugSplat
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../BugSplat/lib/ -lBugSplat
    
    INCLUDEPATH += $$PWD/../BugSplat
    DEPENDPATH += $$PWD/../BugSplat
    
    win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/../BugSplat/lib/BugSplat.lib
    else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/../BugSplat/lib/BugSplat.lib
    

    And here is the main.cpp:

    #include "../BugSplat/inc/BugSplat.h"
    
    int main(int argc, char *argv[])
    {
        // BugSplat initialization
        QString sApp = "TestName";
        wchar_t *app = new wchar_t[sApp.size() + 1];
        sApp.toWCharArray(app);
    
        QString sDataBase = "TestDataBase";
        wchar_t *dataBase = new wchar_t[sDataBase.size() + 1];
        sDataBase.toWCharArray(dataBase);
    
        QString sVersion = QString(GLOBAL_MARS_VERSION);
        wchar_t *version = new wchar_t[sVersion.size() + 1];
        sVersion.toWCharArray(version);
    
        MiniDmpSender *mpSender = new MiniDmpSender(app, dataBase, version, NULL);
        ...
    }
    
    

    I really got stucked there. I am using MinGW 4.9.2 as compiler.

    Please give some ideas to solve this issue!

    jsulmJ 1 Reply Last reply
    0
    • S SebastianS

      Hy folks,

      I am trying to include BugSplat into my project. I use Qt Creator for development and followed the instructions from the link.

      When I want to build the project, I get the following error:

      main.cpp:27: Fehler: undefined reference to `_imp___ZN13MiniDmpSenderC1EPKwS1_S1_S1_m'
      

      Here is the project file:

      QT       += core gui sql network
      
      greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
      
      TARGET = Mars
      TEMPLATE = app
      CONFIG += c++11
      
      SOURCES +=\
          main.cpp \
          ...
      
      HEADERS  += \
          ...
          ../BugSplat/inc/BugSplat.h
      
      win32 {
          RC_FILE = Mars.rc
          QMAKE_CXXFLAGS *= -fstack-protector-all --param ssp-buffer-size=1
          QMAKE_LFLAGS *= -fstack-protector-all --param ssp-buffer-size=1
      }
      
      DEFINES += QT_NO_DEBUG_OUTPUT \
                 QT_NO_WARNING_OUTPUT
      
      win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../BugSplat/lib/ -lBugSplat
      else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../BugSplat/lib/ -lBugSplat
      
      INCLUDEPATH += $$PWD/../BugSplat
      DEPENDPATH += $$PWD/../BugSplat
      
      win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/../BugSplat/lib/BugSplat.lib
      else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/../BugSplat/lib/BugSplat.lib
      

      And here is the main.cpp:

      #include "../BugSplat/inc/BugSplat.h"
      
      int main(int argc, char *argv[])
      {
          // BugSplat initialization
          QString sApp = "TestName";
          wchar_t *app = new wchar_t[sApp.size() + 1];
          sApp.toWCharArray(app);
      
          QString sDataBase = "TestDataBase";
          wchar_t *dataBase = new wchar_t[sDataBase.size() + 1];
          sDataBase.toWCharArray(dataBase);
      
          QString sVersion = QString(GLOBAL_MARS_VERSION);
          wchar_t *version = new wchar_t[sVersion.size() + 1];
          sVersion.toWCharArray(version);
      
          MiniDmpSender *mpSender = new MiniDmpSender(app, dataBase, version, NULL);
          ...
      }
      
      

      I really got stucked there. I am using MinGW 4.9.2 as compiler.

      Please give some ideas to solve this issue!

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @SebastianS Which compiler was used to build that static library?
      I'm asking because you cannot mix different compiler in same project (even not different versions of Visual C++ compiler).

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      2
      • S Offline
        S Offline
        SebastianS
        wrote on last edited by
        #3

        Thanks @jsulm , the library was likely built with a Visual C++ compiler. So there is no change to include this in my project then?

        jsulmJ 1 Reply Last reply
        0
        • S SebastianS

          Thanks @jsulm , the library was likely built with a Visual C++ compiler. So there is no change to include this in my project then?

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @SebastianS Not if you want to use MinGW. You either change to same Visual C++ compiler or get this library built with MinGW.

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          1
          • S Offline
            S Offline
            SebastianS
            wrote on last edited by
            #5

            @jsulm Ok, I will see if switching to Visual C++ is not too uncomfortable and give it a try. Thanks a lot!

            mrjjM 1 Reply Last reply
            0
            • S SebastianS

              @jsulm Ok, I will see if switching to Visual C++ is not too uncomfortable and give it a try. Thanks a lot!

              mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @SebastianS

              Hi. Please notice you will need to download a new Qt for VS. ( match version . 2013 / 2015)

              You can setup Creator to use visual studio as compiler so there be
              no change in that regards.

              1 Reply Last reply
              2

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved