meson: Cross-compiled Qt program doesn't start — missing windows plugin
I can compile a hello world Qt5 program (a window with a button, created in QtCreator) on Linux for Windows just fine using https://github.com/mxe/mxe (everything is compiled as static libs) but running the program on Wine or native Windows 7 fails with that message. The Linux version compiled with Meson works ok. The Meson’s Qt module is probably missing platform plugins linking but I’m not savvy enough to add them.
meson.build is simple:
project('Hello world', 'cpp')
qt5 = import('qt5')
qt5_dep = dependency('qt5', modules: ['Core', 'Gui', 'Widgets'])
moc_files = qt5.preprocess(moc_headers : ['mainwindow.h'],
ui_files : [
'mainwindow.ui'
])
src = ['main.cpp',
'mainwindow.cpp'
]
executable('helloworld', src, moc_files,
dependencies : qt5_dep)
Here’s the ninja’s link args:
LINK_ARGS = -Wl,--no-undefined -Wl,--as-needed -L/home/rkfg/soft/mxe/usr/i686-w64-mingw32.static.posix/qt5/lib -Wl,--start-group -lQt5Core -lole32 -luuid -lws2_32 -ladvapi32 -lshell32 -luser
32 -lkernel32 -lmpr -lz -lpcre16 -lQt5Gui -lgdi32 -lcomdlg32 -loleaut32 -limm32 -lwinmm -lopengl32 -ljpeg -L/home/rkfg/soft/mxe/usr/i686-w64-mingw32.static.posix/qt5/lib -lQt5Core -lpng -lhar
fbuzz -lole32 -luuid -lws2_32 -ladvapi32 -lshell32 -luser32 -lkernel32 -lmpr -lz -lpcre16 -lQt5Widgets -lQt5Gui -lgdi32 -lcomdlg32 -loleaut32 -limm32 -lwinmm -lopengl32 -ljpeg -L/home/rkfg/so
ft/mxe/usr/i686-w64-mingw32.static.posix/qt5/lib -lQt5Core -lpng -lharfbuzz -lole32 -luuid -lws2_32 -ladvapi32 -lshell32 -luser32 -lkernel32 -lmpr -lz -lpcre16 -lwinspool -Wl,--end-group
From qmake’s generated Makefile (that produces a working binary):
LIBS = -lglu32 -lmingw32 -L/home/rkfg/soft/mxe/usr/i686-w64-mingw32.static.posix/qt5/lib -lqtmain -lQt5Widgets -L/home/rkfg/soft/mxe/usr/i686-w64-mingw32.static.posix/qt5/plugin
s/platforms -lqwindows -lwinspool -lshlwapi -lfreetype -lbz2 -lQt5PlatformSupport -lQt5DBus -L//home/rkfg/soft/mxe/usr/i686-w64-mingw32.static.posix/lib/pkgconfig/../..//lib -ldbus-1 -liphlpa
pi -ldbghelp -lnetapi32 -L/home/rkfg/soft/mxe/usr/i686-w64-mingw32.static.posix/qt5/plugins/imageformats -lqico -lQt5Gui -lgdi32 -lcomdlg32 -loleaut32 -limm32 -lwinmm -lopengl32 -ljpeg -lpng
-lharfbuzz -lQt5Core -lole32 -luuid -lws2_32 -ladvapi32 -lshell32 -luser32 -lkernel32 -lmpr -lz -lpcre16
cross file:
[binaries]
c = '/home/rkfg/soft/mxe/usr/bin/i686-w64-mingw32.static.posix-gcc'
cpp = '/home/rkfg/soft/mxe/usr/bin/i686-w64-mingw32.static.posix-g++'
ar = '/home/rkfg/soft/mxe/usr/bin/i686-w64-mingw32.static.posix-ar'
strip = '/home/rkfg/soft/mxe/usr/bin/i686-w64-mingw32.static.posix-strip'
pkgconfig = '/home/rkfg/soft/mxe/usr/bin/i686-w64-mingw32.static.posix-pkg-config'
[host_machine]
system = 'windows'
cpu_family = 'x86'
cpu = 'i686'
endian = 'little'
About this issue
- Original URL
- State: open
- Created 7 years ago
- Comments: 16 (11 by maintainers)
Thank you for all this informations, I’ll investigate this and come back when I find the solution.