[smartmontools-support] Compiling smartctl on Windows

Christian Franke Christian.Franke at t-online.de
Fri Apr 22 19:14:43 CEST 2022


Hi Eaton,

Eaton Zveare wrote:
> ...
> >> /If you plan to use Linux-like tools more often, I would recommend 
> to use Cygwin./
>
> I think that adds a dependency on a cygwin dll though? If so, that is 
> not appealing.

Yes and no.
"./configure" without arguments results in Cygwin binaries which 
requires some cyg*.dll.
"./configure --build=$(./config.guess) --host=x86_64-w64-mingw32" 
results in non-Cygwin binaries.


> >> /The make commands for VC16 (VS2019) are now:/
> >> /make config-vc/
> >> ...
>
> That command works, but Visual Studio still won't compile: 
> https://i.imgur.com/nmIAy9h.png
> I should note I am using Visual Studio 2022. Is there a firm 
> dependency on 2019, or is there something I can change in the project 
> settings to make it work in 2022?

I don't know and will try with VS 2022 soon and commit the related 
project files.


>
> >> /Note that VC is never used for release and CI 
> (https://builds.smartmontools.org/) binaries for Windows. These are 
> always cross-compiled using a Docker image with Linux and Mingw-w64./
> /
> /
> Is there any difference between VC, MSYS2/MINGW64 on Windows, and 
> cross-compiled builds on Linux or is it just a matter of environment 
> preference?

Any binaries produced by (the same version of) the Mingw-w64 toolchain 
should be similar, regardless of build platform. One reason we do 
cross-compiling is that it eases discussions if another malware scanner 
reports another false positive. Another is that VS is closed source and 
even the community edition requires registration. Disadvantages of 
Mingw-w64 are the lack of support of Control Flow Guard and the 
inability to statically link without the need of msvcrt.dll during runtime.

Regards,
Christian



More information about the Smartmontools-support mailing list