Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-3221

Building on Windows with MSYS doesn't output files to CMAKE_INSTALL_PREFIX

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.16.0
    • Affects Version/s: 1.14.0
    • Component/s: Build, cmake, Docs
    • None
    • Environment:
      Windows 10
      MSYS 64bit

      Hello, I'm trying to build mongocxx-driver on Windows 10 with MSYS and I'm at a point where I've built the C libraries thanks to the suggestion in CDRIVER-3082 of adding the 

      -DCMAKE_C_FLAGS="-D__USE_MINGW_ANSI_STDIO=1"

      flag to the cmake command.

      First of all I'd like to point out that the documentation is still inexact about building on Windows with MSYS:

      • after installing MSYS, there's not such file as c:\msys64\ming64_shell.bat as stated in the docs. I've had to launch C:\msys64\mingw64.exe to run the pacman commands listed in the docs.
      • the docs still say that you must download the tarball, and build with CMake after entering the directory. If anyone has used CMake once they know we're talking about the build directory inside the project's directory but it should still be pointed out (I'm coming back to C++ after years of C# and Javascript and it's not obvious for me)

      That said, back to the main issue: after launching the following command from the build directory:

      CC=/mingw64/bin/gcc.exe /mingw64/bin/cmake -G "MSYS Makefiles" -DCMAKE_INSTALL_PREFIX="C:/mongo-c-driver" DCMAKE_C_FLAGS="D__USE_MINGW_ANSI_STDIO=1" ..

      and then

      make

      the builds run successfully (seeing the output in the MSYS shell) but the output directory C:/mongo-c-driver is not created. I have found the built .dll and .a files inside

      {...}

      \mongo-c-driver-1.14.0\build\src\libbson and {...}\mongo-c-driver-1.14.0\build\src\libmongoc

      I've tried to copy them manually to C:\mongo-c-driver but then the cmake build of mongocxx doesn't work. Any ideas why the output directory isn't created in the first place?

            Assignee:
            kevin.albertson@mongodb.com Kevin Albertson
            Reporter:
            etchelon Andrea Bertoldo
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: