Error compiling Spatialite-GUI 2.0.0 with GCC 7.2.0

31 views
Skip to first unread message

Samuel Mesa

unread,
Oct 15, 2017, 11:56:50 AM10/15/17
to SpatiaLite Users
Greetings, I am the maintainer of the Spatialite-GUI package on Arch Linux. With the new version of GCC 7.2.0 an error is generated in the compilation and I haven't found a way to fix it.

I appreciate any help.

make[2]: Entering directory '/home/samtux/makepkg/spatialite-gui-devel/src/spatialite_gui-2.0.0-devel'
g
++ -DHAVE_CONFIG_H -I.  -g -O2 -I.   -I/usr/lib/wx/include/gtk2-unicode-3.0 -I/usr/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread -MT ResultSetView.o -MD -MP -MF .deps/ResultSetView.Tpo -c -o ResultSetView.o ResultSetView.cpp
g
++ -DHAVE_CONFIG_H -I.  -g -O2 -I.   -I/usr/lib/wx/include/gtk2-unicode-3.0 -I/usr/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread -MT Shapefiles.o -MD -MP -MF .deps/Shapefiles.Tpo -c -o Shapefiles.o Shapefiles.cpp
ResultSetView.cpp: In member function 'const char* MyResultSetView::CleanSqlTail(const char*)':
ResultSetView.cpp:497:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   
while (p != '\0')
               
^~~~
make
[2]: *** [Makefile:565: ResultSetView.o] Error 1
make
[2]: *** Waiting for unfinished jobs....
mv
-f .deps/Shapefiles.Tpo .deps/Shapefiles.Po
make
[2]: Leaving directory '/home/samtux/makepkg/spatialite-gui-devel/src/spatialite_gui-2.0.0-devel'
make
[1]: *** [Makefile:601: all-recursive] Error 1
make
[1]: Leaving directory '/home/samtux/makepkg/spatialite-gui-devel/src/spatialite_gui-2.0.0-devel'
make
: *** [Makefile:431: all] Error 2


a.fu...@lqt.it

unread,
Oct 15, 2017, 12:54:51 PM10/15/17
to spatiali...@googlegroups.com
On Sun, 15 Oct 2017 08:56:50 -0700 (PDT), Samuel Mesa wrote:
> Greetings, I am the maintainer of the Spatialite-GUI package on Arch
> Linux. With the new version of GCC 7.2.0 an error is generated in the
> compilation and I haven't found a way to fix it.
>

Hi Samuel,

it was fixed on 2017-02-05, please see:
https://www.gaia-gis.it/fossil/spatialite_gui/fdiff?v1=78060ac75797c6bb&v2=d7a4a13c171c06f5&sbs=1

the previous implementation was obviously wrong,
and rather surprisingly old versions of GCC didn't
reported any error or warning message.

to fix this issue you simply have to correctly
dereference the pointer by appending an asterisk
immediately before the pointer name, as in:

while (*p != '\0')

bye Sandro

Samuel Mesa

unread,
Oct 16, 2017, 2:00:53 PM10/16/17
to SpatiaLite Users
Thank you very much Sandro for your help, I have updated the compilation instructions with the patch for Arch Linux. 


regards, 

Samuel Mesa
Reply all
Reply to author
Forward
0 new messages