且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

我的C ++程序可以在linux/windows/mac上运行吗? (Eclipse IDE帮助)

更新时间:2023-10-16 16:24:04

工具链:我将使用默认的一个工具链(如果有).或您的计算机上安装的是什么(即,如果您具有gcc/g ++,我将假定默认的工具链就是那个.

无论如何,当一个人希望能够编写多平台程序时,就有2条开发路径:

1-仅使用不同平台之间可用的最低通用API,这意味着将需要重新编写所有UI和大多数/所有低级API,以适应环境中的差异.幸运的是,带有STL和boost的C ++将提供一个很好的跨平台解决方案.但是您可能必须为每个平台生成不同的项目/构建环境和/或学习使用make(和makefile)

2-使用支持QT等所有环境的工具包;有利的一面是,在不同的平台上构建应该很容易;缺点是,由于它是跨平台的,因此行为不会像人们期望的那样自然. (某些UI在不同的平台上会感觉很奇怪(但这是几年前使用QT的经验)

祝你好运
Toolchains : I''d use the one toolchain that is the default (if one is available); or what is installed on your machine (i.e. if you have gcc/g++ , I would assume the default toolchain will be that.

In any case, when one wants to be able to program multi-platform, one has 2 development path :

1- use only the lowest common API available between the different platforms, meaning that all UI, and most/all low level API will need to be re-written to fit the difference in the environment. Luckily, C++ with STL and boost will offer a good cross-platform solution. But you will probably have to generate a different project/build environment for each platform and/or learn to use make (and makefiles)

2- use a toolkit that support all environment like QT; the up side is that it should be easy to build on the different platforms; the downside is that because it is cross-platform the behaviour will not be as native as one would expect. (some UI will feel weird on the different platforms (but that is from experience with QT from a few years ago)

Good luck


google不是与Linux兼容吗?
Isn''t google compatible with Linux?