Uploaded image for project: 'C++ Driver'
  1. C++ Driver
  2. CXX-2001

Undefined reference to bsoncxx when compiling test_bson with MinGW

    • Type: Icon: Bug Bug
    • Resolution: Gone away
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.5.0
    • Component/s: Build
    • Environment:
      os: Windows 10
      compiler: MinGW w64 8.1.0 i686
      mongo-c-driver: 1.16.2
      mongo-cxx-driver: commit 4629521 of branch releases/v3.5
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

      Compiled with the options:

      BSONCXX_POLY_USE_STD=ON
      CMAKE_CXX_STANDARD=17

      I receive the following errors when try to compile mongo-cxx-driver:

      [ 13%] Linking CXX executable test_bson.exe
      CMakeFiles\test_bson.dir/objects.a(bson_builder.cpp.obj):bson_builder.cpp.text+0xf17): undefined reference to `imp__ZN7bsoncxx7v_noabi5types10b_document7type_idE'
      CMakeFiles\test_bson.dir/objects.a(bson_builder.cpp.obj):bson_builder.cpp.text+0x10ae): undefined reference to `imp__ZN7bsoncxx7v_noabi5types7b_int327type_idE'
      CMakeFiles\test_bson.dir/objects.a(bson_builder.cpp.obj):bson_builder.cpp.text+0x1563): undefined reference to `imp__ZN7bsoncxx7v_noabi5types7b_array7type_idE'
      CMakeFiles\test_bson.dir/objects.a(bson_builder.cpp.obj):bson_builder.cpp.text+0x16f2): undefined reference to `imp__ZN7bsoncxx7v_noabi5types7b_int327type_idE'
      CMakeFiles\test_bson.dir/objects.a(bson_builder.cpp.obj):bson_builder.cpp.text+0x1b5d): undefined reference to `imp__ZN7bsoncxx7v_noabi5types7b_int327type_idE'
      CMakeFiles\test_bson.dir/objects.a(bson_builder.cpp.obj):bson_builder.cpp.text+0x1e42): undefined reference to `imp__ZN7bsoncxx7v_noabi5types6b_bool7type_idE'
      CMakeFiles\test_bson.dir/objects.a(bson_builder.cpp.obj):bson_builder.cpp.text+0x2292): undefined reference to `imp__ZN7bsoncxx7v_noabi5types7b_int327type_idE'
      CMakeFiles\test_bson.dir/objects.a(bson_builder.cpp.obj):bson_builder.cpp.text+0x2579): undefined reference to `imp__ZN7bsoncxx7v_noabi5types6b_bool7type_idE'
      collect2.exe: error: ld returned 1 exit status
      mingw32-make[2]: *** [src\bsoncxx\test\CMakeFiles\test_bson.dir\build.make:236: src/bsoncxx/test/test_bson.exe] Error 1
      mingw32-make[1]: *** [CMakeFiles\Makefile2:987: src/bsoncxx/test/CMakeFiles/test_bson.dir/all] Error 2
      mingw32-make: *** [Makefile:160: all] Error 2

            Assignee:
            Unassigned Unassigned
            Reporter:
            zalexxanderx@gmail.com Alexandru Prisacariu
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: