C ++ Cross-Platform Libraries

I am not completely new to C ++, but I have never managed to get around the library.

I would like to separate my network, graphic, and input classes from my main executable so that I can update them separately, and then send a recompiled version of all the code as a single executable.

Is this possible, and how do I make this cross platform? (For example, the process will run on Windows, Linux, and Mac)

+3
source share
4 answers

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

Secondly, all "updated" libraries must comply with binary compatibility (what Qt agrees to do for each major version does not know about wxWidgets).

The third and probably "yes, du!" part: you need to create them as shared libraries and link these shared libraries.

, . (linux: , Mac Windows , , Mac Mac?)

+4

, Qt

+2

Indeed, this does not make sense. You will have to recompile the binary when you move it to another platform anyway, because different platforms use different hardware and use different binary formats. There is no reason not just to refer to your "platform-specific" code in the same binary file.

However, a cross-platform at the source level makes sense.

0
source

All Articles