Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. Building mongodb drivers for qt6.5
Forum Updated to NodeBB v4.3 + New Features

Building mongodb drivers for qt6.5

Scheduled Pinned Locked Moved Unsolved 3rd Party Software
1 Posts 1 Posters 426 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.
  • A Offline
    A Offline
    A K A S H
    wrote on last edited by
    #1

    Hello,

    I have a working application on Qt 5.15 that I am trying to port over to Qt 6.5, but I am unsuccessful in figuring out how to configure cmake for minGW Qt 6.5.

    C Driver-----------------------------------------------------------------------------------------------
    in CMakeLists.txt I have added the following lines

    set(CMAKE_C_COMPILER "C:/Qt/Tools/mingw1120_64/bin/gcc.exe")
    set(CMAKE_CXX_COMPILER "C:/Qt/Tools/mingw1120_64/bin/g++.exe")
    

    To make the C Driver i use this command

    C:/Qt/Tools/CMake_64/bin/cmake.exe .. -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release -DBUILD_VERSION="1.23.4" -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF -DENABLE_EXTRA_ALIGNMENT=0 -DCMAKE_INSTALL_PREFIX=C:/Users/mycomputer/Desktop/BuildingSpot/install
    

    Followed by

    C:/Qt/Tools/CMake_64/bin/cmake.exe --build . --target install
    

    Cxx driver------------------------------------------------------------------------------------------------
    in CMakeLists.txt I have added the following lines

    set(CMAKE_C_COMPILER "C:/Qt/Tools/mingw1120_64/bin/gcc.exe")
    set(CMAKE_CXX_COMPILER "C:/Qt/Tools/mingw1120_64/bin/g++.exe")
    

    And i tried 2 ways of making the cxx driver, one with boost

    C:/Qt/Tools/CMake_64/bin/cmake.exe .. -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release -DBSONCXX_POLY_USE_BOOST=1 -DBUILD_VERSION="3.7.1" -DBOOSTROOT=C:/boost/boost_1_82_0 -DCMAKE_PREFIX_PATH=C:/Users/mycomputer/Desktop/BuildingSpot/install -DCMAKE_INSTALL_PREFIX=C:/Users/mycomputer/Desktop/BuildingSpot/install2
    

    and one without boost

    C:/Qt/Tools/CMake_64/bin/cmake.exe .. -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release -DBUILD_VERSION="3.7.1" -DCMAKE_CXX_STANDARD=17 -DCMAKE_PREFIX_PATH=C:/Users/mycomputer/Desktop/BuildingSpot/install -DCMAKE_INSTALL_PREFIX=C:/Users/mycomputer/Desktop/BuildingSpot/install2
    

    Followed by

    C:/Qt/Tools/CMake_64/bin/cmake.exe --build . --target install
    

    Compiling Qt application-------------------------------------------------------------------------------
    For the Qt application

    on Qt 5.15 with the old drivers (mongocxx 3.4 made for minGW 7.3) I can access mongodb with no issues
    on Qt 6.5 with the old drivers (mongocxx 3.4 made for minGW 7.3) I can use most of mongodb's functionality, but it is unable to read doubles from mongodb

    I tried building mongocxx 3.6 and 3.7 using the above method, and trying out a pre-compiled MongoCXX 3.5.1 for GCC 10.1 from online, and all three of them result in the same error message after configuring Qt creator.
    28b5ff43-df10-44b5-bb71-c3cadc1b11e9-image.png

    Here are the includes from my project file that may be relevant

    CONFIG += c++17
    #mongoDB
    INCLUDEPATH += $$PWD/../../MongoDB/Windows/mongocxx371/include/mongocxx/v_noabi \
                   $$PWD/../../MongoDB/Windows/mongocxx371/include/bsoncxx/v_noabi \
                   $$PWD/../../MongoDB/WindowsBoost
    
    win32: LIBS += -L$$PWD/../../MongoDB/Windows/mongocxx371/lib/ -lmongocxx -lbsoncxx
    
    INCLUDEPATH += $$PWD/../../MongoDB/Windows/mongocxx371/include
    DEPENDPATH += $$PWD/../../MongoDB/Windows/mongocxx371/include
    
    INCLUDEPATH += $$PWD/../../MongoDB/Windows/mongocxx371/lib
    DEPENDPATH += $$PWD/../../MongoDB/Windows/mongocxx371/lib
    
    INCLUDEPATH += $$PWD/../../MongoDB/Windows/mongocxx371/bin
    

    Am I making some kind of mistake in the way i configure cmake for qt 6.5?

    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