Can I compile for Linux my applications?
The codes that I wrote I would like to compile to linux. Is it possible it.
How can we know that? We have not seen your code, we don't know if you are using any platform-specific APIs etc.
In general, if you have written an application in Qt, then the answer is yes - you can compile it on any platform supported by Qt (Linux, Windows, macOS, iOS, Android, and others).
Yes it is ( if pure Qt) . just install a linux with compiler tools +Qt
and the project can just compile :)
Most easy is to use virtual machine for that.
Its also possible to cross compile for linux from windows, but
its expert level and completely outside Qt.
Unless you are a tool chain geek, it will/ might take days.
Much, much easier to setup a virtual linux and have fun.
on a SSD disk it takes may 30 mins to be ready with Qt and all.
I mean,if I write a code on Java ,programs run on any platform as far as I know ,I never use java,but persons who use it say like this. So that when I write code on windows,Can I run it on linux?I suppose my question is now better.
So that when I write code on windows,Can I run it on linux?
No, it's not possible. Each platform and CPU architecture has a very distinct binary format and they are not interchangeable.
There are Windows emulators like Wine which can run your Windows binaries on Linux.
@ZekDe Telling someone to use Java, because it runs on all platforms is like telling someone "Get a Tank, it drives on all roads and even offroad!"
That said, even using pure Java /JS you'll need platform specific lowlevel nativ code.
If you use only Pure Qt-Classes, than you can create from one single source code, programms/Apps for nearly all common OS
@ZekDe If you use C++/Qt you need to build your app for each platform you want to support. So, to support Linux you need to build it for Linux as people suggested above. C++ is not Java.
Java is interpreted.
C++ is compiled.
if you want to know the difference, please see here
There is no magic to java. its need support for the platform or it cant run.
Thanks all information ,
as far as I understand,I have to use virtual machine for it, and my problem will end.Also tank story is made me laugh :)