Bug report #1854
qgisinterpolator.cpp causing build error on OS X
|Affected QGIS version:||Regression?:||No|
|Operating System:||OS X||Easy fix?:||No|
|Pull Request or Patch supplied:||Resolution:||fixed|
|Crashes QGIS or corrupts data:||Copied to github as #:||11914|
From the most current svn, I cannot build successfully on OS X. The error message is:
[ 68%] Building CXX object src/plugins/interpolation/CMakeFiles/interpolationplugin.dir/qgstininterpolator.o
/Users/jctull/sources/qgis/trunk/src/plugins/interpolation/qgstininterpolator.cpp: In member function ‘int QgsTINInterpolator::insertData(QgsFeature*, bool, int, QgsInterpolator::InputType)’:
/Users/jctull/sources/qgis/trunk/src/plugins/interpolation/qgstininterpolator.cpp:159: error: ‘isnan’ was not declared in this scope
maker2: * [src/plugins/interpolation/CMakeFiles/interpolationplugin.dir/qgstininterpolator.o] Error 1
maker1: [src/plugins/interpolation/CMakeFiles/interpolationplugin.dir/all] Error 2
make: ** [all] Error 2
#4 Updated by William Kyngesburye about 11 years ago
OK, I see that isnan has been in qgsinterpolator.cpp since February (fixed for OSX in March), and I haven't had a problem with it. Now isnan was added to qgstininterpolator.cpp, and now both of them complain about isnan...
John - I believe you are using Qt 4.5, right? I just updated to Qt 4.5 this weekend (right before 5d9b66fa (SVN r11212), which added isnan to the tin source). And it's interesting that at first I only got 1 isnan error, but after 7bc1a64e (SVN r11239) I got errors in both.
Gary - which Qt version are you using?
That's the only major change in my setup that I can think of.
#7 Updated by John Tull about 11 years ago
I recall communicating with the dev of this plugin a while back. When it did not get fixed, I removed it from the plugins cmakefile, so I was not trying to build it for some time. I am guessing that the cmakefile changed when the osm plugin was added to the repo over the past week or so. It has been a problem since it was introduced into the codebase, which was after switching to qt-4.5.x, for me. Everything but this compiled fine using your xcode project yesterday. About a week or two ago, prior to that, for my last build.
#8 Updated by William Kyngesburye about 11 years ago
[jef] wrote on the dev list:
http://trac.osgeo.org/geos/ticket/270 might also relate to that.
in src/core/qgis.h help?
...now I'm back to the original error John had, just in tininterpolator. So interpolator is doing something right so that isnan works. Or tininterpolator is including another header that includes <cmath> (the trail was too tangled for me to follow).
As a test, I changed isnan() in tininterpolator to std::isnan() and it compiled. Doing the same for interpolator breaks with:
So there seems to be some sort of namespace issue in tininterpolator, or <cmath> is included somewhere.
#9 Updated by Marco Hugentobler about 11 years ago
#12 Updated by Marco Hugentobler about 11 years ago
- Resolution set to fixed
- Status changed from Open to Closed
I think the '#include <cmath>' in qgis.h is not used anywhere. So I removed it and added the ifdefs in 3ddd1795 (SVN r11275). Please reopen this bug if there are still compile problems with the modifications.