# Unable to build gstreamer using Meson on Windows

**URL:** https://discourse.gstreamer.org/t/unable-to-build-gstreamer-using-meson-on-windows/4454
**Category:** General Discussion
**Tags:** windows
**Created:** [April 12, 2025, 7:20am UTC](https://discourse.gstreamer.org/t/unable-to-build-gstreamer-using-meson-on-windows/4454 "2025-04-12T07:20:52Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![floppyhammer](https://discourse.gstreamer.org/letter_avatar_proxy/v4/letter/f/3e96dc/32.png) [@floppyhammer](https://discourse.gstreamer.org/u/floppyhammer)
#### Post date: [April 12, 2025, 7:20am UTC](https://discourse.gstreamer.org/t/unable-to-build-gstreamer-using-meson-on-windows/4454/1 "2025-04-12T07:20:52Z")

</div>

I just ran `meson setup buildDir` in a clean gstreamer clone and got an error in `meson-log.txt`

```auto
--- stderr ---
Traceback (most recent call last):
  File "mesonbuild\mesonmain.py", line 193, in run
  File "mesonbuild\mesonmain.py", line 148, in run_runpython_command
  File "<frozen runpy>", line 287, in run_path
  File "<frozen runpy>", line 98, in _run_module_code
  File "<frozen runpy>", line 88, in _run_code
  File "D:\Dev\Projects\gstreamer\subprojects\glib-2.82.4\tools/grab-gio-dll-paths.py", line 68, in <module>
    main()
    ~~~~ ^^
  File "D:\Dev\Projects\gstreamer\subprojects\glib-2.82.4\tools/grab-gio-dll-paths.py", line 33, in main
    raise ValueError("%s is not a valid build path" % build_path)
ValueError: D:\Dev\Projects\gstreamer\buildDir\subprojects\glib-2.82.4 is not a valid build path

subprojects\glib-2.82.4\girepository\introspection\meson.build:35:26: ERROR: Command `"C:\Program Files\Meson\meson.exe" runpython D:\Dev\Projects\gstreamer\subprojects\glib-2.82.4\tools/grab-gio-dll-paths.py --build-path=D:\Dev\Projects\gstreamer\buildDir\subprojects\glib-2.82.4` failed with status 2.

```

I have no problem building it on Linux or Android though.

---

<div class="post-metadata">

### Author: ![JuzioMiecio520](https://discourse.gstreamer.org/user_avatar/discourse.gstreamer.org/juziomiecio520/32/1529_2.png) [@JuzioMiecio520](https://discourse.gstreamer.org/u/JuzioMiecio520)
#### Post date: [October 24, 2025, 4:04pm UTC](https://discourse.gstreamer.org/t/unable-to-build-gstreamer-using-meson-on-windows/4454/2 "2025-10-24T16:04:08Z")

</div>

Bump, has anyone been able to resolve this?

---

<div class="post-metadata">

### Author: ![tjwilli58](https://discourse.gstreamer.org/user_avatar/discourse.gstreamer.org/tjwilli58/32/83_2.png) [@tjwilli58](https://discourse.gstreamer.org/u/tjwilli58)
#### Post date: [October 24, 2025, 7:30pm UTC](https://discourse.gstreamer.org/t/unable-to-build-gstreamer-using-meson-on-windows/4454/3 "2025-10-24T19:30:46Z")

</div>

No expert here. I haven’t been able to fully build gstreamer with meson myself if I want `gst-python` built. (See [Error: libvpx build failed · Issue #1655 · wingtk/gvsbuild · GitHub](https://github.com/wingtk/gvsbuild/issues/1655))

Have you tried installing meson with pip yet? `pip install meson`

---

<div class="post-metadata">

### Author: ![tjwilli58](https://discourse.gstreamer.org/user_avatar/discourse.gstreamer.org/tjwilli58/32/83_2.png) [@tjwilli58](https://discourse.gstreamer.org/u/tjwilli58)
#### Post date: [October 24, 2025, 7:34pm UTC](https://discourse.gstreamer.org/t/unable-to-build-gstreamer-using-meson-on-windows/4454/4 "2025-10-24T19:34:14Z")

</div>

I meant to attach this link:

> **[gst-python: building v1.26 pygobject, gst-python test fail with 'GObject',...](https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/4699)**
>
> Describe your issue Trying to build gstreamer 1.26 using meson. Switches used:

---

<div class="post-metadata">

### Author: ![tjwilli58](https://discourse.gstreamer.org/user_avatar/discourse.gstreamer.org/tjwilli58/32/83_2.png) [@tjwilli58](https://discourse.gstreamer.org/u/tjwilli58)
#### Post date: [October 24, 2025, 7:46pm UTC](https://discourse.gstreamer.org/t/unable-to-build-gstreamer-using-meson-on-windows/4454/5 "2025-10-24T19:46:27Z")

</div>

Again, no expert here by any means, but at  
[Getting Meson](https://mesonbuild.com/Getting-meson.html#installing-meson-and-ninja-with-the-msi-installer)  
there is this line:

```auto
Please note that this is a new feature, so bug reports are expected and welcome!

```

---

<div class="post-metadata">

### Author: ![JuzioMiecio520](https://discourse.gstreamer.org/user_avatar/discourse.gstreamer.org/juziomiecio520/32/1529_2.png) [@JuzioMiecio520](https://discourse.gstreamer.org/u/JuzioMiecio520)
#### Post date: [October 24, 2025, 8:15pm UTC](https://discourse.gstreamer.org/t/unable-to-build-gstreamer-using-meson-on-windows/4454/6 "2025-10-24T20:15:10Z")

</div>

Oh right, did not notice that. Unfortunately, after removing Meson installed via MSI and reinstalling via pip, the same issue occurs.

Side note, that error is getting thrown by `glib/introspection`. I tried compiling only the `gstreamer-sharp` subproject and got another error (see below), but also related to introspection. Perhaps it’s more of a global issue with this module?

```auto
subprojects\\gtk-sharp\\Source\\tests\\generator\\regress\\meson.build:64:20: ERROR: Dependency ‘gobject-introspection-1.0’ tool variable ‘g_ir_scanner’ contains erroneous value: ‘C:/Program\\ Files/gstreamer/1.0/msvc_x86_64/bin/g-ir-scanner’

This is a distributor issue – please report it to your gobject-introspection-1.0 provider.

```

The file this error is referencing also does not seem to exist? Even though I chose the “complete” gstreamer installation

---

<div class="post-metadata">

### Author: ![tjwilli58](https://discourse.gstreamer.org/user_avatar/discourse.gstreamer.org/tjwilli58/32/83_2.png) [@tjwilli58](https://discourse.gstreamer.org/u/tjwilli58)
#### Post date: [October 24, 2025, 9:42pm UTC](https://discourse.gstreamer.org/t/unable-to-build-gstreamer-using-meson-on-windows/4454/7 "2025-10-24T21:42:01Z")

</div>

Years ago, when I first started trying to build gstreamer, I always got stuck when it came to gobject-introspection. I finally found [gvsbuild](https://github.com/wingtk/gvsbuild). I don’t remember how I stumbled on it, but I’ve found it to be easier to build than using the gstreamer directions. It also uses meson.

I still want to be able to build it from the gstreamer instructions, and I think I finally have it. I need to have gst-python, and that needs gobject-introspection, so you may want to try using `Dintrospection=enabled` in your setup. Something like:

`meson setup -Dintrospection=enabled build_dir`

---

<div class="post-metadata">

### Author: ![tjwilli58](https://discourse.gstreamer.org/user_avatar/discourse.gstreamer.org/tjwilli58/32/83_2.png) [@tjwilli58](https://discourse.gstreamer.org/u/tjwilli58)
#### Post date: [October 24, 2025, 9:45pm UTC](https://discourse.gstreamer.org/t/unable-to-build-gstreamer-using-meson-on-windows/4454/8 "2025-10-24T21:45:04Z")

</div>

> [@JuzioMiecio520](#):
>
> The file this error is referencing also does not seem to exist? Even though I chose the “complete” gstreamer installation

I thought you were trying to build this from source?

---

<div class="post-metadata">

### Author: ![JuzioMiecio520](https://discourse.gstreamer.org/user_avatar/discourse.gstreamer.org/juziomiecio520/32/1529_2.png) [@JuzioMiecio520](https://discourse.gstreamer.org/u/JuzioMiecio520)
#### Post date: [October 25, 2025, 9:02am UTC](https://discourse.gstreamer.org/t/unable-to-build-gstreamer-using-meson-on-windows/4454/9 "2025-10-25T09:02:46Z")

</div>

Okay, got it working:

1. If you read the `grab-gio-dll-paths.py` script on line 33 it wants the glib path to have a subfolder `meson-uninstalled`, but since it does not exist, just create it manually
2. If you already have gstreamer installed anywhere else, remove it’s environment variables
3. pip install `setuptools` if you do not have them yet
4. meson now prepares project correctly

When running ninja remember to run it in MSVC console OR add MSVC vars manually by running the `vcvarsall.bat` file located in `C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build`

Right now I am just running into some weird issues with linking against gstreamer built by me. Specifically, I either get an error when creating an element ( `gst_element_factory_create` returns false) or a very weird GLib error (something about `assert is_g_object failed`)
