简体   繁体   中英

Compile Qt Project To Run On A Linux System

I have a Qt project. It uses the cross platform libraries SDL, OpenGL and FLTK. I want to be able to compile the project so that it can run on a Linux computer. I'm looking at a bunch of articles I have seen so far two ways to do this. Use a cross compiler, which seems to me a rather complicated thing to setup and compile with, or, the other options, is to compile the project simply on a Linux computer, simply the Linux version of Qt creator/SDK.

My question is, If I have a Qt project that uses only cross platform libraries, then is creating a Windows version easy as compiling it in Qt/Windows, and creating the Linux version as easy as doing it in Qt/Linux?

PS. Please don't ask/complain about why I didn't just try to see if it works myself, I don't have any Linux OS's installed on my computer right now, and I don't want to risk going into the trouble of installing a whole new OS just to have it not work in the end.

I don't have any Linux OS's installed on my computer right now, and I don't want to risk going into the trouble of installing a whole new OS just to have it not work in the end.

Have you heard about virtualization. Install VirtualBox and Linux. If your machine is not so powerfull to host 2 system at once you can create bootable pendrive. It will be easier and faster than cross-compiling your program. In fact you must install Linux somewhere to test if everything works the fine.

Nevertheless if you really can't install Linux you can try. I heard about compilation on Linux for Windows but only in one way. Problem with Linux is that every distribution has it's own structure. So even if you create executable file you can't be sure if it runs on every system (it's not Java). But if you switch to QtCreator compilation will be very easy - just click build the button. If you decide to install Linux on VM and don't have enough resource to run graphical mode, login with ssh and compile from command line.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM