Best Practices for “Cross-Platform” Development with Qt

后端 未结 6 1572
余生分开走
余生分开走 2021-01-31 08:26

According to qt.nokia.com, Qt is a \"cross-platform application and UI framework\", allowing you to \"write code once to target multiple platforms\". The Qt SDK is a \"complete

6条回答
  •  南方客
    南方客 (楼主)
    2021-01-31 09:31

    Cross-compiling is typically used for developing software on a host Linux system and compiling for a target Linux system. For years I used a Linux system running on an x86 with X11 (KDE) to cross compile our Qt application for an embedded ARM system running Qt Embedded. If you do mobile apps, you're likely cross-compiling. You can cross compile on a Windows system, of course. All you really need is the cross compiler. Since gcc is available in source code, gcc cross-compilers are quite common. To perform cross compilation with Qt, you need a mkspec for qmake that specifies what compilers to use.

    Your last paragraph indicates you're probably not going to be able to do this kind of cross compiling--you can do it on your Windows machine for Linux or probably for Mac, and you can probably do it on Linux for Windows if you're using the mingw version of Qt on Windows, but you'll never compile a Microsoft-compiler-based application on Linux or Mac for Windows.

    Bottom line--do what you indicated. Get your source on each target platform and compile it there.

提交回复
热议问题