Skip to content

Instantly share code, notes, and snippets.

@crazyzlj
Last active October 17, 2017 08:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save crazyzlj/1e1d255b6879f55dbc29c8fd2aec36e5 to your computer and use it in GitHub Desktop.
Save crazyzlj/1e1d255b6879f55dbc29c8fd2aec36e5 to your computer and use it in GitHub Desktop.
compile_mongo-c-driver_by_mingw64_windows
In file included from C:/peacock/windows/windows/mingw-4/x86_64/include/libbson-1.0/bson-compat.h:38:0,
from C:/peacock/windows/windows/mingw-4/x86_64/include/libbson-1.0/bson.h:23,
from D:/compile/mongoc-1.8.1/src/mongoc/mongoc.h:22,
from D:\compile\mongoc-1.8.1\tests\test-mongoc-topology.c:1:
D:\compile\mongoc-1.8.1\tests\test-mongoc-topology.c: In function '_test_topology_invalidate_server':
D:\compile\mongoc-1.8.1\tests\test-mongoc-topology.c:347:32: error: 'mongoc_server_description_t' has no member named 'compressors'
BSON_ASSERT (bson_empty (&sd->compressors));
set PATH=C:\mingw64\bin;C:\mingw64\opt\bin;C:\mingw64\opt;%~dp0;%~dp0\src\libbson;C:\Windows\system32;C:\Windows;
rem Set install path
set INSTALL_DIR=C:\peacock\windows\windows\mingw-4\x86_64
rem Set CMake configure flags
set CONFIGURE_FLAGS="-DENABLE_TESTS=FALSE"
set CMAKE="C:\Program Files\CMake\bin\cmake"
set CMAKE_MAKE_PROGRAM=C:\mingw64\bin\mingw32-make.exe
set CC=C:\mingw64\bin\x86_64-w64-mingw32-gcc.exe
set CXX=C:\mingw64\bin\x86_64-w64-mingw32-g++.exe
cd src\libbson
%CMAKE% -G "MinGW Makefiles" %CONFIGURE_FLAGS% -DCMAKE_MAKE_PROGRAM=%CMAKE_MAKE_PROGRAM% -DCMAKE_INSTALL_PREFIX=%INSTALL_DIR%
%CMAKE_MAKE_PROGRAM% -j4 VERBOSE=1
%CMAKE_MAKE_PROGRAM% install
cd ..\..
%CMAKE% -G "MinGW Makefiles" %CONFIGURE_FLAGS% -DCMAKE_MAKE_PROGRAM=%CMAKE_MAKE_PROGRAM% -DBSON_ROOT_DIR=%INSTALL_DIR% -DCMAKE_INSTALL_PREFIX=%INSTALL_DIR% -DCMAKE_PREFIX_PATH=%INSTALL_DIR%\lib\cmake
%CMAKE_MAKE_PROGRAM% -j4 VERBOSE=1
%CMAKE_MAKE_PROGRAM% install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment