Linux port
The company I work for decided to port part of our application to Linux. At a first shot we will use WSL and Visual Studio but issues are not over:
- CMake is the lingua franca of generating cross platform build scripts. CMake is a beast of itself however
- WSL keeps sometimes its old configuration and source files. It seems that when the source files are read only they are read only on the target WSL system as well. If you edit a file afterwards the update of this file will fail so one won't see their changes. Either make the source files not read only beforehand or clean all files and directories on the WSL host and then start fresh again. Alternatively add the write right to the files on Linux through chmod.
- MSVC uses __declspec(dllexport) to export functions from DLL's; gcc doesn't have that.
- MSVC is pushing security enhanced versions of the CRT through its code analyzer. According to cppreference these functions are standardized albeit as extension (i.e. Annex K of C11). Unfortunately glibc has not implemented them; partially because some dubious reasoning. The API isn't perfect and there are pre-exisiting bounds checking crt but still it's standardized and some people (we) use them. So one ends up writing Windows and Linux specific code even in a layer which supposed to be platform independent.
- Many of the MSVC C API is Windows specific (e.g. _splitpath; _makepath; _tchdir). Using C alone on Windows platform may therefore still not platform independent.
- Warning suppression's in pre-compiled header in GCC are ignored in code. This is quite unhandy; especially since some suppression's one want to apply globally to all sources and are therefore are primary candidate to put in pre-compiled header.
It seems that gcc might still contain some basic bugs. The warning about #pragma once in main file (when building a pre-compiled header) is only solved in version 14.