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. issues in Mongodb driver with Qt creator
QtWS25 Last Chance

issues in Mongodb driver with Qt creator

Scheduled Pinned Locked Moved Unsolved General and Desktop
qtcreator 5.11mingw32bitmingw64mongodbc++17
12 Posts 3 Posters 1.8k 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.
  • V Vivek_A
    16 Aug 2021, 05:44

    Hi, iam facing a issue in linking Mongodb driver with qt creator . i have gone through some of the forum but nothing helps .
    its saying no file found . its a linking error . iam a beginner following are the procedure i did
    1 - build and installed mongodb c &cxx driver with MinGW64
    2- my qt creator version is Qt 5.11.2 (MSVC 2015, 32 bit)
    3 -compiler MinGW 5.3.0 32bit
    is the compiler 32bit makes any problem or linking commad problem in pro file???? please help
    11ea7ab3-1de8-4a20-8d6b-546743f5c357-image.png

    J Offline
    J Offline
    jsulm
    Lifetime Qt Champion
    wrote on 16 Aug 2021, 06:11 last edited by
    #2

    @Vivek_A said in issues in Mongodb driver with Qt creator:

    my qt creator version is Qt 5.11.2

    QtCreator version does not matter. QtCreator is just an IDE.
    What matters is Qt version.
    Did you use exact same compiler to build Mongodb driver as you use to build your app?
    How do you use the Mongodb driver? Please show your pro file.

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

    V 1 Reply Last reply 16 Aug 2021, 08:39
    0
    • J jsulm
      16 Aug 2021, 06:11

      @Vivek_A said in issues in Mongodb driver with Qt creator:

      my qt creator version is Qt 5.11.2

      QtCreator version does not matter. QtCreator is just an IDE.
      What matters is Qt version.
      Did you use exact same compiler to build Mongodb driver as you use to build your app?
      How do you use the Mongodb driver? Please show your pro file.

      V Offline
      V Offline
      Vivek_A
      wrote on 16 Aug 2021, 08:39 last edited by Vivek_A
      #3

      @jsulm .pro file contain
      #-------------------------------------------------

      Project created by QtCreator 2014-02-04T17:25:51

      #-------------------------------------------------
      cache()

      QT += core gui network widgets xml serialport
      greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

      TEMPLATE = app
      TARGET = RTLSController
      QMAKE_INFO_PLIST = Info.plist
      RC_ICONS = res/DWctrler.ico

      INCLUDEPATH += graphics models network views util tools

      QMAKE_LFLAGS+=-Wl,-Map=mapfile

      SOURCES +=
      main.cpp
      models/DataLink.cpp
      models/datamodel.cpp
      models/DataRoot.cpp
      models/ViewSettings.cpp
      mongocxx/events/command_failed_event.cpp
      mongocxx/events/command_started_event.cpp
      mongocxx/events/command_succeeded_event.cpp
      mongocxx/events/heartbeat_failed_event.cpp
      mongocxx/events/heartbeat_started_event.cpp
      mongocxx/events/heartbeat_succeeded_event.cpp
      mongocxx/events/server_changed_event.cpp
      mongocxx/events/server_closed_event.cpp
      mongocxx/events/server_description.cpp
      mongocxx/events/server_opening_event.cpp
      mongocxx/events/topology_changed_event.cpp
      mongocxx/events/topology_closed_event.cpp
      mongocxx/events/topology_description.cpp
      .............................
      ..........................
      .............................

      HEADERS +=
      RTLSControllerApplication.h
      views/mainwindow.h
      views/anchorlistwidget.h
      views/anchorpropertieswidget.h
      views/GraphicsWidget.h
      views/connectionwidget.h
      views/GraphicsView.h
      models/datamodel.h
      models/DataRoot.h
      models/ViewSettings.h
      mongocxx/config/private/postlude.hh
      mongocxx/config/private/prelude.hh
      ..............
      .............................
      ................
      RESOURCES +=
      res/resources.qrc
      LIBS += “C:\mongo-cxx-driver\lib\mongoc-1.0.lib”
      INCLUDEPATH += “C:\mongo-cxx-driver\include\libmongoc-1.0”

      LIBS += “C:\mongo-cxx-driver\lib\bson-1.0.lib”
      INCLUDEPATH += “C:\mongo-cxx-driver\include\bsoncxx\v_noabi\bsoncxx”

      vk

      J 1 Reply Last reply 16 Aug 2021, 09:13
      0
      • V Vivek_A
        16 Aug 2021, 08:39

        @jsulm .pro file contain
        #-------------------------------------------------

        Project created by QtCreator 2014-02-04T17:25:51

        #-------------------------------------------------
        cache()

        QT += core gui network widgets xml serialport
        greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

        TEMPLATE = app
        TARGET = RTLSController
        QMAKE_INFO_PLIST = Info.plist
        RC_ICONS = res/DWctrler.ico

        INCLUDEPATH += graphics models network views util tools

        QMAKE_LFLAGS+=-Wl,-Map=mapfile

        SOURCES +=
        main.cpp
        models/DataLink.cpp
        models/datamodel.cpp
        models/DataRoot.cpp
        models/ViewSettings.cpp
        mongocxx/events/command_failed_event.cpp
        mongocxx/events/command_started_event.cpp
        mongocxx/events/command_succeeded_event.cpp
        mongocxx/events/heartbeat_failed_event.cpp
        mongocxx/events/heartbeat_started_event.cpp
        mongocxx/events/heartbeat_succeeded_event.cpp
        mongocxx/events/server_changed_event.cpp
        mongocxx/events/server_closed_event.cpp
        mongocxx/events/server_description.cpp
        mongocxx/events/server_opening_event.cpp
        mongocxx/events/topology_changed_event.cpp
        mongocxx/events/topology_closed_event.cpp
        mongocxx/events/topology_description.cpp
        .............................
        ..........................
        .............................

        HEADERS +=
        RTLSControllerApplication.h
        views/mainwindow.h
        views/anchorlistwidget.h
        views/anchorpropertieswidget.h
        views/GraphicsWidget.h
        views/connectionwidget.h
        views/GraphicsView.h
        models/datamodel.h
        models/DataRoot.h
        models/ViewSettings.h
        mongocxx/config/private/postlude.hh
        mongocxx/config/private/prelude.hh
        ..............
        .............................
        ................
        RESOURCES +=
        res/resources.qrc
        LIBS += “C:\mongo-cxx-driver\lib\mongoc-1.0.lib”
        INCLUDEPATH += “C:\mongo-cxx-driver\include\libmongoc-1.0”

        LIBS += “C:\mongo-cxx-driver\lib\bson-1.0.lib”
        INCLUDEPATH += “C:\mongo-cxx-driver\include\bsoncxx\v_noabi\bsoncxx”

        J Offline
        J Offline
        jsulm
        Lifetime Qt Champion
        wrote on 16 Aug 2021, 09:13 last edited by jsulm
        #4

        @Vivek_A said in issues in Mongodb driver with Qt creator:

        LIBS += “C:\mongo-cxx-driver\lib\mongoc-1.0.lib”
        INCLUDEPATH += “C:\mongo-cxx-driver\include\libmongoc-1.0”
        LIBS += “C:\mongo-cxx-driver\lib\bson-1.0.lib”
        INCLUDEPATH += “C:\mongo-cxx-driver\include\bsoncxx\v_noabi\bsoncxx”

        Change \ to / and do a complete rebuild.
        Also, please post the error message you get, it is not clear which lib exactly is not found.

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

        V 1 Reply Last reply 16 Aug 2021, 09:38
        0
        • J jsulm
          16 Aug 2021, 09:13

          @Vivek_A said in issues in Mongodb driver with Qt creator:

          LIBS += “C:\mongo-cxx-driver\lib\mongoc-1.0.lib”
          INCLUDEPATH += “C:\mongo-cxx-driver\include\libmongoc-1.0”
          LIBS += “C:\mongo-cxx-driver\lib\bson-1.0.lib”
          INCLUDEPATH += “C:\mongo-cxx-driver\include\bsoncxx\v_noabi\bsoncxx”

          Change \ to / and do a complete rebuild.
          Also, please post the error message you get, it is not clear which lib exactly is not found.

          V Offline
          V Offline
          Vivek_A
          wrote on 16 Aug 2021, 09:38 last edited by Vivek_A
          #5

          @jsulm edited

          LIBS += “/c/mongo-cxx-driver/lib/mongoc-1.0.lib”
          INCLUDEPATH += “/c/mongo-cxx-driver/include/mongocxx/v_noabi/mongocxx”
          
          LIBS += “/c/mongo-cxx-driver/lib/bson-1.0.lib”
          INCLUDEPATH += “/c/mongo-cxx-driver/include/bsoncxx/v_noabi/bsoncxx”
          
          Rebuilded
          error
          

          mingw32-make[1]: *** No rule to make target 'mongocxx/events/command_failed_event.cpp', needed by 'release/command_failed_event.o'. Stop.
          mingw32-make[1]: Leaving directory 'E:/RTLS/build-dw_controller-Desktop_Qt_5_11_2_MinGW_32bit-Release'
          Makefile:36: recipe for target 'release' failed
          mingw32-make: *** [release] Error 2
          15:03:32: The process "C:\Qt\Qt5.11.2\Tools\mingw530_32\bin\mingw32-make.exe" exited with code 2.
          Error while building/deploying project dw_controller (kit: Desktop Qt 5.11.2 MinGW 32bit)
          When executing step "Make"
          15:03:32: Elapsed time: 01:35.

          vk

          J 1 Reply Last reply 16 Aug 2021, 09:43
          0
          • V Vivek_A
            16 Aug 2021, 09:38

            @jsulm edited

            LIBS += “/c/mongo-cxx-driver/lib/mongoc-1.0.lib”
            INCLUDEPATH += “/c/mongo-cxx-driver/include/mongocxx/v_noabi/mongocxx”
            
            LIBS += “/c/mongo-cxx-driver/lib/bson-1.0.lib”
            INCLUDEPATH += “/c/mongo-cxx-driver/include/bsoncxx/v_noabi/bsoncxx”
            
            Rebuilded
            error
            

            mingw32-make[1]: *** No rule to make target 'mongocxx/events/command_failed_event.cpp', needed by 'release/command_failed_event.o'. Stop.
            mingw32-make[1]: Leaving directory 'E:/RTLS/build-dw_controller-Desktop_Qt_5_11_2_MinGW_32bit-Release'
            Makefile:36: recipe for target 'release' failed
            mingw32-make: *** [release] Error 2
            15:03:32: The process "C:\Qt\Qt5.11.2\Tools\mingw530_32\bin\mingw32-make.exe" exited with code 2.
            Error while building/deploying project dw_controller (kit: Desktop Qt 5.11.2 MinGW 32bit)
            When executing step "Make"
            15:03:32: Elapsed time: 01:35.

            J Offline
            J Offline
            jsulm
            Lifetime Qt Champion
            wrote on 16 Aug 2021, 09:43 last edited by
            #6

            @Vivek_A said in issues in Mongodb driver with Qt creator:

            mongocxx/events/command_failed_event.cpp

            Isn't this part of Mongo cxx driver?

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

            V 1 Reply Last reply 16 Aug 2021, 09:56
            0
            • J jsulm
              16 Aug 2021, 09:43

              @Vivek_A said in issues in Mongodb driver with Qt creator:

              mongocxx/events/command_failed_event.cpp

              Isn't this part of Mongo cxx driver?

              V Offline
              V Offline
              Vivek_A
              wrote on 16 Aug 2021, 09:56 last edited by Vivek_A
              #7

              @jsulm sorry for that , i removed some includes .now the error is

              g++: error: “\c\mongo-cxx-driver\lib\mongoc-1.0.lib”: No such file or directory
              g++: error: “\c\mongo-cxx-driver\lib\bson-1.0.lib”: No such file or directory.
              

              i know its not there, in my case in mongodb lib folder there is no .lib file , in above screenshot showing that there is .A file , so how to fix that.

              vk

              S 1 Reply Last reply 16 Aug 2021, 18:03
              0
              • V Vivek_A
                16 Aug 2021, 09:56

                @jsulm sorry for that , i removed some includes .now the error is

                g++: error: “\c\mongo-cxx-driver\lib\mongoc-1.0.lib”: No such file or directory
                g++: error: “\c\mongo-cxx-driver\lib\bson-1.0.lib”: No such file or directory.
                

                i know its not there, in my case in mongodb lib folder there is no .lib file , in above screenshot showing that there is .A file , so how to fix that.

                S Offline
                S Offline
                SGaist
                Lifetime Qt Champion
                wrote on 16 Aug 2021, 18:03 last edited by
                #8

                Hi,

                @Vivek_A said in issues in Mongodb driver with Qt creator:

                mongoc-1.0.lib”: No such file or directory

                You have some strange maybe invisible char(s) in your file.
                Remove them

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                V 1 Reply Last reply 18 Aug 2021, 10:02
                0
                • S SGaist
                  16 Aug 2021, 18:03

                  Hi,

                  @Vivek_A said in issues in Mongodb driver with Qt creator:

                  mongoc-1.0.lib”: No such file or directory

                  You have some strange maybe invisible char(s) in your file.
                  Remove them

                  V Offline
                  V Offline
                  Vivek_A
                  wrote on 18 Aug 2021, 10:02 last edited by Vivek_A
                  #9

                  @SGaist & @jsulm ok, i tried linking lib by this link https://doc.qt.io/qtcreator/creator-project-qmake-libraries.html.

                  after clicking and setting as external library
                  linking code came in pro file like this

                  win32:CONFIG(release, debug|release): LIBS += -LC:/mongo-cxx-driver/lib/ -llibmongocxx.dll
                  else:win32:CONFIG(debug, debug|release): LIBS += -LC:/mongo-cxx-driver/lib/ -llibmongocxx.dlld
                  
                  INCLUDEPATH += C:/mongo-cxx-driver/include
                  DEPENDPATH += C:/mongo-cxx-driver/include
                  
                  

                  after that i added ```
                  #include <mongocxx/client.hpp>

                  in main.cpp but error coming no such file or directory...please check...!!!

                  vk

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on 18 Aug 2021, 19:33 last edited by
                    #10

                    Where is client.hpp located exactly on your disc ?

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    V 1 Reply Last reply 24 Aug 2021, 08:39
                    0
                    • S SGaist
                      18 Aug 2021, 19:33

                      Where is client.hpp located exactly on your disc ?

                      V Offline
                      V Offline
                      Vivek_A
                      wrote on 24 Aug 2021, 08:39 last edited by Vivek_A
                      #11

                      @SGaist @jsulm
                      my compiler is mingw32bit and mongocxx driver build in 64 bit . so thats make problem , i solved it by installing 64bit Qt.
                      Then i started coding i have added all heders and
                      the created application of pushbutton ,. when push button clicked mongodb will insrt data . but when i building and run the app , its closing down.

                      12:49:58: Starting C:\Users\LD-RD2\Documents\build-mongo2-Desktop_Qt_6_1_2_MinGW_64_bit-Debug\debug\mongo2.exe ...
                      12:50:02: The program has unexpectedly finished.
                      12:50:02: The process was ended forcefully.
                      

                      issues

                      :-1: warning: An exception was triggered: 
                      Exception at 0x7ffa8d37d1a0, code: 0xc0000135: DLL not found, flags=0x0.
                      

                      i tested with removing all other mongodb codes and teated with only one statement mongocxx::instance inst; but still same problem.... Any idea???

                      vk

                      1 Reply Last reply
                      0
                      • S Offline
                        S Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on 24 Aug 2021, 19:16 last edited by
                        #12

                        Can the MongoDB dlls be found at run time ?

                        Interested in AI ? www.idiap.ch
                        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                        1 Reply Last reply
                        0

                        11/12

                        24 Aug 2021, 08:39

                        • Login

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