How does porting between Linux and Windows work?

后端 未结 8 1703
庸人自扰
庸人自扰 2021-01-05 05:14

If a particular piece of software is made to be run on one platform and the programmer/company/whatever wants to port it to the other, what exactly is done? I mean, do they

8条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-05 05:44

    If the software was written for a single OS, a major rework is likely. The first step is to move absolutely all platform-specific code into a single area of the code base; this area should have little or no app-specific stuff. Then rewrite this isolated portion of the code for the new target OS.

    Of course, this glosses over some extremely major implications. For instance, if your first version targeted the Win32 API, then any GUI code will be heavily tied to Windows, and to maintain any hope of preserving your sanity, you will need to move all that code to a cross-platform GUI framework like Qt or GTK.

提交回复
热议问题