Important: Please read the Qt Code of Conduct -

Qt application in windows and linux are same ?

  • Hi all,
    i have did a simple Qt application using TCP/IP communication in windows ,but is this same application works in linux platform also ?? please confirm me about the issue.

    Thanks & Regards,

  • I think if you does not use windows api or windows library or any other external or third party library . then it should work on linux as well as windows.

    But i am hoping for straight and good reply from SGaist.

  • Moderators


    ankursaxena is right. If you used Qt classes only, then you can copy the source code into Linux and compile a Linux executable.

    (Note: You cannot copy the Windows executable into Linux)

  • hii
    Yes you can ..This is what Qt's main advantage,
    Write Once. Deploy Everywhere..
    but if you want to deploy on linux then you have to compile your source code on linux as well using Qt ctreator as you compiled in windows.

    Second thing is that if your source code having some window native api(MSDN)
    then you have to use macros like
    #ifdef QT_ARCH_MACOSX
    //mac code
    #else if QT_ARCH_WINDOWS
    //window code
    //any other code
    hope it will help

Log in to reply