Help with compilation C++ driver for MinGw64

I`m not understend how build this driver, make it pls if u can and share
I waste 3 days, but have:

test.cpp:(.text+0xa): undefined reference to `__imp__ZN8mongocxx7v_noabi8instanceD1Ev’

with compiling:

    #include <cstdlib>
    #include <iostream>
    #include <cstdint>
    #include <vector>

    #include <bsoncxx/json.hpp>
    #include <mongocxx/client.hpp>
    #include <mongocxx/stdx.hpp>
    #include <mongocxx/uri.hpp>
    #include <mongocxx/instance.hpp>
    #include <mongocxx/exception/exception.hpp>
    #include <bsoncxx/builder/stream/helpers.hpp>
    #include <bsoncxx/builder/stream/document.hpp>
    #include <bsoncxx/builder/stream/array.hpp>

    using bsoncxx::builder::stream::close_array;
    using bsoncxx::builder::stream::close_document;
    using bsoncxx::builder::stream::document;
    using bsoncxx::builder::stream::finalize;
    using bsoncxx::builder::stream::open_array;
    using bsoncxx::builder::stream::open_document;

    namespace mongo
    {
    	using namespace mongocxx;
    };

    void run()
    {
    	static mongo::instance instance;
    }

    int main()
    {
    	try {
    		run();
    		std::cout << "connected ok" << std::endl;
    	} catch( const mongo::exception &e )
    	{
    		std::cout << "caught " << e.what() << std::endl;
    	}
    	return EXIT_SUCCESS;
    }

@Dmitry_LLIAMAH, the error seems to indicate a linker error. However, without more information it is not possible to provide a resolution. Please have a look at these instructions for requesting assistance. (They are from the C driver project, but the same concepts apply here.)

1 Like