C ++跨平台库 [英] C++ Cross platform libraries

查看:164
本文介绍了C ++跨平台库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不是C ++的新手,但我从来没有设法让我的头围绕着图书馆。

I'm not exactly new to C++ but I've never managed to get my head around Libraries.

我想拆分我的网络,图形和输入类设置了我的主可执行文件,以便我可以单独更新它们,而不是作为单个可执行文件发送所有代码的重新编译版本。

I would like to split my networking, graphics and input class sets out of my main executable so that I can update them individually rather then sending out a recompiled version of all the code as a single executable.

这是可能的,我做这个跨平台? (例如该过程将在Windows,Linux和Mac上正常工作)

Is this possible and how do I do this cross platform? (E.g. the process will work on Windows, Linux and Mac)

推荐答案

正如@Armen最简单的说法,这里的要求是一个作为跨平台尽可能/需要的库。 Qt是这个的明显选择。有其他类似wxWidgets实现相同的事情,选择取决于你。

As @Armen said in the simplest of terms, one of the requirements here is a library that works as cross-platform as possible/needed. Qt is the obvious choice for this. There are others like wxWidgets that achieve the same thing and the choice is up to you.

第二件事是所有的可升级库需要符合二进制兼容性(Qt承诺为每个主要版本做的事情,不知道wxWidgets)。

The second thing is that all the "upgradeable" libraries need to conform to binary compatibility (something which Qt pledges to do for every major version, don't know about wxWidgets).

第三个也许是yeah,duh!部分:您需要将它们构建为共享库并链接这些共享库。

Third and probably the "yeah, duh!" part: you need to build these as shared libraries and link these shared libraries.

这三点应该允许您替换库而不重建可执行文件本身,尽可能小。虽然(linux:自动通过存储库,Mac和Windows手动或通过自己的更新软件,或者Mac的macports),升级的方式会有所不同。

These three points should allow you to replace the libraries without rebuilding the executable file itself and keep that as small as possible. The way of upgrading will be different across platforms though (linux: automatic through repositories, Mac and Windows manually or through your own updating software, perhaps macports for Mac?)

这篇关于C ++跨平台库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆