<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Fengting,</p>
    <p>would <a class="moz-txt-link-freetext" href="https://github.com/OSGeo/gdal/pull/12830">https://github.com/OSGeo/gdal/pull/12830</a> help ?</p>
    <p>Even<br>
    </p>
    <div class="moz-cite-prefix">Le 30/07/2025 à 21:35, Fengting Chen a
      écrit :<br>
    </div>
    <blockquote type="cite"
cite="mid:IA4PR10MB8636790CB22A5D57F6F863999324A@IA4PR10MB8636.namprd10.prod.outlook.com">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <meta name="Generator"
        content="Microsoft Word 15 (filtered medium)">
      <style>@font-face
        {font-family:PMingLiU;
        panose-1:2 2 5 0 0 0 0 0 0 0;}@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}@font-face
        {font-family:Aptos;
        panose-1:2 11 0 4 2 2 2 2 2 4;}@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}@font-face
        {font-family:"\@PMingLiU";
        panose-1:2 1 6 1 0 1 1 1 1 1;}p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:12.0pt;
        font-family:"Aptos",sans-serif;}a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}code
        {mso-style-priority:99;
        font-family:"Courier New";}pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        font-size:10.0pt;
        font-family:"Courier New";}span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;}span.EmailStyle24
        {mso-style-type:personal-reply;
        font-family:"Aptos",sans-serif;
        color:windowtext;}.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;
        mso-ligatures:none;}div.WordSection1
        {page:WordSection1;}</style>
      <div class="WordSection1">
        <p class="MsoNormal"><span style="font-size:11.0pt">Hi Even, <o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt">I have been
            trying to upgrade my compiler to resolve the GDAL
            compilation issue but without success.
            <o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt">According to
            the documentation of unique_ptr,
            <o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
        <p class="MsoNormal"><code><span style="font-size:10.0pt">unique_ptr</span></code>
          may be constructed for an
          <a
href="https://en.cppreference.com/w/cpp/language/type-id.html#Incomplete_type"
            title="cpp/language/type" moz-do-not-send="true">
            incomplete type</a> <code><span style="font-size:10.0pt">T</span></code>,
          such as to facilitate the use as a handle in the
          <a
            href="https://en.cppreference.com/w/cpp/language/pimpl.html"
            title="cpp/language/pimpl" moz-do-not-send="true">
            pImpl idiom</a>. If the default deleter is used, <code><span
              style="font-size:10.0pt">T</span></code> must be complete
          at the point in code where the deleter is invoked, which
          happens in the destructor, move assignment operator, and
          <code><span style="font-size:10.0pt">reset</span></code>
          member function of <code>
            <span style="font-size:10.0pt">unique_ptr</span></code>.<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">The error I encountered during the
          compilation shows that the deleter of GDALRasterAttributeTable
          was invoked when the type was not complete:
          <o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal"><span
            style="font-size:11.0pt;color:#212121">In file included from
            /usr/include/c++/8/memory:80,</span><span
            style="color:#212121"><o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="font-size:11.0pt;color:#212121">                 
            from /scratch/gdal/gdal/port/cpl_error.h:372,</span><span
            style="color:#212121"><o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="font-size:11.0pt;color:#212121">                 
            from /scratch/gdal/gdal/gcore/gdal.h:30,</span><span
            style="color:#212121"><o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="font-size:11.0pt;color:#212121">                 
            from /scratch/gdal/gdal/gcore/gdal_priv.h:45,</span><span
            style="color:#212121"><o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="font-size:11.0pt;color:#212121">                 
            from /scratch/gdal/gdal/frmts/pdf/pdfdrivercore.h:16,</span><span
            style="color:#212121"><o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="font-size:11.0pt;color:#212121">                 
            from /scratch/gdal/gdal/frmts/pdf/pdfdrivercore.cpp:13:</span><span
            style="color:#212121"><o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="font-size:11.0pt;color:#212121">/usr/include/c++/8/bits/unique_ptr.h:
            In instantiation of ?~@~Xvoid std::      
            default_delete<_Tp>::operator()(_Tp*) const [with _Tp
            =                         GDALRasterAttributeTable]?~@~Y:</span><span
            style="color:#212121"><o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="font-size:11.0pt;color:#212121">/usr/include/c++/8/bits/unique_ptr.h:277:17:  
            required from ?~@~Xstd::         unique_ptr<_Tp,
            _Dp>::~unique_ptr() [with _Tp = GDALRasterAttributeTable;
            _Dp   =
            std::default_delete<GDALRasterAttributeTable>]?~@~Y</span><span
            style="color:#212121"><o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="font-size:11.0pt;color:#212121">/scratch/gdal/gdal/gcore/gdal_priv.h:3664:55:  
            required from here</span><span style="color:#212121"><o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="font-size:11.0pt;color:#212121">/usr/include/c++/8/bits/unique_ptr.h:79:16:
            error: invalid application of       ?~@~Xsizeof?~@~Y to
            incomplete type ?~@~XGDALRasterAttributeTable?~@~Y</span><span
            style="color:#212121"><o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="font-size:11.0pt;color:#212121">  
            static_assert(sizeof(_Tp)>0,</span><span
            style="color:#212121"><o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="font-size:11.0pt;color:#212121">                
            ^~~~~~~~~~~</span><span style="color:#212121"><o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="font-size:11.0pt;color:#212121">gmake[2]: ***
            [frmts/pdf/CMakeFiles/gdal_PDF_core.dir/build.make:76:
            frmts/pdf/ CMakeFiles/gdal_PDF_core.dir/pdfdrivercore.cpp.o]
            Error 1</span><span style="color:#212121"><o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt">Is there any
            other way to work around it?
            <o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt">Thanks,<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt">-Fengting<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
        <div id="mail-editor-reference-message-container">
          <div>
            <div>
              <div
style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
                <p class="MsoNormal" style="margin-bottom:12.0pt"><b><span
                      style="color:black">From:
                    </span></b><span style="color:black">Even Rouault
                    <a class="moz-txt-link-rfc2396E" href="mailto:even.rouault@spatialys.com"><even.rouault@spatialys.com></a><br>
                    <b>Date: </b>Wednesday, July 23, 2025 at 4:59</span><span
style="font-family:"Arial",sans-serif;color:black"> </span><span
                    style="color:black">PM<br>
                    <b>To: </b>Fengting Chen
                    <a class="moz-txt-link-rfc2396E" href="mailto:fengting.chen@oracle.com"><fengting.chen@oracle.com></a>, gdal dev
                    <a class="moz-txt-link-rfc2396E" href="mailto:gdal-dev@lists.osgeo.org"><gdal-dev@lists.osgeo.org></a><br>
                    <b>Subject: </b>Re: [External] : Re: [gdal-dev]
                    Error on building from master branch on linux<o:p></o:p></span></p>
              </div>
              <p><o:p> </o:p></p>
              <div>
                <p class="MsoNormal">Le 23/07/2025 à 22:51, Fengting
                  Chen a écrit :<o:p></o:p></p>
              </div>
              <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
                <div>
                  <p class="MsoNormal"><span style="font-size:11.0pt">Hi
                      Even, </span><o:p></o:p></p>
                  <p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
                  <p class="MsoNormal"><span style="font-size:11.0pt">After
                      resolving error on “GDALRasterAttributeTable” by
                      adding “gdal_rat.h” to gdal_priv.h, the
                      compilation failed again. 
                    </span><o:p></o:p></p>
                  <p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
                  <p class="MsoNormal"><span style="font-size:11.0pt">The
                      compiler on my machine was working fine with GDAL
                      on the master branch this early May.  Could there
                      be anything changed in the GDAL master that caused
                      the compilation failure?
                    </span><o:p></o:p></p>
                </div>
              </blockquote>
              <p>yes, the addition of
                std::unique_ptr<GDALRasterAttributeTable>
                m_poRAT{}; at line 3664 of gdal_priv.h<o:p></o:p></p>
              <p>You should try to update to a more recent compiler.<o:p></o:p></p>
              <p>Even<o:p></o:p></p>
              <p class="MsoNormal"><br>
                <br>
                <o:p></o:p></p>
              <pre>-- <o:p></o:p></pre>
              <pre><a
href="https://urldefense.com/v3/__http:/www.spatialys.com__;!!ACWV5N9M2RV99hQ!IV0UbTzTiheCT_RtAke5Lf5jehgWvysNhzGSf-s6QzosmATNDjTe2xTp17hAk7QEaHW-P68knUEP-DxLDC1FZG4RX5oU$"
              moz-do-not-send="true">http://www.spatialys.com</a><o:p></o:p></pre>
              <pre>My software is free, but my time generally not.<o:p></o:p></pre>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
<a class="moz-txt-link-freetext" href="http://www.spatialys.com">http://www.spatialys.com</a>
My software is free, but my time generally not.</pre>
  </body>
</html>