<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-ligatures:standardcontextual;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-ligatures:standardcontextual;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">Hi,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I’m hitting a weird building error on Win11. <o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">The error is<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">[1322/1350] Linking CXX shared library gdal_w64.dll<o:p></o:p></p>
<p class="MsoNormal">FAILED: gdal_w64.dll gdal_w64.lib<o:p></o:p></p>
<p class="MsoNormal">cmd.exe /C "cd . && C:\programs\CMake\bin\cmake.exe -E vs_link_dll --intdir=CMakeFiles\GDAL.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x64\mt.exe --manifests  -- C:\PROGRA~1\MICROS~4\2022\COMMUN~1\VC\Tools\MSVC\1435~1.322\bin\Hostx64\x64\link.exe
 /nologo @CMakeFiles\GDAL.rsp  /out:gdal_w64.dll /implib:gdal_w64.lib /pdb:gdal_w64.pdb /dll /version:37.0 /machine:x64 /INCREMENTAL:NO  && cd ."<o:p></o:p></p>
<p class="MsoNormal">LINK: command "C:\PROGRA~1\MICROS~4\2022\COMMUN~1\VC\Tools\MSVC\1435~1.322\bin\Hostx64\x64\link.exe /nologo @CMakeFiles\GDAL.rsp /out:gdal_w64.dll /implib:gdal_w64.lib /pdb:gdal_w64.pdb /dll /version:37.0 /machine:x64 /INCREMENTAL:NO /MANIFEST
 /MANIFESTFILE:gdal_w64.dll.manifest" failed (exit code 1181) with the following output:<o:p></o:p></p>
<p class="MsoNormal">LINK : fatal error LNK1181: cannot open input file 'm.lib'<o:p></o:p></p>
<p class="MsoNormal">ninja: build stopped: subcommand failed.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">And indeed, there is one file "C:\programs\compa_libs\gdal_GIT\build\CMakeFiles\GDAL.rsp" that has this line<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">       C:\programs\PostgreSQL\15\lib\libpq.lib  C:\programs\compa_libs\hdf5-1.12.2\compileds\VC14_64\lib\hdf5_cpp.lib  psapi.lib  m.lib<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Now, the weirdest part is that this happens in a new computer with Win11 but the GDAL repo dir was copied from another computer (that has Win10) and there this error does not show up. Both are built with same version of VS.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">If I cheat it and add a valid lib called as m.lib then all runs apparently fine.<o:p></o:p></p>
</div>
</body>
</html>