Doesn't find BuildMbr() on Windows

69 views
Skip to first unread message

Charlie Martin

unread,
Mar 31, 2011, 9:03:54 PM3/31/11
to SpatiaLite Users
I am using the C API to SpatiaLite. The program runs fine on OS X.
However, when I build and run on Windows, my query fails with the
following diagnostic:

prepare failed for sql statement "SELECT Geometry FROM
admin_0_boundary_breakaway_disputed_areas WHERE MbrWithin(Geometry,
BuildMbr(-180,35,-170,45));", no such function: BuildMbr

I have called spatialite_int(1) in my code.

Any suggestions on how I can track this down?

Incidentally, the DLL contained in libspatialite-win-x86-2.3.1.zip is
named libspatialite-1.dll, and dated 7/3/2009. I would expect it to be
more recent, and to be named libspatialite-2.dll.

Thanks,
Charlie

a.furieri

unread,
Apr 1, 2011, 3:04:10 AM4/1/11
to SpatiaLite Users
Hi Charlie,

v.2.3.1 is nowadays completely outdated
(and no longer supported): so I suggest
you to use a more recent version, e.g.
http://www.gaia-gis.it/spatialite-2.4.0-4/index.html
or
http://www.gaia-gis.it/spatialite-2.4.0-5/index.html

bye Sandro

Charlie Martin

unread,
Apr 1, 2011, 1:13:03 PM4/1/11
to SpatiaLite Users
Thanks Sandro,

I switched to v2.4.0-4, but still have the same results. Here are the
diagnostics:
SpatiaLite version ..: 2.4.0 Supported Extensions:
- 'VirtualShape' [direct Shapefile access]
- 'VirtualDbf' [direct DBF access]
- 'VirtualText' [direct CSV/TXT access]
- 'VirtualNetwork' [Dijkstra shortest path]
- 'RTree' [Spatial Index - R*Tree]
- 'MbrCache' [Spatial Index - MBR cache]
- 'VirtualFDO' [FDO-OGR interoperability]
- 'SpatiaLite' [Spatial SQL - OGC]
PROJ.4 version ......: Rel. 4.7.1, 23 September 2009
GEOS version ........: 3.2.2-CAPI-1.6.2
SQLite version: 3.7.5, SpatiaLite version: 2.4.0
SpatialDB: prepare failed for sql statement "SELECT Geometry FROM
admin_0_boundary_breakaway_disputed_areas WHERE MbrWithin(Geometry,
BuildMbr(-180,35,-170,45));", no such function: BuildMbr

FWIW, here is the listing of dependencies for my application, from the
dependency walker:
c:\mingw\bin\LIBGCC_S_DW2-1.DLL
c:\msys\1.0\local\bin\LIBGEOS-3-2-2.DLL
c:\msys\1.0\local\bin\LIBGEOS_C-1.DLL
c:\msys\1.0\local\bin\LIBICONV2.DLL
c:\msys\1.0\local\bin\LIBPROJ-0.DLL
c:\msys\1.0\local\bin\LIBSPATIALITE-2.DLL
c:\msys\1.0\local\bin\LIBSQLITE3-0.DLL
c:\projects\workspace\micromap\mmtest\NETEST.EXE
c:\windows\system32\KERNEL32.DLL
c:\windows\system32\MSVCRT.DLL
c:\windows\system32\NTDLL.DLL

Any suggestions on how I should track this down?

Thanks,
Charlie



a.furieri

unread,
Apr 1, 2011, 1:39:06 PM4/1/11
to SpatiaLite Users
Hi Charlie,

This sounds quite puzzling: for sure BuildMbr() is supported in v.
2.4.0-4

what exactly is the configuration you are actually using ?
(compiler, connector ...)

bye Sandro

Charlie Martin

unread,
Apr 1, 2011, 2:09:40 PM4/1/11
to SpatiaLite Users
I'm using gcc 4.4.0, in Mingw. I'm not sure what you mean by
connector. I am calling sqlite from C, as in:

int ret = sqlite3_prepare_v2(_dbHandle, sql.c_str(), sql.length(),
&_sqliteStmt, NULL);

The return code indicates failure, and the error message from sqlite
is: "no such function: BuildMbr".

Could it be that for some reason that spatialite is not being loaded?
I thought that this is what spatialite_init() does. I can see
gaiaBuildMbr() in libspatialite-2.dll.

Charlie




Reply all
Reply to author
Forward
0 new messages