How to configure Eclipse CDT to compile code containing the mongocxx driver in Linux?

Question

I'm trying to configure eclipse cdt to compile code that contains the mongocxx driver. This code is from mongo's installation page. The same errors I am getting on my own project are clearly displayed here. The includes are recognized but I believe that it is a linker issue.

#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;
    }
}

This is my actual screenshot with errors from my IDE


Show source
| eclipse   | mongodb   | eclipse-cdt   2017-11-07 11:11 0 Answers

Answers to How to configure Eclipse CDT to compile code containing the mongocxx driver in Linux? ( 0 )

Leave a reply to - How to configure Eclipse CDT to compile code containing the mongocxx driver in Linux?

◀ Go back