[CDRIVER-3221] Building on Windows with MSYS doesn't output files to CMAKE_INSTALL_PREFIX Created: 07/Jul/19  Updated: 28/Oct/23  Resolved: 02/Jan/20

Status: Closed
Project: C Driver
Component/s: Build, cmake, docs
Affects Version/s: 1.14.0
Fix Version/s: 1.16.0

Type: Bug Priority: Major - P3
Reporter: Andrea Bertoldo Assignee: Kevin Albertson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows 10
MSYS 64bit



 Description   

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?



 Comments   
Comment by Githook User [ 02/Jan/20 ]

Author:

{'name': 'Kevin Albertson', 'email': 'kevin.albertson@mongodb.com', 'username': 'kevinAlbs'}

Message: CDRIVER-3221 clarify msys2 installation

Comment by Kevin Albertson [ 31/Dec/19 ]

Hi etchelon. Apologies for the delay, and thank you for the report. C:\msys64\ming64.exe is the location of the shell in my experience as well. We'll clarify that you must create a build directory in the instructions. C:\mongo-c-driver is created after running make install. That will be added to the instructions as well.

Comment by Andrea Bertoldo [ 22/Jul/19 ]

Any news?! I think it's important that your setup instructions are correct or people can't even start using your library at all...

Generated at Wed Feb 07 21:17:25 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.