Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build error on ubuntu 18.04 - gdal plugin #41

Open
epifanio opened this issue Jan 28, 2019 · 3 comments
Open

build error on ubuntu 18.04 - gdal plugin #41

epifanio opened this issue Jan 28, 2019 · 3 comments

Comments

@epifanio
Copy link

Hi,

trying to build the gdal plugin on ubuntu 18.04 default repository, gdal version 2.2.3 I got this error:

[ 98%] Built target ossim_fftw3_plugin
[ 98%] Building CXX object ossim-plugins/gdal/src/CMakeFiles/ossim_gdal_plugin.dir/ossimGdalPluginInit.cpp.o
/home/epinux/dev/OSSIM/ossim-plugins/gdal/src/ossimGdalPluginInit.cpp: In function ‘void setValidDrivers(const ossimKeywordlist&)’:
/home/epinux/dev/OSSIM/ossim-plugins/gdal/src/ossimGdalPluginInit.cpp:50:8: error: ‘function’ is not a member of ‘std’
   std::function<bool(GDALDriverH, ossimRegExp &)>
        ^~~~~~~~
/home/epinux/dev/OSSIM/ossim-plugins/gdal/src/ossimGdalPluginInit.cpp:50:8: note: suggested alternative: ‘is_function’
   std::function<bool(GDALDriverH, ossimRegExp &)>
        ^~~~~~~~
        is_function
/home/epinux/dev/OSSIM/ossim-plugins/gdal/src/ossimGdalPluginInit.cpp:50:48: error: expression list treated as compound expression in functional cast [-fpermissive]
   std::function<bool(GDALDriverH, ossimRegExp &)>
                                                ^
/home/epinux/dev/OSSIM/ossim-plugins/gdal/src/ossimGdalPluginInit.cpp:50:17: error: expected primary-expression before ‘bool’
   std::function<bool(GDALDriverH, ossimRegExp &)>
                 ^~~~
/home/epinux/dev/OSSIM/ossim-plugins/gdal/src/ossimGdalPluginInit.cpp:57:5: error: ‘isDriverEnabled’ was not declared in this scope
     isDriverEnabled = [](GDALDriverH driver, ossimRegExp &regExpression) -> bool { return regExpression.find(GDALGetDriverShortName(driver)); };
     ^~~~~~~~~~~~~~~
/home/epinux/dev/OSSIM/ossim-plugins/gdal/src/ossimGdalPluginInit.cpp:64:7: error: ‘isDriverEnabled’ was not declared in this scope
       isDriverEnabled = [](GDALDriverH driver, ossimRegExp &regExpression) -> bool { return !regExpression.find(GDALGetDriverShortName(driver)); };
       ^~~~~~~~~~~~~~~
/home/epinux/dev/OSSIM/ossim-plugins/gdal/src/ossimGdalPluginInit.cpp:73:7: error: ‘isDriverEnabled’ was not declared in this scope
       isDriverEnabled = [](GDALDriverH driver, ossimRegExp &regExpression) -> bool { return regExpression.find(GDALGetDriverShortName(driver)); };
       ^~~~~~~~~~~~~~~
/home/epinux/dev/OSSIM/ossim-plugins/gdal/src/ossimGdalPluginInit.cpp:80:9: error: ‘isDriverEnabled’ was not declared in this scope
         isDriverEnabled = [](GDALDriverH driver, ossimRegExp &regExpression) -> bool { return !regExpression.find(GDALGetDriverShortName(driver)); };
         ^~~~~~~~~~~~~~~
/home/epinux/dev/OSSIM/ossim-plugins/gdal/src/ossimGdalPluginInit.cpp:93:12: error: ‘isDriverEnabled’ was not declared in this scope
       if (!isDriverEnabled(driver, driverRegEx))
            ^~~~~~~~~~~~~~~
ossim-plugins/gdal/src/CMakeFiles/ossim_gdal_plugin.dir/build.make:278: recipe for target 'ossim-plugins/gdal/src/CMakeFiles/ossim_gdal_plugin.dir/ossimGdalPluginInit.cpp.o' failed
make[2]: *** [ossim-plugins/gdal/src/CMakeFiles/ossim_gdal_plugin.dir/ossimGdalPluginInit.cpp.o] Error 1
CMakeFiles/Makefile2:6958: recipe for target 'ossim-plugins/gdal/src/CMakeFiles/ossim_gdal_plugin.dir/all' failed
make[1]: *** [ossim-plugins/gdal/src/CMakeFiles/ossim_gdal_plugin.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

@epifanio
Copy link
Author

I tried to add the following to my cmake configuration CMAKE_CXX_FLAGS=-std=c++0x but I wasn't able to fix the error.

@DKlaren
Copy link

DKlaren commented Mar 13, 2019

I ran into this issue on Ubuntu 18.10 as well. It seems that the compiler installed on Ubuntu 18.XX (gcc 8.2.0) has some changes that affect the build while older versions do not. Building on CentOS7 which comes with gcc 4.8.5 this issue was not present, however it re-appeared when I updated gcc on CentOS to the newest version.

To solve the issue in Ubuntu I went into the ossimGdalPluginInit.cpp file and added:

#include <functional>

This allows the plugin to build. However I have yet to test to make sure it functions as intended.

@gpotts
Copy link
Member

gpotts commented Mar 15, 2019

We are in the middle of a merge
will add the include once the merge is complete

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants