compilation of spatialite-gui confusion

78 views
Skip to first unread message

andrea antonello

unread,
Mar 3, 2016, 7:17:17 AM3/3/16
to spatiali...@googlegroups.com
Hi again, 
I am trying to compile the whole spatialite chain to its gui on xubuntu 14.04 and having some issues.

For some reason I don't seem to have aligned sources. The spatialite-gui compilation has issues with some rasterlite2 functions, which seem to have changed. I am using both the latest sources available on the gaia-sins page.

The error starts with:

BlobExplorer.cpp: In member function ‘bool BlobExplorerDialog::Create(MyFrame*, int, unsigned char*)’:
BlobExplorer.cpp:150:59: error: too many arguments to function ‘rl2Raster* rl2_raster_from_png(const unsigned char*, int)’
             raster = rl2_raster_from_png(Blob, BlobSize, 1);
                                                           ^
In file included from Classdef.h:53:0,
                 from BlobExplorer.cpp:26:
/usr/local/include/rasterlite2/rasterlite2.h:2781:30: note: declared here
     RL2_DECLARE rl2RasterPtr rl2_raster_from_png (const unsigned char *png,
                              ^
BlobExplorer.cpp:183:63: error: ‘rl2_is_valid_encoded_font’ was not declared in this scope
             int ret = rl2_is_valid_encoded_font(Blob, BlobSize);
                                                               ^
BlobExplorer.cpp:187:71: error: ‘rl2_get_encoded_font_family’ was not declared in this scope
                 char *str = rl2_get_encoded_font_family(Blob, BlobSize);
...


Any idea why I am getting this?

Thanks,
Andrea



andrea antonello

unread,
Mar 3, 2016, 7:23:21 AM3/3/16
to spatiali...@googlegroups.com
I just noticed on the spatialite-gui main page that the required rasterlite is the devel and not the rc0:


Heading to test that.
Andrea



andrea antonello

unread,
Mar 5, 2016, 4:18:24 AM3/5/16
to spatiali...@googlegroups.com
Ok, just a follow-up for those like me that had a complete mess :-)

The main problem has been the co-existence of the ubuntu spatialite installation on my system.
This made everything messy. Once I uninstalled all obsolete ubuntu packages and started again from scratch, everything behaved as expected.

Well, actually one small glitch, which I am still not sure about.

Compilations complained about the missing function: sqlite3_column_table_name
in the sqlite installation. At first I thought it was a missing reference to the library path, but then I found out the sqlite3 was not compiled by default with that (and a few other functions).
Adding:
#define SQLITE_ENABLE_COLUMN_METADATA 1
did the trick.

Any idea?

Ciao,
Andrea







a.fu...@lqt.it

unread,
Mar 5, 2016, 4:59:43 AM3/5/16
to spatiali...@googlegroups.com
On Sat, 5 Mar 2016 10:18:02 +0100, andrea antonello wrote:
> Well, actually one small glitch, which I am still not sure about.
>
> Compilations complained about the missing function:
> sqlite3_column_table_name
> in the sqlite installation. At first I thought it was a missing
> reference to the library path, but then I found out the sqlite3 was
> not compiled by default with that (and a few other functions).
>
> Adding:
> #define SQLITE_ENABLE_COLUMN_METADATA 1
> did the trick.
>
> Any idea?
>

Ciao Andrea,

SQLite effectively has an optional sqlite3_column_table_name()
C API, but it's usually disabled in any standard build; as you've
already discovered by yourself enabling this API (and few
others strictly related) always requires to explicitly
declare SQLITE_ENABLE_COLUMN_METADATA
and there are more conditional macros selectively enabling
more sqlite APIs.

just as an example, the usual recipe I personally adopt when
building sqlite3 on Windows using MinGW/MSys is:

cd sqlite-<version>
export "CFLAGS=-DSQLITE_ENABLE_STAT3=1 -DSQLITE_ENABLE_TREE_EXPLAIN=1 \
-DSQLITE_ENABLE_UPDATE_DELETE_LIMIT=1
-DSQLITE_ENABLE_FTS3_PARENTHESIS=1 \
-DSQLITE_ENABLE_COLUMN_METADATA=1"
./configure
make
make install-strip

what is not really clear to me is:
1. "who" exactly complained about missing sqlite3_column_table_name ?
2. "where" do you added your #define ?

AFAIK neither libspatialite nor librasterlite2 nor spatialite_gui
never call sqlite3_column_table_name()

just a possible suggestion: accordingly to the following posts
it seems that gdal too had similar troubles on Ubuntu:

http://lists.osgeo.org/pipermail/gdal-dev/2015-January/040848.html
https://bugs.launchpad.net/ubuntu/+source/gdal/+bug/1406679

bye Sandro


andrea antonello

unread,
Mar 7, 2016, 11:15:23 PM3/7/16
to spatiali...@googlegroups.com
Hi Sandro,
sorry for the delay.

[...]

gasp, this is the problem with not writing at the exact time the problem occurs :-)
It did indeed happen when compiling gdal afterwards, but I was quite sure it did happen also in the spatialite compilation chain, where it was solved fiddling with dependencies. But a grep through all the spatialite related code indeed doesn't reference sqlite3_column_table_name, so I guess you are right and I was just confused. Sorry for the noise.
Just for the record, I added the #define in the sqlite3.c file. Thanks for the flags, much better. :-)

Ciao,
Andrea





 


bye Sandro


--
You received this message because you are subscribed to the Google Groups "SpatiaLite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spatialite-use...@googlegroups.com.
To post to this group, send email to spatiali...@googlegroups.com.
Visit this group at https://groups.google.com/group/spatialite-users.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages