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

types.hpp E0145 error

    • Type: Icon: Task Task
    • Resolution: Gone away
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.4.0
    • Component/s: Build
    • Environment:
      Visual Studio 2017 Community

      Hi,

      I have no idea why cannot build test mongocxx program via Visual Studio:

      #include <iostream>
      
      #include <bsoncxx/builder/stream/document.hpp>
      #include <bsoncxx/json.hpp>
      
      #include <mongocxx/client.hpp>
      #include <mongocxx/instance.hpp>
      
      int main(int, char**) {
          mongocxx::instance inst{};
          mongocxx::client conn{mongocxx::uri{}};
      
          bsoncxx::builder::stream::document document{};
      
          auto collection = conn["testdb"]["testcollection"];
          document << "hello" << "world";
      
          collection.insert_one(document.view());
          auto cursor = collection.find({});
      
          for (auto&& doc : cursor) {
              std::cout << bsoncxx::to_json(doc) << std::endl;
          }
      }

      My configuration: 

      platform: x64

      additional libraries: C:\mongo-cxx-driver\lib

      additional header files: C:\mongo-cxx-driver\include\bsoncxx\v_noabi;

      C:\mongo-cxx-driver\include\mongocxx\v_noabi; C:\boost\boost_1_62_0

      (tried with includes from mongo-c-driver but nothing changed)

      Visual inform that member bsoncxx::v_noabi::types::xxx::type_id cannot be initialized (xxx-different types like b_double, b_binary etc.).

      I attach screenshot with listed errors (in polish but i translated main issue above) and code in types.hpp where the problem is.

        1. mongocxx.png
          49 kB
          Konrad

            Assignee:
            Unassigned Unassigned
            Reporter:
            kondziu2407 Konrad
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: