2 / 3
May 2024

I have build Mongo db C++ have following lib files mongocxx-v_noabi-rhb-x64-v143-md.lib and bsoncxx-v_noabi-rhb-x64-v143-md.lib in my C:\mongo-cxx-driver\install\lib folder. During build I am getting following link errors :slight_smile:
:-1: error: release/decomtable.o:decomtable.cpp:(.text+0x220f): undefined reference to __imp__ZN7bsoncxx7v_noabi7builder4coreC1Eb' :-1: error: release/decomtable.o:decomtable.cpp:(.text+0x2416): undefined reference to __imp__ZN7bsoncxx7v_noabi7builder4coreD1Ev’
:-1: error: release/decomtable.o:decomtable.cpp:(.text+0x2474): undefined reference to __imp__ZN7bsoncxx7v_noabi7builder4coreD1Ev' :-1: error: release/decomtable.o:decomtable.cpp:(.text+0x5fda): undefined reference to __imp__ZN7bsoncxx7v_noabi7builder4coreC1Eb’

my include and lib paths in PRO file are :
LIBS += -LC:\mongo-cxx-driver\install\lib -lbsoncxx-v_noabi-rhb-x64-v143-md
LIBS += -LC:\mongo-cxx-driver\install\lib -lmongocxx-v_noabi-rhb-x64-v143-md

INCLUDEPATH += C:\boost_1_84_0
DEPENDPATH += C:\boost_1_84_0
LIBS += -LC:\boost_1_84_0\stage\lib -IC:\boost_1_84_0

INCLUDEPATH +=C:\mongo-cxx-driver\install\include\bsoncxx\v_noabi\bsoncxx
INCLUDEPATH +=C:\mongo-cxx-driver\install\include\bsoncxx\v_noabi
INCLUDEPATH +=C:\mongo-cxx-driver\install\include\mongocxx\v_noabi\mongocxx
INCLUDEPATH +=C:\mongo-cxx-driver\install\include\mongocxx\v_noabi

This seems like a linker error since the linker can’t find the implementations of certain functions in bsoncxx. Please double check the lib paths for linking. Also, ensure that the all the components in your project are compatible with each other, ie. Qt, MongoDB C++ driver, Boost, etc. are built with the same compiler version and runtime library settings.

10 days later

Hi Rishabh,

Thanks for the quick reply. I have Visual Studio 2022 community edition. QT 6.6.3 with MIGW 11.2.0 and MSVC 2019. How do I build my Mongo C and C++ drivers so that I can use with QT 6.6.3.

Regards,
Ishwar