<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Hi,</p>
    <p>I have hit the same issue (with GDAL 2.2.1), but in a different
      way:</p>
    <blockquote>
      <p><tt>running build_ext<br>
          building 'osgeo._gdal' extension<br>
          creating build/temp.linux-x86_64-2.7<br>
          creating build/temp.linux-x86_64-2.7/extensions<br>
          /bin/bash
          /home/otbval/Dashboard/build/OTB-SuperBuild-stable/GDAL/src/GDAL/libtool
          --mode=compile --tag=CC /usr/bin/gcc-4.9 -fno-strict-aliasing
          -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC
          -I../../port -I../../gcore -I../../alg -I../../ogr/
          -I../../ogr/ogrsf_frmts -I../../gnm -I../../apps
          -I/usr/include/python2.7
          -I/usr/lib/python2.7/dist-packages/numpy/core/include
-I/home/otbval/Dashboard/build/OTB-SuperBuild-stable/GDAL/src/GDAL/include
          -c extensions/gdal_wrap.cpp -o
          build/temp.linux-x86_64-2.7/extensions/gdal_wrap.o<br>
          libtool: compile:  /usr/bin/gcc-4.9 -fno-strict-aliasing
          -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC
          -I../../port -I../../gcore -I../../alg -I../../ogr/
          -I../../ogr/ogrsf_frmts -I../../gnm -I../../apps
          -I/usr/include/python2.7
          -I/usr/lib/python2.7/dist-packages/numpy/core/include
-I/home/otbval/Dashboard/build/OTB-SuperBuild-stable/GDAL/src/GDAL/include
          -c extensions/gdal_wrap.cpp  -fPIC -DPIC -o
          build/temp.linux-x86_64-2.7/extensions/.libs/gdal_wrap.o<br>
          cc1plus: warning: command line option '-Wstrict-prototypes' is
          valid for C/ObjC but not for C++<br>
          In file included from /usr/include/python2.7/Python.h:133:0,<br>
                           from extensions/gdal_wrap.cpp:173:<br>
          extensions/gdal_wrap.cpp: In function 'PyObject*
          _wrap_MajorObject_SetMetadata__SWIG_0(PyObject*, PyObject*)':<br>
          /usr/include/python2.7/abstract.h:1354:62: warning: deprecated
          conversion from string constant to 'char*' [-Wwrite-strings]<br>
           #define PyMapping_Items(O)
          PyObject_CallMethod(O,"items",NULL)<br>
                                                                       
          ^<br>
          extensions/gdal_wrap.cpp:9743:31: note: in expansion of macro
          'PyMapping_Items'<br>
                   PyObject *item_list = PyMapping_Items( obj1 );<br>
                                         ^<br>
          c++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions
          -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing
          -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes
          -D_FORTIFY_SOURCE=2 -g -fstack-protector
          --param=ssp-buffer-size=4 -Wformat -Werror=format-security
          build/temp.linux-x86_64-2.7/extensions/gdal_wrap.o
          -L../../.libs -L../../
          -L/home/otbval/Dashboard/build/OTB-SuperBuild-stable/GDAL/src/GDAL/lib
          -lgdal -o build/lib.linux-x86_64-2.7/osgeo/_gdal.so<br>
          <b>c++: error:
            build/temp.linux-x86_64-2.7/extensions/gdal_wrap.o: Aucun
            fichier ou dossier de ce type</b><br>
          error: command 'c++' failed with exit status 1<br>
          make: *** [build] Erreur 1</tt><br>
      </p>
    </blockquote>
    If I understand right:<br>
    <ul>
      <li>the compilation step of the extension is done using CC (that
        is not filtered from the environment by setup.py)</li>
      <li>somehow distutils is not crashing and takes the full
        multi-word compiler command<br>
      </li>
      <li>the linking step is done using c++ (because CXX is filtered by
        setup.py)</li>
      <li>since libtool produces ".lo" files, and c++ expects a ".o"
        file -> error<br>
      </li>
    </ul>
    I have tried to filter CC using the same logic and it solves the
    error.<br>
    <br>
    <div class="moz-cite-prefix">On 11/02/2016 12:50 PM, Even Rouault
      wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:201611021250.24888.even.rouault@spatialys.com">
      <pre wrap="">I don't think so. We could also apply the same logic for CC as the one I added 
for CXX if it proved to be needed.</pre>
    </blockquote>
    Yes!<br>
    <br>
    Regards,<br>
    Guillaume<br>
    <br>
    <div class="moz-signature">-- <br>
      <table cellspacing="0" cellpadding="0" border="0">
        <tbody>
          <tr>
            <td> <a href="www.c-s.fr" hreflang="fr"><img
                  src="cid:part1.0CF37AAA.D0F44B73@c-s.fr" alt=""
                  align="left" border="0"></a> </td>
            <td> <font face="verdana" size="1"> <b>Guillaume PASERO</b><br>
                Responsable technique<br>
                <b>Business Unit ESPACE & GeoInformation -
                  Département Payload Data & Applications</b><br>
                <br>
                <b>CS Systèmes d'Information</b><br>
                Parc de la Grande Plaine - 5, Rue Brindejonc des
                Moulinais - BP 15872<br>
                31506 Toulouse Cedex 05 - FRANCE<br>
                +33 561 17 64 21 - <a class="moz-txt-link-freetext"
                  href="mailto:guillaume.pasero@c-s.fr">guillaume.pasero@c-s.fr</a>
              </font></td>
          </tr>
        </tbody>
      </table>
    </div>
  </body>
</html>