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.
  • Vivek_AV Offline
    Vivek_AV Offline
    Vivek_A
    wrote on last edited by Vivek_A
    #1

    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

    vk

    jsulmJ 1 Reply Last reply
    0
    • Vivek_AV Vivek_A

      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

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on 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

      Vivek_AV 1 Reply Last reply
      0
      • jsulmJ jsulm

        @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.

        Vivek_AV Offline
        Vivek_AV Offline
        Vivek_A
        wrote on 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

        jsulmJ 1 Reply Last reply
        0
        • Vivek_AV Vivek_A

          @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”

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on 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

          Vivek_AV 1 Reply Last reply
          0
          • jsulmJ jsulm

            @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.

            Vivek_AV Offline
            Vivek_AV Offline
            Vivek_A
            wrote on 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

            jsulmJ 1 Reply Last reply
            0
            • Vivek_AV Vivek_A

              @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.

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on 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

              Vivek_AV 1 Reply Last reply
              0
              • jsulmJ jsulm

                @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?

                Vivek_AV Offline
                Vivek_AV Offline
                Vivek_A
                wrote on 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

                SGaistS 1 Reply Last reply
                0
                • Vivek_AV Vivek_A

                  @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.

                  SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 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

                  Vivek_AV 1 Reply Last reply
                  0
                  • SGaistS SGaist

                    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

                    Vivek_AV Offline
                    Vivek_AV Offline
                    Vivek_A
                    wrote on 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
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on 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

                      Vivek_AV 1 Reply Last reply
                      0
                      • SGaistS SGaist

                        Where is client.hpp located exactly on your disc ?

                        Vivek_AV Offline
                        Vivek_AV Offline
                        Vivek_A
                        wrote on 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
                        • SGaistS Offline
                          SGaistS Offline
                          SGaist
                          Lifetime Qt Champion
                          wrote on 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

                          • Login

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