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

Undefined reference when compiling with cmake on windows target bsoncxx_testing

    • Type: Icon: Bug Bug
    • Resolution: Gone away
    • Priority: Icon: Blocker - P1 Blocker - P1
    • None
    • Affects Version/s: 3.4.0
    • Component/s: Build
    • Labels:
      None
    • Environment:
      Windows Mingw gcc 8.x

      When compiling mongoc and mongocxx, I encountered an issue with the target bsoncxx_testing. I'm using de 3.4.0 release with CXX-1689 and CXX-1688 otherwise it cannot compile since I'm using gcc 8.1

      Here's the console message

      // code 
      [  4%] Built target bsoncxx
      [ 10%] Built target bsoncxx_testing
      [ 10%] Linking CXX executable test_bson.exe
      CMakeFiles\test_bson.dir/objects.a(bson_builder.cpp.obj):bson_builder.cpp:(.text+0x12b9): undefined reference to `__imp__ZN7bsoncxx7v_noabi5types10b_document7type_idE'
      CMakeFiles\test_bson.dir/objects.a(bson_builder.cpp.obj):bson_builder.cpp:(.text+0x1474): undefined reference to `__imp__ZN7bsoncxx7v_noabi5types7b_int327type_idE'
      CMakeFiles\test_bson.dir/objects.a(bson_builder.cpp.obj):bson_builder.cpp:(.text+0x1a96): undefined reference to `__imp__ZN7bsoncxx7v_noabi5types7b_array7type_idE'
      CMakeFiles\test_bson.dir/objects.a(bson_builder.cpp.obj):bson_builder.cpp:(.text+0x1c3f): undefined reference to `__imp__ZN7bsoncxx7v_noabi5types7b_int327type_idE'
      CMakeFiles\test_bson.dir/objects.a(bson_builder.cpp.obj):bson_builder.cpp:(.text+0x21e4): undefined reference to `__imp__ZN7bsoncxx7v_noabi5types7b_int327type_idE'
      CMakeFiles\test_bson.dir/objects.a(bson_builder.cpp.obj):bson_builder.cpp:(.text+0x24f3): undefined reference to `__imp__ZN7bsoncxx7v_noabi5types6b_bool7type_idE'
      CMakeFiles\test_bson.dir/objects.a(bson_builder.cpp.obj):bson_builder.cpp:(.text+0x2a69): undefined reference to `__imp__ZN7bsoncxx7v_noabi5types7b_int327type_idE'
      CMakeFiles\test_bson.dir/objects.a(bson_builder.cpp.obj):bson_builder.cpp:(.text+0x2d74): undefined reference to `__imp__ZN7bsoncxx7v_noabi5types6b_bool7type_idE'
      collect2.exe: error: ld returned 1 exit status
      make[2]: *** [src\bsoncxx\test\CMakeFiles\test_bson.dir\build.make:216: src/bsoncxx/test/test_bson.exe] Error 1
      make[1]: *** [CMakeFiles\Makefile2:519: src/bsoncxx/test/CMakeFiles/test_bson.dir/all] Error 2
      make: *** [Makefile:140: all] Error 2
      

      I couldn't find a way to fix it but all the other targets worked fine.

            Assignee:
            kevin.albertson@mongodb.com Kevin Albertson
            Reporter:
            ivanfosse@gmail.com Ivan Fosse
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: