[gdal-dev] [External] : Re: Build failed with "cannot deduce template arguments" error

Even Rouault even.rouault at spatialys.com
Wed Apr 30 03:16:57 PDT 2025


GCC 8 release notes indicate that C++17 support is still be a bit 
experimental for the standard library. Anyway, can you try 
https://github.com/OSGeo/gdal/pull/12231 ? I don't have access to your 
compiler so I couldn't check with it, but I'd assume it should make 
template deduction easier for the compiler.

Le 30/04/2025 à 05:10, Fengting Chen a écrit :
>
> I am using “c++ (GCC) 8.5.0 20210514 (Red Hat 8.5.0-18.0.6)” which is 
> supposed to support C++17.
>
> *From: *Even Rouault <even.rouault at spatialys.com>
> *Date: *Tuesday, April 29, 2025 at 6:10 PM
> *To: *Fengting Chen <fengting.chen at oracle.com>, 
> gdal-dev at lists.osgeo.org <gdal-dev at lists.osgeo.org>
> *Subject: *[External] : Re: [gdal-dev] Build failed with "cannot 
> deduce template arguments" error
>
> Which compiler and compiler version do you use ? It is likely it is 
> too old and doesn't fully support C++17
>
> Le 29/04/2025 à 23:18, Fengting Chen via gdal-dev a écrit :
>
>     Hi, I am trying to build GDAL from the master branch, but got the
>     following error:
>
>     [ 46%] Building CXX object
>     alg/CMakeFiles/alg.dir/gdal_interpolateatpoint.cpp.o
>
>     In file included from
>     /scratch/gdal/gdal/alg/gdal_interpolateatpoint.cpp:20:
>
>     /scratch/gdal/gdal/gcore/gdal_vectorx.h: In member function
>     ?~@~Xgdal:: VectorX<T, N>::self_type gdal::VectorX<T,
>     N>::operator+(T) const?~@~Y:
>
>     /scratch/gdal/gdal/gcore/gdal_vectorx.h:173:44: error: cannot
>     deduce template   arguments for ?~@~Xplus?~@~Y from ()
>
>     return operatorImpl(arg, std::plus());
>
>     ^
>
>     My configuration is:
>
>     -- Target system:             Linux
>
>     -- Installation directory:    /usr/local
>
>     -- C++ Compiler type:         GNU
>
>     -- C compile command line:     /bin/cc
>
>     -- C++ compile command line:   /bin/c++
>
>     -- 
>
>     -- CMAKE_C_FLAGS:               -fvisibility=hidden
>
>     -- CMAKE_CXX_FLAGS:               -fvisibility=hidden
>
>     -- CMAKE_CXX17_STANDARD_COMPILE_OPTION: -std=c++17
>
>     -- CMAKE_CXX17_EXTENSION_COMPILE_OPTION: -std=gnu++17
>
>     -- CMAKE_EXE_LINKER_FLAGS:
>
>     -- CMAKE_MODULE_LINKER_FLAGS: -Wl,--no-undefined
>
>     -- CMAKE_SHARED_LINKER_FLAGS: -Wl,--no-undefined
>
>     -- CMAKE_STATIC_LINKER_FLAGS:
>
>     Any idea on how to fix the error?
>
>     Thanks!
>
>
>
>     _______________________________________________
>
>     gdal-dev mailing list
>
>     gdal-dev at lists.osgeo.org
>
>     https://lists.osgeo.org/mailman/listinfo/gdal-dev  <https://urldefense.com/v3/__https:/lists.osgeo.org/mailman/listinfo/gdal-dev__;!!ACWV5N9M2RV99hQ!OOJ0fjd1DRqARN5Zwu2h2bUnGxx24Gm7BRrjicc_T6TOWw47z1fKS1DmrwT_3UWuTnrn2lyb2-GqSG_ErtSHw1UapGVT$>
>
> -- 
> http://www.spatialys.com  <https://urldefense.com/v3/__http:/www.spatialys.com__;!!ACWV5N9M2RV99hQ!OOJ0fjd1DRqARN5Zwu2h2bUnGxx24Gm7BRrjicc_T6TOWw47z1fKS1DmrwT_3UWuTnrn2lyb2-GqSG_ErtSHw2hmL07K$>
> My software is free, but my time generally not.

-- 
http://www.spatialys.com
My software is free, but my time generally not.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20250430/b7024fa0/attachment-0001.htm>


More information about the gdal-dev mailing list