How to make .exe file on Ubuntu
-
Hello every one.
I wrote a code using Qt Creator 2.5.2 ( Based on Qt 4.8.1 64 bit) , which installed on Ubuntu 12.04 (precise) 64-bit. I genenrated a excutable file, which work only on Ubuntu. and when I tried to generate .exe file using the following command:
$i586-mingw32msvc-g++ -o calculator.exe main.cpp mainwindow.cpp
I got this error:
main.cpp:1:30: error: QtGui/QApplication: No such file or directory
So, how can I generate .exe file to to work on windows OS.My best regards
Legnain
-
Hola,
To cross-compile Qt application, it's not as easy as using just g++ (you can though). But normally you use qmake to compile your Qt app.
The easiest approach would be just to compile your Qt app on windows. But it's not bad to know and learn how to do cross-compilation either. Check "this blog":http://divided-mind.blogspot.co.uk/2007/09/cross-compiling-qt4win-on-linux.html, for instructions how to do it. I found that link "here, in Qt documentation":http://qt-project.org/doc/qt-5.0/qtdoc/deployment-windows.html.
-
Finaly, I found the solution in the following link
http://stackoverflow.com/questions/10934683/how-do-i-configure-qt-for-cross-compilation-from-linux-to-windows-targetHere is the steps
#1 Get it:
$ git clone https://github.com/mxe/mxe.git#2 Build Qt for Windows, its dependencies, and the cross-build tools; this will take about an hour on a fast machine with decent internet access; the download is about 500MB:
$ cd mxe && make qt#3 Get to the directory of your app and add the cross-build tools to the PATH:
$ export PATH=<mxe root>/usr/bin:$PATH#4 Run the Qt Makefile generator tool then build:
$ <mxe root>/usr/i686-pc-mingw32/qt/bin/qmake && make#5 You should find the binary in the ./release directory:
$ wine release/foo.exe -
Please provide me a complete solution to make .exe of QT Application in Ubuntu 18.0
-
You can't make .exe on ubuntu platform. exe extension is only for windows.
Have you installed Qt on Ubuntu ?
Are you able to launch Qt creator ? -
Please provide me a complete solution to make .exe of QT Application in Ubuntu 18.0
@Rahul-Samanta
Hi
you have to come up with better description about what you are doing or
nobody can really help you,
If you are not cross compiling, an exe is made pr default.
so can you add some details about platforms, what type of exe
and so on you are trying to make ? -
Yes sir, I'm able to launch the Qt Creator, in Ubuntu. and developed some demo Qt GUI Application, those are running fine in build mode.
-
that is good. You are able to build & run the program. It means the executable is built and it works. Now tell us what are you searching for ?
-
Sir, I want a single setup file of that existing QT project in Ubuntu/ Linux, that will run in other Linux machine. now I am running the application in Build mode from Qt Creator.
-
ok. For this you need all the dependent libraries to copied. You can some thing like deployment tools. It should help you to package all the dependent so files
-
Sir, I tried this approach but, I am not getting the procedure rather the steps to follow. sir, can you please specify the steps to follow in detail.
Thanks & Regards,
Rahul. -
For any application to run you need to have all dependent libraries. So for qt you need to copy all the dependent libraries like libqtwidgets,libcore, lingui.so etc library files. Please copy all these libraries to new system along with your executable. If you run linuxdeploymet tool it will automatically to copy them. Hope it is clear
-
Hi, Sir, inside that deployment tools [linuxdeployqt (https://github.com/probonopd/linuxdeployqt), I can't find out the "linuxdeployqt.appimage "file. Without this file how is it possible to run rather install the Liinuxdeployqt tools??
Thanks & Regards,
Rahul. -
@Rahul-Samanta In general you need dependent library for the program to work. Copy all the Qt*.so files along with executable. It should work.
-
@Rahul-Samanta In general you need dependent library for the program to work. Copy all the Qt*.so files along with executable. It should work.
@dheerendra said in How to make .exe file on Ubuntu:
@Rahul-Samanta In general you need dependent library for the program to work. Copy all the Qt*.so files along with executable. It should work.
Hi Sir, I have fixed all those deployment issues using the linuxdeplyqt and linuxdeployqt.appimage, able to create executable for QT application. also tested the application for other Linux pc, and its working fine.
Thanks & Regards,
Rahul. -
@dheerendra said in How to make .exe file on Ubuntu:
@Rahul-Samanta In general you need dependent library for the program to work. Copy all the Qt*.so files along with executable. It should work.
Hi Sir, I have fixed all those deployment issues using the linuxdeplyqt and linuxdeployqt.appimage, able to create executable for QT application. also tested the application for other Linux pc, and its working fine.
Thanks & Regards,
Rahul.@Rahul-Samanta hi sir , you can guide for me using linuxdeplyqt and linuxdeployqt.appimage