我将WSL与'xrdp&xfce4'正在运行以访问X-Server。我正在尝试使用Qt5为NS-3运行">NetAnim"。
我一运行:
$ ./NetAnim
它给出一个输出:
qt.qpa.xcb: could not connect to display localhost:0.0
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.
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.
Aborted (core dumped)
我试过:
export DISPLAY=0:0
仍然给出相同的输出。
解决了!我所做的是:
- 在BIOS中启用虚拟化
- 重置WSL
- 已将WSL1升级为WSL2
- 将WSL:2设置为默认值,<deb_pack>:2默认值
使用WSL2并不会对Qt大惊小怪。
您可能遇到了一个众所周知但记录不足的WSLv1问题:它无法正确解析ABI标记并崩溃。https://github.com/Microsoft/WSL/issues/3023
它可以通过以下命令剥离标签来解决(需要sudo(
find /lib /usr/lib /usr/libexec -name 'libQt5Core.so' | xargs strip --remove-section=.note.ABI-tag