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. undefined reference to `_imp___ZN8mongocxx7v_noabi8instanceC1Ev in Qt?
Forum Updated to NodeBB v4.3 + New Features

undefined reference to `_imp___ZN8mongocxx7v_noabi8instanceC1Ev in Qt?

Scheduled Pinned Locked Moved Solved General and Desktop
qt5c++11mongodbc++ qt
23 Posts 5 Posters 3.7k 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.
  • jsulmJ jsulm

    @JonB It should be .lib, yes. But OP claims there is no .lib file, but I'm not a Windows developer.

    Vivek_AV Offline
    Vivek_AV Offline
    Vivek_A
    wrote on last edited by Vivek_A
    #12

    @jsulm ok, i understand idid this

    LIBS += C:/mongo-cxx-driver/lib/libbsoncxx.dll.a
    
    INCLUDEPATH += C:/mongo-cxx-driver/include/mongocxx/v_noabi
    DEPENDPATH += C:/mongo-cxx-driver/include/mongocxx/v_noabi
    

    included but error that said first remains

    ./release\main.o:main.cpp:(.text+0x1d): undefined reference to `_imp___ZN8mongocxx7v_noabi8instanceC1Ev'
    ./release\main.o:main.cpp:(.text+0xee): undefined reference to `_imp___ZN8mongocxx7v_noabi8instanceD1Ev'
    ./release\main.o:main.cpp:(.text+0x14e): undefined reference to `_imp___ZN8mongocxx7v_noabi8instanceD1Ev'
    

    if you dont know about windows side of this , then its ok.
    @JonB i have doubt , the compiler is mingw 32 and i build the mongdb in mingw 64 is this makes any issues

    jsulmJ JonBJ 2 Replies Last reply
    0
    • Vivek_AV Vivek_A

      @jsulm ok, i understand idid this

      LIBS += C:/mongo-cxx-driver/lib/libbsoncxx.dll.a
      
      INCLUDEPATH += C:/mongo-cxx-driver/include/mongocxx/v_noabi
      DEPENDPATH += C:/mongo-cxx-driver/include/mongocxx/v_noabi
      

      included but error that said first remains

      ./release\main.o:main.cpp:(.text+0x1d): undefined reference to `_imp___ZN8mongocxx7v_noabi8instanceC1Ev'
      ./release\main.o:main.cpp:(.text+0xee): undefined reference to `_imp___ZN8mongocxx7v_noabi8instanceD1Ev'
      ./release\main.o:main.cpp:(.text+0x14e): undefined reference to `_imp___ZN8mongocxx7v_noabi8instanceD1Ev'
      

      if you dont know about windows side of this , then its ok.
      @JonB i have doubt , the compiler is mingw 32 and i build the mongdb in mingw 64 is this makes any issues

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

      @Vivek_A You need to link at least one more lib containing the missing symbols (libmongocxx I guess).

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

      1 Reply Last reply
      2
      • Vivek_AV Vivek_A

        @jsulm ok, i understand idid this

        LIBS += C:/mongo-cxx-driver/lib/libbsoncxx.dll.a
        
        INCLUDEPATH += C:/mongo-cxx-driver/include/mongocxx/v_noabi
        DEPENDPATH += C:/mongo-cxx-driver/include/mongocxx/v_noabi
        

        included but error that said first remains

        ./release\main.o:main.cpp:(.text+0x1d): undefined reference to `_imp___ZN8mongocxx7v_noabi8instanceC1Ev'
        ./release\main.o:main.cpp:(.text+0xee): undefined reference to `_imp___ZN8mongocxx7v_noabi8instanceD1Ev'
        ./release\main.o:main.cpp:(.text+0x14e): undefined reference to `_imp___ZN8mongocxx7v_noabi8instanceD1Ev'
        

        if you dont know about windows side of this , then its ok.
        @JonB i have doubt , the compiler is mingw 32 and i build the mongdb in mingw 64 is this makes any issues

        JonBJ Offline
        JonBJ Offline
        JonB
        wrote on last edited by JonB
        #14

        @Vivek_A said in undefined reference to `_imp___ZN8mongocxx7v_noabi8instanceC1Ev in Qt?:

        LIBS += C:/mongo-cxx-driver/lib/libbsoncxx.dll.a

        This looks much more reasonable than before!

        Now as @jsulm says it looks like you need some further similars for other library files required to link successfully.

        @JonB i have doubt , the compiler is mingw 32 and i build the mongdb in mingw 64 is this makes any issues

        I am not sure what you are saying. It will not be possible to mix 64-bit-compiled code with 32-bit-compiled code in one executable. The compiler's bit-ness is not at issue, rather only whichever bit-ness it is generating code for.

        Start by trying what @jsulm has pointed out, then deal with bit-ness if there is still an error.....

        1 Reply Last reply
        2
        • Vivek_AV Offline
          Vivek_AV Offline
          Vivek_A
          wrote on last edited by
          #15

          @JonB modified

          LIBS += C:/mongo-cxx-driver/lib/libbsoncxx.dll.a
          LIBS += C:/mongo-cxx-driver/lib/libmongocxx.dll.a
          INCLUDEPATH += C:/mongo-cxx-driver/include/mongocxx/v_noabi
          DEPENDPATH += C:/mongo-cxx-driver/include/mongocxx/v_noabi
          
          INCLUDEPATH += C:/mongo-cxx-driver/include/bsoncxx/v_noabi
          DEPENDPATH += C:/mongo-cxx-driver/include/bsoncxx/v_noabi
          

          clean & rebuilded
          Output:

          ./release\main.o:main.cpp:(.text+0x19): undefined reference to `_imp___ZN8mongocxx7v_noabi8instanceC1Ev'
          ./release\main.o:main.cpp:(.text+0x23): undefined reference to `_imp___ZN8mongocxx7v_noabi8instanceD1Ev'
          collect2.exe: error: ld returned 1 exit status
          
          Vivek_AV 1 Reply Last reply
          0
          • Vivek_AV Vivek_A

            @JonB modified

            LIBS += C:/mongo-cxx-driver/lib/libbsoncxx.dll.a
            LIBS += C:/mongo-cxx-driver/lib/libmongocxx.dll.a
            INCLUDEPATH += C:/mongo-cxx-driver/include/mongocxx/v_noabi
            DEPENDPATH += C:/mongo-cxx-driver/include/mongocxx/v_noabi
            
            INCLUDEPATH += C:/mongo-cxx-driver/include/bsoncxx/v_noabi
            DEPENDPATH += C:/mongo-cxx-driver/include/bsoncxx/v_noabi
            

            clean & rebuilded
            Output:

            ./release\main.o:main.cpp:(.text+0x19): undefined reference to `_imp___ZN8mongocxx7v_noabi8instanceC1Ev'
            ./release\main.o:main.cpp:(.text+0x23): undefined reference to `_imp___ZN8mongocxx7v_noabi8instanceD1Ev'
            collect2.exe: error: ld returned 1 exit status
            
            Vivek_AV Offline
            Vivek_AV Offline
            Vivek_A
            wrote on last edited by
            #16

            @Vivek_A anybody help...is that compiler problem

            ./debug\main.o: In function `Z5qMainiPPc':
            E:/vivek/dw_tdoa_controller7/dw_tdoa_controller/main.cpp:36: undefined reference to `_imp___ZN8mongocxx7v_noabi8instanceC1Ev'
            E:/vivek/dw_tdoa_controller7/dw_tdoa_controller/main.cpp:36: undefined reference to `_imp___ZN8mongocxx7v_noabi8instanceD1Ev'
            E:/vivek/dw_tdoa_controller7/dw_tdoa_controller/main.cpp:36: undefined reference to `_imp___ZN8mongocxx7v_noabi8instanceD1Ev'
            collect2.exe: error: ld returned 1 exit status
            
            
            Makefile:36: recipe for target 'debug' failed
            mingw32-make[1]: *** [debug\RTLSController.exe] Error 1
            mingw32-make: *** [debug] Error 2
            17:25:51: 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"
            
            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #17

              Try inverting the order of the libraries you are linking.

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

                @SGaist tried , still same error , i think its not in the linking of lib, may be the installation or compiler problem... what u think???

                mrjjM 1 Reply Last reply
                0
                • Vivek_AV Vivek_A

                  @SGaist tried , still same error , i think its not in the linking of lib, may be the installation or compiler problem... what u think???

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

                  @Vivek_A

                  Hi
                  I saw this line
                  building/deploying project dw_controller (kit: Desktop Qt 5.11.2 MinGW 32bit)

                  but you said " its build using mingw64 "

                  So are your 32 bit app trying to load 64 bit DLL ?

                  Vivek_AV 1 Reply Last reply
                  0
                  • mrjjM mrjj

                    @Vivek_A

                    Hi
                    I saw this line
                    building/deploying project dw_controller (kit: Desktop Qt 5.11.2 MinGW 32bit)

                    but you said " its build using mingw64 "

                    So are your 32 bit app trying to load 64 bit DLL ?

                    Vivek_AV Offline
                    Vivek_AV Offline
                    Vivek_A
                    wrote on last edited by
                    #20

                    @mrjj hi sir, i build and installed mongocxx driver using ming64. The app running in Qt is Desktop Qt 5.11.2 MinGW 32bit, ie a mingw 32 bit compiler
                    32cea6be-46de-4793-820b-4fc7a9d94cde-image.png

                    1 Reply Last reply
                    0
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by
                      #21

                      The question is: did you build the MongoDB C++ library in 32 or 64 bit ?

                      If the later then you can't use them with to build a 32bit application. Beside compiler, architecture matters as well. You can't mix and match 32 and 64 bit when building librairies or applications.

                      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
                      2
                      • SGaistS SGaist

                        The question is: did you build the MongoDB C++ library in 32 or 64 bit ?

                        If the later then you can't use them with to build a 32bit application. Beside compiler, architecture matters as well. You can't mix and match 32 and 64 bit when building librairies or applications.

                        Vivek_AV Offline
                        Vivek_AV Offline
                        Vivek_A
                        wrote on last edited by
                        #22
                        This post is deleted!
                        1 Reply Last reply
                        0
                        • Vivek_AV Offline
                          Vivek_AV Offline
                          Vivek_A
                          wrote on last edited by
                          #23

                          my compiler is mingw32bit and mongocxx driver build in 64 bit . so thats make problem , i solved it by installing 64bit Qt.

                          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