On 9.02.2019 17:08, Jivanmukta wrote:
> Is it good idea to have one project and to use preprocessor for
> Linux/Windows differences?
No, peppering the code with #ifdef __linux__ is not a good way to go if
that's what you have in mind. Instead declare needed classes or
functions in a single header file whose implementation is provided in
separate implementation files for different platforms.
> Which version of C++ I should use?
C++11. Additions in later revisions are more cosmetic and not yet
universally supported, so may cause portability issues.
> Which C++ compilers?
You can use different compilers on each platform, e.g. gcc or clang in
Linux, MSVC on Windows. For debugging nothing beats MS Visual studio,
especially for beginners.
> Windows version of my program should use GUI and compile to
> 32/64 bit binary, not .NET. Linux version should be command line tool.
This is 3 projects, not one: one common base library providing the
actual functionality, one command-line executable and one GUI
executable. With such separation it might even be you do not need to
care about platform differences in the code at all, you just do not
build some project on some platform.
General portability notes: use UTF-8 for all strings internally, convert
to UTF-16 at the application border in Windows, i.e. use only wide
versions of the Windows API functions, e.g. MessageBoxW().