V
V
vvafree2017-02-25 10:53:15
C++ / C#
vvafree, 2017-02-25 10:53:15

How to write cross-platform applications in C++?

Good afternoon. I want to learn how to write crossplatform software.
Now I use only visual studio 2015.
Which GUI should a beginner choose? Found such - GTK, QT, WxWidgets.
Which compilers to use, I got used to the convenience of Visual Studio, but it seems like you can only write console applications under linux there.
They advise eclipse and clion, but I'm afraid of clion, since cmake is generally zero.
Help with experience.
Platforms - Windows 86_64, Linux 86_64, Andoird

Answer the question

In order to leave comments, you need to log in

6 answer(s)
A
Adamos, 2017-02-25
@Adamos

GTk is not C++, it's C.
wxWidgets are lightweight and a lot like MFC/VCL, which used to be a plus. I myself use this library for cross-platform development, but now, at a crossroads, I still advise Qt. And still I advise to write not under Windows. For the same reasons, from which the web does not initially make up under the Donkey. The principle "we work according to standards, add crutches for deviations", and not vice versa.

R
Rou1997, 2017-02-25
@Rou1997

Of the cross-platform IDE, Qt Creator is the best and easiest, but you probably want the wrong thing, you didn’t even indicate which platforms, not to mention which applications, the same Qt for the Android platform is a very dubious solution, like C ++ in general, but for Arduino does not exist at all, but it is also a platform.

D
Dmitry, 2017-02-25
@TrueBers

You can write cross-platform on anything. Graphical applications now make up 10 percent of everything that is written. Everything goes to the web, if you want a good gui and fast, take the Chromium Engine Framework, typeset the design on your knee, and everything turns out quickly and cool, the vast majority of graphic consumer applications are now written on it.
Moreover, a decent amount of the latest popular development environments, all sorts of editors, is written in... JavaScript! On Node.js and the Electron platform. Stupidly, it’s faster to make a separate frontend, some model, backend, immediately see the changes than sit and wait while Qt recompiles, throws an error that turns out to be a bug that they don’t want to fix, etc.
Visual Studio is very shitty for cross-platform development, not as an environment, but as a compiler, it has its own idea of ​​​​the language standard, basic things may not be supported, or supported in its own, very strange form.
First you need to decide what you want to write and whether you need a graphical interface for this at all.

C
cap_nemo, 2017-02-25
@cap_nemo

Writing in GTK for C++ is not very convenient, since GTK is designed for C.
The rest of the choice is not very large from what you found yourself: QT or WxWidgets. Many can and will recommend QT and it's not a bad choice. This library has an essential point - it's its license and its cost. If you are an indie developer, then this may be a potential problem for you in the future . WxWidgtets is a good library and it has a more flexible license, there is Russian documentation (translation) - so I recommend it. As a development environment, I can recommend CodeBlocks. She uses WxWidgets herself, and works on both Windows and Linux. It also has a GUI builder for WxWidgets. The same Codeblocks allows you to configure various compilers, including those for Arduino and similar processors.
It is better not to use Visual C as a compiler, as it can easily deviate from language standards, this is a common Microsoft practice. It is better to write under Linux, because there, according to subjective impressions, compilation is 1.5-2 times faster than on Windows for small applications. With Android, everything is more complicated, because in order to write in C ++ you have to try hard. There are other solutions for Androd, only with them, too, not everything is simple because of licenses, etc.

D
devalone, 2017-02-25
@devalone

Learn Qt, a very handy thing, I advise you to do the first steps without an IDE in order to understand how it works. Out of the box, qt creator comes as an IDE, not to say that it’s just perfect, but quite a convenient tool, it seems you can use VS, but I haven’t tried it.

N
numfin, 2017-03-01
@numfin

Why can't each application be written for its own axis? Well, it's the most similar...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question