So far all my development in C++ has been targeted to Windows, however I have always had it in the back of my mind that I will someday be targeting Linux. I am aware therefore of the need to select cross-platform libraries, and to keep my code as portable as possible (or provide alternative implementations for code which isn't portable). This question therefore does not relate to issues of code compilation.
I would like to know, what are some common issues that a developer will face when targeting both Linux and Windows? In particular, but not limited to:
Best practices for handling configuration files. On Windows it seems this is fairly arbitrary - I've seen software store their configuration inside the program folder, in the user's folder (under appData), and in the registry. On Linux it seems much more heavily weighted towards dedicated configuration folders (/etc). How should I handle these differences in my code? Do I hard code the locations, or is there some system-defined function I can consult?
Same as (1) but for logging.
How do I go about keeping my project files in sync? E.g. if I update something in a Visual Studio project file, do I generally need to manually update the equivalent thing in whatever Linux environment I'm working in, or is there a commonly used method of avoiding this?
What is the best way to handle platform implementation differences in my code? Should I use #ifdefs, or should I keep the platform-specific code in separate files and have the project specify which files are included?
Anything else I haven't thought of which I should start considering / researching?
/etcis standard place for configuration only for system-wide services or network services. User applications should keep their stuff in.(name-of-app)/or.config/name-of-app/in user home directory. – Hubert Kario Jan 14 at 20:43