Error when building mongocxx driver on Windows
<p>I am trying to follow <a href="https://mongodb.github.io/mongo-cxx-driver/mongocxx-v3/installation/" rel="nofollow noreferrer">this guide</a>, and I am currently at step 3.</p>
<p>So after running,</p>
<pre><code>curl -OL https://github.com/mongodb/mongo-cxx-driver/archive/r3.0.1.tar.gz
tar -xzf r3.0.1.tar.gz
cd mongo-cxx-driver-r3.0.1/
</code></pre>
<p>I try to do similar commands as in the <a href="http://mongoc.org/libmongoc/current/installing.html#building-windows" rel="nofollow noreferrer">Windows guide for mongoc</a>:</p>
<p>If I do just</p>
<pre><code>cmake -G &quot;Visual Studio 14 2015 Win64&quot; &quot;-DCMAKE_BUILD_TYPE=Release&quot; &quot;-DCMAKE_INSTALL_PREFIX=C:/mongo-cxx-driver&quot;
</code></pre>
<p>I get an error</p>
<pre><code>CMake Error at cmake/FindLibBSON.cmake:37 (message):
  Don't know how to find libbson; please set LIBBSON_DIR to the prefix
  directory with which libbson was configured.
Call Stack (most recent call first):
  src/bsoncxx/CMakeLists.txt:67 (find_package)
</code></pre>
<p>So here I have tried different things, like adding the paths to the libsson directory:</p>
<pre><code>cmake -G &quot;Visual Studio 14 2015 Win64&quot; &quot;-DCMAKE_BUILD_TYPE=Release&quot; &quot;-DCMAKE_INSTALL_PREFIX=C:/mongo-cxx-driver&quot; &quot;-DLIBBSON_DIR=C:/mongo-c-driver/lib/pkgconfig/&quot; &quot;-DLIBMONGOC_DIR=C:/mongo-c-driver/lib/pkgconfig/&quot; &quot;-DBOOST_ROOT=C:/local/boost_1_62_0/&quot;
</code></pre>
<p>This actually works, but then when I try to build with</p>
<pre><code>msbuild.exe ALL_BUILD.vcxproj
</code></pre>
<p>I get an error:</p>
<pre><code>C:\Users\Erik\Documents\mongo-cxx-driver-r3.0.1\src\bsoncxx\array\view.cpp(21): fatal error C1083: Cannot open include
 file: 'bson.h': No such file or directory [C:\Users\Erik\Documents\mongocxx-driver-r3.0.1\src\bsoncxx\bsoncxx_static.v
cxproj]
</code></pre>
<p>This file, &quot;bson.h&quot; seems to reside in the direcroty</p>
<pre><code>C:\mongo-c-driver\include\libbson-1.0
</code></pre>
<p>but I am not sure why it does not find the file or how I could make it do so.</p>
<p>Greatly appreciate any input on this.</p>