isciences / exactextract

Fast and accurate raster zonal statistics
Apache License 2.0
246 stars 32 forks source link

Installation error: implicit instantiation of undefined template #49

Closed ShengpeiWang closed 9 months ago

ShengpeiWang commented 9 months ago

Issue summary

When running the installation instructions, I encountered the error error: implicit instantiation of undefined template 'std::basic_stringstream<char>' std::stringstream s;.

Proposed solution:

This was resolved by adding #include <sstream> to src/operation.h. I'd be happy to open a PR to add this, but I'm not sure what's the preferred contribution guideline.

Additional context:

Full trace in the terminal:

(base) ➜  cmake-build-release git:(master) make
[  2%] Building CXX object CMakeFiles/exactextract_gdal.dir/src/deferred_gdal_writer.cpp.o
In file included from ~/Documents/GitHub/exactextract/src/deferred_gdal_writer.cpp:15:
~/Documents/GitHub/exactextract/src/operation.h:131:39: error: implicit instantiation of undefined template 'std::basic_stringstream<char>'
                    std::stringstream s;
                                      ^
/Library/Developer/CommandLineTools/SDKs/MacOSX13.3.sdk/usr/include/c++/v1/iosfwd:146:32: note: template is declared here
    class _LIBCPP_TEMPLATE_VIS basic_stringstream;
                               ^
In file included from ~/Documents/GitHub/exactextract/src/deferred_gdal_writer.cpp:15:
~/Documents/GitHub/exactextract/src/operation.h:138:39: error: implicit instantiation of undefined template 'std::basic_stringstream<char>'
                    std::stringstream s;
                                      ^
/Library/Developer/CommandLineTools/SDKs/MacOSX13.3.sdk/usr/include/c++/v1/iosfwd:146:32: note: template is declared here
    class _LIBCPP_TEMPLATE_VIS basic_stringstream;
                               ^
2 errors generated.
make[2]: *** [CMakeFiles/exactextract_gdal.dir/src/deferred_gdal_writer.cpp.o] Error 1
make[1]: *** [CMakeFiles/exactextract_gdal.dir/all] Error 2
make: *** [all] Error 2

System configurations:

CMake suite maintained and supported by Kitware (kitware.com/cmake). (base) ➜ gdalinfo --version GDAL 3.7.3, released 2023/10/30 (base) ➜ geos-config --version 3.12.0

dbaston commented 9 months ago

Let's do a PR so you can be credited with the fix. Thanks!