# Does anybody have \`tsdl\` working on mingw64?

**URL:** <https://discuss.ocaml.org/t/does-anybody-have-tsdl-working-on-mingw64/9415>\
**Category:** Community\
**Created:** [February 25, 2022, 12:36pm UTC](https://discuss.ocaml.org/t/does-anybody-have-tsdl-working-on-mingw64/9415 "2022-02-25T12:36:56Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![ttamttam](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/ttamttam/32/132_2.png) [@ttamttam](https://discuss.ocaml.org/u/ttamttam)\
**Post date:** [February 25, 2022, 12:36pm UTC](https://discuss.ocaml.org/t/does-anybody-have-tsdl-working-on-mingw64/9415/1 "2022-02-25T12:36:56Z")

</div>

I’m trying to install `tsdl` on windows, without success (tests are failing to run).

I’m using : `ocaml-variants.4.12.0+mingw64c` switch.

Anybody here having success with this, before I enter in the details of my convoluted attempts?

---

<div class="post-metadata">

**Author:** ![kit-ty-kate](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/kit-ty-kate/32/5953_2.png) [@kit-ty-kate](https://discuss.ocaml.org/u/kit-ty-kate)\
**Post date:** [February 25, 2022, 1:07pm UTC](https://discuss.ocaml.org/t/does-anybody-have-tsdl-working-on-mingw64/9415/2 "2022-02-25T13:07:15Z")

</div>

cc @dbuenzli

> tests are failing to run

that seems a bit weird. Are you using `opam install -t` or `--with-test` ?

---

<div class="post-metadata">

**Author:** ![ttamttam](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/ttamttam/32/132_2.png) [@ttamttam](https://discuss.ocaml.org/u/ttamttam)\
**Post date:** [February 25, 2022, 1:20pm UTC](https://discuss.ocaml.org/t/does-anybody-have-tsdl-working-on-mingw64/9415/3 "2022-02-25T13:20:43Z")

</div>

I did `opam source tsdl`.  
And tried (from memory): `ocaml pkg/pkg.ml build --tests true`.  
But before detailing all the other tries I performed, I’d like to know if anybody has it working?

---

<div class="post-metadata">

**Author:** ![dbuenzli](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/dbuenzli/32/18_2.png) [@dbuenzli](https://discuss.ocaml.org/u/dbuenzli)\
**Post date:** [February 25, 2022, 2:08pm UTC](https://discuss.ocaml.org/t/does-anybody-have-tsdl-working-on-mingw64/9415/4 "2022-02-25T14:08:36Z")

</div>

If people were in the habit in saying _what_ exactly doesn’t work, it would be quite helpful and less time consuming. Has the art of bug reporting been lost ?

---

<div class="post-metadata">

**Author:** ![ttamttam](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/ttamttam/32/132_2.png) [@ttamttam](https://discuss.ocaml.org/u/ttamttam)\
**Post date:** [February 25, 2022, 2:28pm UTC](https://discuss.ocaml.org/t/does-anybody-have-tsdl-working-on-mingw64/9415/5 "2022-02-25T14:28:29Z")

</div>

OK. Fair enough.

My side question was just to assure that `tsdl`is supposed to work with `ocaml-variants.4.12.0+mingw64c`, precisely to avoid a long description of what I tried so far, and others to lose there time…

From your comment, I can only suppose that it is supposed to work.

I’ll revert all my attempts and will start again from the beginning, describing what I’m doing, then.

Best regards.

---

<div class="post-metadata">

**Author:** ![dbuenzli](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/dbuenzli/32/18_2.png) [@dbuenzli](https://discuss.ocaml.org/u/dbuenzli)\
**Post date:** [February 25, 2022, 2:50pm UTC](https://discuss.ocaml.org/t/does-anybody-have-tsdl-working-on-mingw64/9415/6 "2022-02-25T14:50:41Z")

</div>

> [@ttamttam](#):
>
> From your comment, I can only suppose that it is supposed to work.

I know nothing about this `ming64c` variant, so I can only suppose that it supposed to work :–)

In any case make sure you have the required sdl (i.e. at least 2.0.9), there has been this odd [bug report](https://github.com/dbuenzli/tsdl/issues/72) from people who didn’t have the right SDL version.

---

<div class="post-metadata">

**Author:** ![sanette](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/sanette/32/1645_2.png) [@sanette](https://discuss.ocaml.org/u/sanette)\
**Post date:** [October 9, 2022, 9:16am UTC](https://discuss.ocaml.org/t/does-anybody-have-tsdl-working-on-mingw64/9415/7 "2022-10-09T09:16:20Z")

</div>

Hi, did you finally succeed? I don’t have access to a Windows machine, but recently tried to use github action for my projects, see [GitHub - ocaml/setup-ocaml: GitHub Action for the OCaml programming language](https://github.com/ocaml/setup-ocaml)  
and I have this error for Windows only:

```auto
Processing 7/40: [conf-sdl2: pkg-config sdl2] [dune: ocaml bootstrap.ml]
[ERROR] The compilation of conf-sdl2 failed at "D:\\a\\snoke\\snoke\\_opam\\bin\\pkg-config.exe sdl2".
+ D:\a\snoke\snoke\_opam\bin\pkg-config.exe "sdl2" (CWD=D:/a/snoke/snoke/_opam/.opam-switch/build/conf-sdl2.1)

```

In other words it already fails at the stage of installing `conf-sdl2`, which I suppose is responsible for installing the SDL library. But I don’t know how to have more logs to see what happens.

---

<div class="post-metadata">

**Author:** ![dbuenzli](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/dbuenzli/32/18_2.png) [@dbuenzli](https://discuss.ocaml.org/u/dbuenzli)\
**Post date:** [October 9, 2022, 9:45am UTC](https://discuss.ocaml.org/t/does-anybody-have-tsdl-working-on-mingw64/9415/8 "2022-10-09T09:45:02Z")

</div>

> [@sanette](#):
>
> In other words it already fails at the stage of installing `conf-sdl2`, which I suppose is responsible for installing the SDL library.

It won’t install it, it will just check if the SDL library is installed by invoking `pkg-config sdl2` (see your error).

So you’ll first need to find a way to 1) install the SDL library and 2) make sure it’s recognized by your pkg-config.

---

<div class="post-metadata">

**Author:** ![sanette](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/sanette/32/1645_2.png) [@sanette](https://discuss.ocaml.org/u/sanette)\
**Post date:** [October 9, 2022, 10:47am UTC](https://discuss.ocaml.org/t/does-anybody-have-tsdl-working-on-mingw64/9415/9 "2022-10-09T10:47:33Z")

</div>

> [@dbuenzli](#):
>
> So you’ll first need to find a way to 1) install the SDL library and 2) make sure it’s recognized by your pkg-config

I see, so the issue must be earlier in the CI process. I checked to mac-os logs, and at some point they detect that the SDL library is required, and they install it. (I thought this was the role of the `conf-sdl2` package, so from what you are saying I suppose it comes from another tool). For some reason this step doesn’t work on their Windows host.

---

<div class="post-metadata">

**Author:** ![sanette](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/sanette/32/1645_2.png) [@sanette](https://discuss.ocaml.org/u/sanette)\
**Post date:** [October 9, 2022, 11:01am UTC](https://discuss.ocaml.org/t/does-anybody-have-tsdl-working-on-mingw64/9415/10 "2022-10-09T11:01:22Z")

</div>

> [@dbuenzli](#):
>
> It won’t install it, it will just check if the SDL library is installed by invoking `pkg-config sdl2`

if fact the `conf-sdl2` file does contain information for automatically installing the library, [opam-repository/packages/conf-sdl2/conf-sdl2.1/opam at master · ocaml/opam-repository · GitHub](https://github.com/ocaml/opam-repository/blob/master/packages/conf-sdl2/conf-sdl2.1/opam)  
but not for Windows, which I suppose is one ingredient of the problem.

---

<div class="post-metadata">

**Author:** ![dbuenzli](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/dbuenzli/32/18_2.png) [@dbuenzli](https://discuss.ocaml.org/u/dbuenzli)\
**Post date:** [October 9, 2022, 11:29am UTC](https://discuss.ocaml.org/t/does-anybody-have-tsdl-working-on-mingw64/9415/11 "2022-10-09T11:29:24Z")

</div>

> [@sanette](#):
>
> I checked to mac-os logs, and at some point they detect that the SDL library is required, and they install it.

Ah maybe nowadays [depexts](https://github.com/ocaml/opam-repository/blob/57f1b681ce75766a17f15588c2088174edbb89c9/packages/conf-sdl2/conf-sdl2.1/opam#L8-L20) automatically get installed. It used to be a separate step.

But yes indeed there are no depexts for windows. I’m not sure which package manager is assumed to install stuff on windows you should look into other packages with depexts, if there 's something sensitive. E.g. `blas` [seems](https://github.com/ocaml/opam-repository/blob/1cc1362ad5eef37b215cf3ca71858c12f314d31f/packages/conf-blas/conf-blas.1/opam#L22) to do it via `cygwin`.

---

<div class="post-metadata">

**Author:** ![sanette](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/sanette/32/1645_2.png) [@sanette](https://discuss.ocaml.org/u/sanette)\
**Post date:** [October 9, 2022, 6:10pm UTC](https://discuss.ocaml.org/t/does-anybody-have-tsdl-working-on-mingw64/9415/12 "2022-10-09T18:10:37Z")

</div>

> [@dbuenzli](#):
>
> E.g. `blas` [seems](https://github.com/ocaml/opam-repository/blob/1cc1362ad5eef37b215cf3ca71858c12f314d31f/packages/conf-blas/conf-blas.1/opam#L22) to do it via `cygwin`.

ouch, it almost worked indeed with

```auto
depexts: [
  ["SDL2"] {os = "win32" & os-distribution = "cygwinports"}
] 

```

unfortunately the SDL2 version in cygwin is too old (2.0.7) 😭

---

<div class="post-metadata">

**Author:** ![dbuenzli](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/dbuenzli/32/18_2.png) [@dbuenzli](https://discuss.ocaml.org/u/dbuenzli)\
**Post date:** [October 9, 2022, 9:51pm UTC](https://discuss.ocaml.org/t/does-anybody-have-tsdl-working-on-mingw64/9415/13 "2022-10-09T21:51:54Z")

</div>

If you’re not using newer stuff (most new versions of `tsdl` just add more bindings) maybe you can try with an older version of `tsdl`, for example [this version](https://github.com/dbuenzli/tsdl/blob/master/CHANGES.md#v096-2017-12-27-la-forclaz-vs). Ideally, which SDL version is required by each version of `tsdl` should be tracked more precisely.

---

<div class="post-metadata">

**Author:** ![sanette](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/sanette/32/1645_2.png) [@sanette](https://discuss.ocaml.org/u/sanette)\
**Post date:** [October 10, 2022, 6:56pm UTC](https://discuss.ocaml.org/t/does-anybody-have-tsdl-working-on-mingw64/9415/14 "2022-10-10T18:56:24Z")

</div>

> [@dbuenzli](#):
>
> maybe you can try with an older version of `tsdl`,

Yes, maybe I will try this, but it requires some modification of my code.  
(and apparently it is not compatible with ocaml 5). If I have some success, I will report here. Thanks again!
