# Help with Windows-related errors

**URL:** <https://discuss.ocaml.org/t/help-with-windows-related-errors/17828>\
**Category:** Ecosystem\
**Tags:** windows\
**Created:** [February 19, 2026, 2:59pm UTC](https://discuss.ocaml.org/t/help-with-windows-related-errors/17828 "2026-02-19T14:59:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![amaro](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@amaro](https://discuss.ocaml.org/u/amaro)\
**Post date:** [February 19, 2026, 2:59pm UTC](https://discuss.ocaml.org/t/help-with-windows-related-errors/17828/1 "2026-02-19T14:59:05Z")

</div>

Hello,

I’m trying to install the [caisar](https://git.frama-c.com/pub/caisar) opam package on Windows (using a default install with mingw, on a PowerShell, on Windows 11 after using winget to install opam).

The first issue I had, was the dependency `ocaml-protoc-plugin`, which requires `conf-protobuf`, and the fact that such package has no depext for Windows. I tried installing `libprotobuf-devel` with Cygwin and it worked, so I think I’ll add a patch for it on opam-repository:

```diff
+ ["libprotobuf-devel"] {os = "win32" & os-distribution = "cygwinports"}

```

I copied the os/os-distribution constraints from `conf-gmp`, but I’m not sure that’s the right way to do it.

Anyway, now I’m having errors compiling `ocaml-protoc-plugin`, related to `pkg-config`. `pkg-config` is already installed and, if I open a Cygwin terminal, the `pkg-config` command seems to work. But when `dune` tries to install it, I get:

```auto
[ERROR] The compilation of ocaml-protoc-plugin.6.2.0 failed at "dune build -p ocaml-protoc-plugin -j 7".

#=== ERROR while compiling ocaml-protoc-plugin.6.2.0 ==========================#
# context 2.5.0 | win32/x86_64 | ocaml.5.4.0 | https://opam.ocaml.org#302e116c4009da2f5a31c350a57c8b3c9b27289e
# path C:\Users\user\AppData\Local\opam\default\.opam-switch\build\ocaml-protoc-plugin.6.2.0
# command C:\Users\user\AppData\Local\opam\default\bin\dune.exe build -p ocaml-protoc-plugin -j 7
# exit-code 1
# env-file C:\Users\user\AppData\Local\opam\log\ocaml-protoc-plugin-24808-db4f28.env
# output-file C:\Users\user\AppData\Local\opam\log\ocaml-protoc-plugin-24808-db4f28.out
### output ###
# File "src/google_types/dune", line 11, characters 15-25:
# 11 | (run pkg-config protobuf --variable=includedir))))
# ^^^^^^^^^^
# Error: Program pkg-config not found in the tree or in PATH
# (context: default)

```

I’m not sure why this is happening; is it something in the `dune` file of `ocaml-protoc-plugin` that is not compatible with Windows? Is this a more fundamental limitation related to OCaml on Windows? Am I missing a command?

I remember in the past I had to do specific steps for cygwin-related depexts to work (e.g. add some directories to PATH), but I think that’s no longer required.

---

<div class="post-metadata">

**Author:** ![ghuysmans](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/ghuysmans/32/595_2.png) [@ghuysmans](https://discuss.ocaml.org/u/ghuysmans)\
**Post date:** [February 19, 2026, 6:37pm UTC](https://discuss.ocaml.org/t/help-with-windows-related-errors/17828/2 "2026-02-19T18:37:31Z")

</div>

Hi,

To fix the Windows build of the libarchive bindings I’m working with, I referenced a cross-compilation package (your compiler targets _x86\_64-w64-mingw32_ so it won’t look in the same directory). There was also a build dependency on _conf-pkg-config_ that shoud fix your path issues. Your _depext_ should look like this:

```auto
["mingw64-x86_64-libprotobuf"] {os="win32" & os-distribution="cygwin"}

```

Unfortunately, this package doesn’t exist yet…

Hope this helps!

---

<div class="post-metadata">

**Author:** ![amaro](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@amaro](https://discuss.ocaml.org/u/amaro)\
**Post date:** [February 20, 2026, 7:39am UTC](https://discuss.ocaml.org/t/help-with-windows-related-errors/17828/3 "2026-02-20T07:39:43Z")

</div>

> [@ghuysmans](#):
>
> Unfortunately, this package doesn’t exist yet…

By “this package”, you mean the Cygwin package does not exist? Because indeed I see no such package in the list. So it means I should wait until someone creates a mingw package for protobuf, and only then will I be able to use it on my mingw-based OCaml for Windows?

---

<div class="post-metadata">

**Author:** ![ghuysmans](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/ghuysmans/32/595_2.png) [@ghuysmans](https://discuss.ocaml.org/u/ghuysmans)\
**Post date:** [February 20, 2026, 6:35pm UTC](https://discuss.ocaml.org/t/help-with-windows-related-errors/17828/4 "2026-02-20T18:35:02Z")

</div>

Yes, I referred to the Cygwin package. Here’s the [Cygwin Package Contributor’s Guide](https://cygwin.com/packaging-contributors-guide.html), maybe you could get inspiration from existing cross-compiled packages.
