sudo make
/Applications/Xcode.app/Contents/Developer/usr/bin/make all-am
gcc -DHAVE_CONFIG_H -I. -g -O2 -I. -g -O2 -MT shell.o -MD -MP -MF .deps/shell.Tpo -c -o shell.o shell.c
mv -f .deps/shell.Tpo .deps/shell.Po
/bin/sh ./libtool --tag=CC --mode=link gcc -g -O2 -o spatialite shell.o -L/usr/local/lib -lspatialite -lsqlite3 -lm -lz -L/usr/local/Cellar/freexl/1.0.0g/lib -lfreexl -lm -lreadline -lcurses -lproj -lexpat -L/usr/local/Cellar/geos/3.4.2/lib -lgeos_c
libtool: link: gcc -g -O2 -o spatialite shell.o -L/usr/local/lib /usr/local/lib/libspatialite.dylib -L/usr/local/Cellar/geos/3.4.2/lib -lxml2 -lpthread -ldl -liconv /usr/local/lib/libsqlite3.dylib -lz -L/usr/local/Cellar/freexl/1.0.0g/lib -lfreexl -lreadline -lcurses /usr/local/Cellar/proj/4.8.0/lib/libproj.dylib -lm -lexpat -lgeos_c
Undefined symbols for architecture x86_64:
"_sqlite3_enable_load_extension", referenced from:
_open_db in shell.o
"_sqlite3_load_extension", referenced from:
_do_meta_command in shell.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [spatialite] Error 1
make: *** [all] Error 2
Please point me how to fix this and thank you for your time.
Undefined symbols for architecture x86_64:
"_sqlite3_enable_load_extension", referenced from:
_open_db in shell.o
"_sqlite3_load_extension", referenced from:
_do_meta_command in shell.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [spatialite] Error 1
make: *** [all] Error 2
So as I understand for some reason my sqlite library still doesn't allow to load external extensions?
user@SQLite-f66f7a17$ export "CFLAGS=-I/usr/local/include"
user@SQLite-f66f7a17$ export "LDFLAGS-L/usr/local/lib"
user@SQLite-f66f7a17$ ./configure --enable-load-extension
user@SQLite-f66f7a17$ sudo make clean
user@SQLite-f66f7a17$ sudo make
In the output I can see couple of warnings:
ld: warning: invalid -install_name (/usr/local/lib/libsqlite3.0.dylib) in dependent dylib (./.libs/libsqlite3.dylib). Dylibs/frameworks which might go in dyld shared cache cannot link with dylibs that won't be in the shared cache
warning: no debug symbols in executable (-arch x86_64)
user@SQLite-f66f7a17$ sudo make install
user@SQLite-f66f7a17$ sqlite3 -version
3.8.7.4 2014-12-09 01:34:36 f66f7a17b78ba617acde90fc810107f34f1a1f2e
user@SQLite-f66f7a17$ which sqlite3
/usr/local/bin/sqlite3
Now go to spatialite sources and run:
us...@spatialite-tools-4.2.0$ make clean
us...@spatialite-tools-4.2.0$ make
us...@spatialite-tools-4.2.0$ sudo make install
us...@spatialite-tools-4.2.0$ spatialite -version
3.8.7.4 2014-12-09 01:34:36 f66f7a17b78ba617acde90fc810107f34f1a1f2e
us...@spatialite-tools-4.2.0$ cd ~/Temp/
user@Temp$ spatialite test.sqlite
SpatiaLite version ..: 4.2.0 Supported Extensions:
- 'VirtualShape' [direct Shapefile access]
- 'VirtualDbf' [direct DBF access]
- 'VirtualXL' [direct XLS access]
- 'VirtualText' [direct CSV/TXT access]
- 'VirtualNetwork' [Dijkstra shortest path]
- 'RTree' [Spatial Index - R*Tree]
- 'MbrCache' [Spatial Index - MBR cache]
- 'VirtualSpatialIndex' [R*Tree metahandler]
- 'VirtualXPath' [XML Path Language - XPath]
- 'VirtualFDO' [FDO-OGR interoperability]
- 'VirtualGPKG' [OGC GeoPackage interoperability]
- 'VirtualBBox' [BoundingBox tables]
- 'SpatiaLite' [Spatial SQL - OGC]
PROJ.4 version ......: Rel. 4.8.0, 6 March 2012
GEOS version ........: 3.4.2-CAPI-1.8.2 r3921
TARGET CPU ..........: x86_64-apple-darwin14.1.0
the SPATIAL_REF_SYS table already contains some row(s)
SQLite version ......: 3.8.7.4
Enter ".help" for instructions
SQLite version 3.8.7.4 2014-12-09 01:34:36