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. Qt Creator error “No such file or directory” when using boost in mongocxx
Forum Updated to NodeBB v4.3 + New Features

Qt Creator error “No such file or directory” when using boost in mongocxx

Scheduled Pinned Locked Moved Solved General and Desktop
28 Posts 7 Posters 3.0k Views 2 Watching
  • 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 SimonR
    27 Apr 2020, 10:05

    So I've set up the compiler now, but when I run the application I get errors:
    4ba8dbb8-adb6-4ec1-9dec-bce6b42e8574-image.png

    I don't know why the language is German, because it's set to English. But as far as I know, those errors are linking errors, so I guess the libraries are not included correctly.

    Here is my .pro file:

    QT += quick
    
    CONFIG += c++17
    
    DEFINES += QT_DEPRECATED_WARNINGS
    
    SOURCES += \
            main.cpp \
            signIn.cpp \
            signUp.cpp
    
    INCLUDEPATH += C:/mongo-cxx-driver-3.4.1/include/bsoncxx/v_noabi \
                   C:/mongo-cxx-driver-3.4.1/include/mongocxx/v_noabi \
                   D:/boost_1_72_0
    
    RESOURCES += qml.qrc
    
    TRANSLATIONS += \
        LogIn_en_CA.ts
    
    QML_IMPORT_PATH =
    
    QML_DESIGNER_IMPORT_PATH =
    
    qnx: target.path = /tmp/$${TARGET}/bin
    else: unix:!android: target.path = /opt/$${TARGET}/bin
    !isEmpty(target.path): INSTALLS += target
    
    HEADERS += \
        signIn.h \
        signUp.h
    
    LIBS += -LC:/mongo-cxx-driver-3.4.1/lib -lbsoncxx \
            -LC:/mongo-cxx-driver-3.4.1/lib -lmongocxx
    
    J Offline
    J Offline
    jsulm
    Lifetime Qt Champion
    wrote on 27 Apr 2020, 10:11 last edited by
    #21

    @SimonR Looks like you're not linking properly against mongocxx. Which compiler was used to build those libraries and are they 32bit or 64bit?

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

    1 Reply Last reply
    1
    • S Offline
      S Offline
      SimonR
      wrote on 27 Apr 2020, 12:58 last edited by
      #22

      I've played with the setting a bit and now, it compiles, but it doesn't run and shows an error:
      200de448-d179-49ab-88a2-548f494b1f64-image.png

      And when it try do run the debugger, it also shows an error:
      bf60b637-3af4-462b-83a2-97be35929eb7-image.png

      J 1 Reply Last reply 27 Apr 2020, 13:15
      0
      • S SimonR
        27 Apr 2020, 12:58

        I've played with the setting a bit and now, it compiles, but it doesn't run and shows an error:
        200de448-d179-49ab-88a2-548f494b1f64-image.png

        And when it try do run the debugger, it also shows an error:
        bf60b637-3af4-462b-83a2-97be35929eb7-image.png

        J Offline
        J Offline
        jsulm
        Lifetime Qt Champion
        wrote on 27 Apr 2020, 13:15 last edited by
        #23

        @SimonR The last error says what is wrong and what needs to be done

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

        1 Reply Last reply
        2
        • S Offline
          S Offline
          SimonR
          wrote on 27 Apr 2020, 16:06 last edited by SimonR
          #24

          So, i can compile the project now with MSVC, but when I try to make an connection using

          mongocxx::instance inst{};
          mongocxx::client conn{ mongocxx::uri{"my connection string"} };
          bsoncxx::builder::stream::document document{};
          

          it throws the same error as before:
          ea7b3506-a3a1-45be-9308-b87dce103316-image.png
          When I delete the libs part in the .pro file, it works again and keeps working, until I include the libs again and try to use something from mongocxx.

          1 Reply Last reply
          0
          • S Offline
            S Offline
            SGaist
            Lifetime Qt Champion
            wrote on 27 Apr 2020, 17:22 last edited by
            #25

            As a test, copy the dlls from that library in the same folder as your executable.

            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
            • S Offline
              S Offline
              SimonR
              wrote on 27 Apr 2020, 18:45 last edited by
              #26

              @SGaist no, that didn't help. Still the same error.

              1 Reply Last reply
              0
              • S Offline
                S Offline
                SGaist
                Lifetime Qt Champion
                wrote on 27 Apr 2020, 18:49 last edited by
                #27

                Then check that you have all the related dependencies available.

                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
                1
                • S Offline
                  S Offline
                  SimonR
                  wrote on 28 Apr 2020, 07:47 last edited by SimonR
                  #28

                  I've created a project in Visual Studio 2019 now with the same settings as in Qt Creator, and it works. Included all the header files, libs and dlls and it works. Don't know why this isn't working in Qt Creator. I've tried this but I get the same error. I have to delete the LIBS part and then it runs again. All the dlls are in the folder, but it crashes all the time.

                  1 Reply Last reply
                  0

                  21/28

                  27 Apr 2020, 10:11

                  • Login

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