0

I'm building a QT application on Ubuntu that works pretty good. Now I have to deploy it on Windows, so I installed MXE in order to cross compile my sources.

MXE build

git clone https://github.com/mxe/mxe.git
cd mxe
# I need posix threads, that why I build static.posix target
make MXE_TARGETS='i686-w64-mingw32.static.posix' qtbase libxml2

I use a personal library (that uses cmake) and a client/server code for my QT code, that I compiled with MXE and it did not give any error (I worked hard to fix them...). Then, the compilation for the QT reaches the end without any error.

Whenever I try to execute the program (with wine on Ubuntu or on Windows) it does not work. wine freezes and Windows shows me a Runtime Error.

I also tried to use the windeployqt.exe using wine on my executable, hopping it will give me the missing dlls, but it tells me :

Z:\path\release\Executable.exe 32 bit, release executable
Z:\path\release\Executable.exe does not seem to be a Qt executable.

I really have no idea on what is broken. Am I forgetting to put dlls, or is my compilation failing silently ? Does anyone knows or have ideas on how to deal with that case ?

EDIT

Apparently I compile correctly my program, the error seems to come from GetAdapterAdresse when using Windows. The problem is not coming from MXE at all (I'm glad I made it work though).

I'll have to have a look on this function, but anyone knows how to make gdb work with MXE ? When I ran make gdb, it has built something, but I can't figure out where is the program.

Zelnes
  • 403
  • 3
  • 10
  • What's the Windows OS version you are trying to run? – Max Go Apr 26 '17 at 10:23
  • It's Windows 10 – Zelnes Apr 26 '17 at 10:24
  • Have you considered using *Dependency Walker* on Windows to see what DLLs are missing? http://www.dependencywalker.com/ – Philipp Ludwig Apr 26 '17 at 14:39
  • @PhilippLudwig Thanks for your proposition, I'll check that and see what it says ! – Zelnes Apr 27 '17 at 07:34
  • @PhilippLudwig Ok so I've been able to list all dlls, but if I copy them (from wine installation) in my executable location, it still does not work neither on Ubuntu nor Windows. Now the new error is "Unable to run the application (0xc000007b)"... I'm going to try each of them until I have something else – Zelnes Apr 27 '17 at 08:03
  • @PhilippLudwig I tried the Profile mode, and I have a bunch of errors, I'm going to compile QT5 with MXE for both 32 and 64 bits and for each of them I'll see... – Zelnes Apr 27 '17 at 08:30
  • Don't forget that for running the application under windows you will also need to provide the necessary Qt plugins; a lot of information is available in the Qt documentation, they also talk about the dependency walker there: https://doc.qt.io/qt-5/windows-deployment.html – Philipp Ludwig Apr 27 '17 at 09:04
  • @PhilippLudwig There might be a problem because I've never seen yet A QT dll listed with Dependency Walker (and QT deployment tool told me before that the executable was not a QT one). It's probably coming from the same error source, but I can't figure out where it comes from (don't forget that I built qt for static compilation). Should I try the shared one? – Zelnes Apr 27 '17 at 09:19

0 Answers0