I built an application on WSL using the qmake command. It generates an executable. But when I try running, I get the following error:
Got keys from plugin metadata ("xcb")
QFactoryLoader::QFactoryLoader() checking directory path "/mnt/c/D-drive/codage-aider/student/joanna/joanna-code/src/assignment_6/Qt-projects/HelloWorldGui/platforms" ...
loaded library "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqxcb.so"
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.
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.
Aborted
I have WSL 2 and so the graphics should work. Not sure what could be causing this issue. Any ideas on how to fix this?