Saturday, November 8, 2025

Issues with Linux port

 

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. This makes the update fail. Either make the source files not read only beforehand or clean all files and directories on the WSL host and then start fresh again. 
  • 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 Microsoft specific (e.g. _splitpath; _makepath; _tchdir)
  • Warning suppression's in pre-compiled header in GCC are ignored in code. This not pretty; especially since some suppression's one want to apply 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.

No comments:

Post a Comment

Issues with Linux port

  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 bu...