CC=/mingw64/bin/gcc.exe /mingw64/bin/cmake -G "MSYS Makefiles" -DCMAKE_INSTALL_PREFIX="C:/mongo-c-driver"
seems to work giving me this output:
CMake Warning:
No source or binary directory provided. Both will be assumed to be the
same as the current working directory, but note that this warning will
become a fatal error in future CMake releases.
-- The C compiler identification is ;GNU 8.3.0
-- Check for working C compiler: C:/msys64/mingw64/bin/gcc.exe
-- Check for working C compiler: C:/msys64/mingw64/bin/gcc.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- No CMAKE_BUILD_TYPE selected, defaulting to RelWithDebInfo
file VERSION_CURRENT contained BUILD_VERSION 1.14.0
-- Using bundled libbson
libbson version (from VERSION_CURRENT file): 1.14.0
-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Using unsigned short
-- Check if the system is big endian - little endian
-- Looking for snprintf
-- Looking for snprintf - found
-- Looking for reallocf
-- Looking for reallocf - not found
-- Performing Test BSON_HAVE_TIMESPEC
-- Performing Test BSON_HAVE_TIMESPEC - Success
-- struct timespec found
-- Looking for gmtime_r
-- Looking for gmtime_r - not found
-- Looking for rand_r
-- Looking for rand_r - not found
-- Looking for strings.h
-- Looking for strings.h - found
-- Looking for clock_gettime
-- Looking for clock_gettime - found
-- Looking for strnlen
-- Looking for strnlen - found
-- Looking for stdbool.h
-- Looking for stdbool.h - found
-- Looking for SYS_gettid
-- Looking for SYS_gettid - not found
-- Looking for syscall
-- Looking for syscall - not found
-- Performing Test HAVE_ATOMIC_32_ADD_AND_FETCH
-- Performing Test HAVE_ATOMIC_32_ADD_AND_FETCH - Success
-- Performing Test HAVE_ATOMIC_64_ADD_AND_FETCH
-- Performing Test HAVE_ATOMIC_64_ADD_AND_FETCH - Success
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE
libmongoc version (from VERSION_CURRENT file): 1.14.0
-- Searching for zlib CMake packages
-- Found ZLIB: C:/msys64/mingw64/lib/libz.dll.a (found version "1.2.11")
-- zlib found version "1.2.11"
-- zlib include path "C:/msys64/mingw64/include"
-- zlib libraries "C:/msys64/mingw64/lib/libz.dll.a"
-- Looking for include file unistd.h
-- Looking for include file unistd.h - found
-- Looking for include file stdarg.h
-- Looking for include file stdarg.h - found
-- Check size of socklen_t
-- Check size of socklen_t - done
-- Looking for sched_getcpu
-- Looking for sched_getcpu - not found
-- Searching for compression library header snappy-c.h
-- Not found (specify -DCMAKE_INCLUDE_PATH=/path/to/snappy/include for Snappy compression)
-- No ICU library found, SASLPrep disabled for SCRAM-SHA-256 authentication.
-- If ICU is installed in a non-standard directory, define ICU_ROOT as the ICU installation path.
-- Compiling against Secure Channel
-- Compiling against Windows SSPI
-- Configuring done
-- Generating done
-- Build files have been written to: C:/mongo-c-driver-1.14.0
then again following the tutorial typing the command:
make
And there's the output:
Scanning dependencies of target bson_shared
[ 0%] Building C object src/libbson/CMakeFiles/bson_shared.dir/src/bson/bcon.c.obj
In file included from C:/mongo-c-driver-1.14.0/src/libbson/src/bson/bson.h:23,
from C:/mongo-c-driver-1.14.0/src/libbson/src/bson/bcon.h:26,
from C:/mongo-c-driver-1.14.0/src/libbson/src/bson/bcon.c:24:
C:/mongo-c-driver-1.14.0/src/libbson/src/bson/bson-compat.h:27:2: error: #error "__USE_MINGW_ANSI_STDIO > 0 is required for correct PRI* macros"
#error "__USE_MINGW_ANSI_STDIO > 0 is required for correct PRI* macros"
^~~~~
make[2]: *** [src/libbson/CMakeFiles/bson_shared.dir/build.make:63: src/libbson/CMakeFiles/bson_shared.dir/src/bson/bcon.c.obj] Error 1
make[1]: *** [CMakeFiles/Makefile2:219: src/libbson/CMakeFiles/bson_shared.dir/all] Error 2
make: *** [Makefile:152: all] Error 2
I searched for hours but google seems to have no clue what this error mean.
I am using the latest release of mongoc 1.14.0, and the latest version of msys.
I have no more clue how to find a solution, hopefully somebody can help me.
Thanks for you attention.
-DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=17 -DCMAKE_INSTALL_PREFIX=C:/mongocxx . -DCMAKE_PREFIX_PATH=C:/mongoc .