Cross-platform



  • Dear All,

    I am new in qt development and my company is gonna to change the development software from visual studio because some of the customer request for develop into other platform. However, visual studio do not provide cross-platform development. I would like to ask few question about the cross-over:

    1. Do crossover platform need third party tools in qt development? (Eg: Develop in microsoft but need to execute in mac)
    2. If need, do the third party tools is expensive?
    3. How to do cross-over compilation?
    4. Do the crossover platform means that same code in microsoft but can run in other platform?

    Thanks. (Sorry for my english expresssion--)



  • We do cross-platform, Windows, Linux and Linux embedded.

    You can continue developing using Visual Studio on Windows. What you have to worry about is:

    -) Only include headers that will be available on all platforms you want to deploy to. All standard C/C++ headers, as well as Qt are just fine. Anything Microsoft-specific cannot be used (or you have to take care of the platform-specific handling using #ifdef QT_OS_WIN and that like)

    -) You will have different compilers on different platforms. They can be closely related (e.g. MinGW on Windows versus GCC on Linux), or entirely different (e.g. VC compiler on Windows versus GCC on linux). This is not really an issue. The only thing is that different compilers tend to produce different warnings. That can be both a good and bad thing.

    -) The real issue is the build chain, and how your projects must be structured so they can be built on each platform. A possible solution (the one I use currently) is to use qmake project files (.pro). qmake can generate the necessary makefiles on all platforms where Qt is supported.

    -) When developing on Windows, never forget that Linux is case-sensitive with filenames. Things that compile on Windows will not compile on Linux, because on Linux
    @#include <Qstring.h>@
    will not find the correct file. It must be either
    @#include <qstring.h>@
    or
    @#include <QString>@

    -) You will at least need to debug and test your applications on all platforms. Therefore, even if you keep Visual Studio as your main IDE, you'll need a debugger for each other target platform. Qt Creator is naturally a candidate here.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.