# Random Qt5 plugins linking issue

**URL:** https://community.mrtrix.org/t/random-qt5-plugins-linking-issue/5875
**Category:** Uncategorized
**Tags:** mrview, error
**Created:** [July 19, 2022, 2:35am UTC](https://community.mrtrix.org/t/random-qt5-plugins-linking-issue/5875 "2022-07-19T02:35:34Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![j-tseng](https://community.mrtrix.org/user_avatar/community.mrtrix.org/j-tseng/32/3096_2.png) [@j-tseng](https://community.mrtrix.org/u/j-tseng)
#### Post date: [July 19, 2022, 2:35am UTC](https://community.mrtrix.org/t/random-qt5-plugins-linking-issue/5875/1 "2022-07-19T02:35:34Z")

</div>

I had an issue and I solved it, and I figured I’d document it here in case anyone else runs into it. For some reason, after installing mrtrix3 through miniconda on Ubuntu 18.04, mrview didn’t work. It gave a linking error, citing that it could not find or load the Qt platform package “xcb” in “”. The “” tipped me off that it was failing to find it at all.

After scrubbing around the internet, what worked was exporting the Qt5 plugins path, as per the post [here](https://stackoverflow.com/a/40991619). So, add to your preferred config file (e.g., `~/.bashrc`):

`export QT_PLUGIN_PATH=<qt base path>/plugins`

where you should sub in `<qt base path>` with the relevant plugins path. You can use `dpkg` with the --list-files argument to hunt down where qt5 can be found.

---

<div class="post-metadata">

### Author: ![franpadormo](https://community.mrtrix.org/user_avatar/community.mrtrix.org/franpadormo/32/5292_2.png) [@franpadormo](https://community.mrtrix.org/u/franpadormo)
#### Post date: [October 31, 2025, 9:12am UTC](https://community.mrtrix.org/t/random-qt5-plugins-linking-issue/5875/2 "2025-10-31T09:12:58Z")

</div>

Just adding to this thread as I’ve just been struggling to get mrview running on Windows 11 running WSL1. I had been receiving the classic error:

```auto
qt.qpa.xcb: could not connect to display
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

```

I tried running with extended debugging (`export QT_DEBUG_PLUGINS=1`), but nothing obvious appeared. I tried all the other tips shared throughout this community (thanks everyone!) but also no luck. I tried other tips from across the web (e.g. `ldd \wsl.localhost\Ubuntu-20.04\usr\lib\x86_64-linux-gnu\qt5\plugins\platforms\libqxcb.so`) but no libraries were missing.

But in the end I was successful! The trick? This [page](https://stackoverflow.com/questions/76102172/unable-to-run-parafoam-in-wsl1) suggested I needed to install [vcxsrv](https://sourceforge.net/projects/vcxsrv/), so I did, and now mrview runs!

---

<div class="post-metadata">

### Author: ![rsmith](https://community.mrtrix.org/user_avatar/community.mrtrix.org/rsmith/32/2672_2.png) [@rsmith](https://community.mrtrix.org/u/rsmith)
#### Post date: [November 18, 2025, 3:03am UTC](https://community.mrtrix.org/t/random-qt5-plugins-linking-issue/5875/3 "2025-11-18T03:03:27Z")

</div>

Thanks @franpadormo; I’ve added your suggestion to the relevant [Wiki page](https://community.mrtrix.org/t/opengl-display-issues/2549) (trying to be diligent in centralising valuable information!).
