[smartmontools-support] Compiling smartctl on Windows

Eaton Zveare eatonzveare at gmail.com
Wed Apr 27 18:24:05 CEST 2022


Hi Christian, the line endings/format are correct in the files I have. I
did not need to make changes.
I made the int128 change and it actually made no difference. Digging
deeper, I found that I also had to remove these defines:

   - HAVE_UNISTD_H
   - HAVE_ATTR_PACKED

Only then did VS 2022 finally compile. You didn't have to remove those
defines to get it to work?

On Wed, Apr 27, 2022 at 11:22 AM Christian Franke <
Christian.Franke at t-online.de> wrote:

> Hi Eaton,
>
> Christian Franke wrote:
> > 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.
> >
> >
>
> Meantime I found two issues which also affect VS 2015/17/19.
>
> 1. Due to changes in recent Windows versions of GNU sed, the
> svnversion.h and config.h files are not properly generated if the
> checkout was done with CR/LF instead of LF line endings.
>
> 2. The 64-bit Version of Mingw-w64 supports '__int128', but VS 2022
> still does not, so HAVE___INT128 should be removed from config.h
>
>
> It would take some time to commit the fixes. Meantime, you could use
> this quick workaround:
>
> In the directory where '../configure' was run, for example "vctmp" as in
> INSTALL file, do:
>
> - Edit svnversion.h and remove the bogus carriage return (^M) in the
> second line if present:
>
> #define SMARTMONTOOLS_SVN_REV  "5363[^M]"
>
> - Convert config.h to unix (LF) format if necessary, for example with:
>
> dos2unix config.h
>
> - Remove the line '#define HAVE___INT128 1' from config.h, for example
> with:
>
> sed -i.bak '/HAVE___INT128/d' config.h
>
> - recreate the VC16 specific configuration files:
>
> make config-vc
>
> - Open ../os_win32/vc16/smartmontools.sln in VS 2022 and proceed as usual.
>
> Regards,
> Christian
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://listi.jpberlin.de/pipermail/smartmontools-support/attachments/20220427/644108dd/attachment.htm>


More information about the Smartmontools-support mailing list