Hex Artifact Content
Not logged in

Artifact 74e891a6db2413b62d2ef9882146e7429cf0acc4:

Wiki page [mod_spatialite] by sandro 2014-06-26 08:34:40.
0000: 44 20 32 30 31 34 2d 30 36 2d 32 36 54 30 38 3a  D 2014-06-26T08:
0010: 33 34 3a 34 30 2e 34 35 32 0a 4c 20 6d 6f 64 5f  34:40.452.L mod_
0020: 73 70 61 74 69 61 6c 69 74 65 0a 50 20 63 61 61  spatialite.P caa
0030: 62 65 36 35 33 36 34 38 30 38 37 64 34 38 35 63  be653648087d485c
0040: 39 66 39 63 32 62 30 36 32 33 61 62 66 66 64 39  9f9c2b0623abffd9
0050: 64 63 33 66 34 0a 55 20 73 61 6e 64 72 6f 0a 57  dc3f4.U sandro.W
0060: 20 31 31 32 36 31 0a 62 61 63 6b 20 74 6f 20 3c   11261.back to <
0070: 61 20 68 72 65 66 3d 22 68 74 74 70 73 3a 2f 2f  a href="https://
0080: 77 77 77 2e 67 61 69 61 2d 67 69 73 2e 69 74 2f  www.gaia-gis.it/
0090: 66 6f 73 73 69 6c 2f 6c 69 62 73 70 61 74 69 61  fossil/libspatia
00a0: 6c 69 74 65 2f 77 69 6b 69 3f 6e 61 6d 65 3d 34  lite/wiki?name=4
00b0: 2e 32 2e 30 2d 64 6f 63 22 3e 34 2e 32 2e 30 2d  .2.0-doc">4.2.0-
00c0: 64 6f 63 3c 2f 61 3e 0d 0a 3c 68 31 3e 44 79 6e  doc</a>..<h1>Dyn
00d0: 61 6d 69 63 61 6c 6c 79 20 6c 6f 61 64 69 6e 67  amically loading
00e0: 20 53 70 61 74 69 61 4c 69 74 65 20 61 73 20 61   SpatiaLite as a
00f0: 6e 20 3c 75 3e 3c 69 3e 65 78 74 65 6e 73 69 6f  n <u><i>extensio
0100: 6e 20 6d 6f 64 75 6c 65 3c 2f 69 3e 3c 2f 75 3e  n module</i></u>
0110: 3c 2f 68 31 3e 0d 0a 3c 68 33 3e 54 68 65 6f 72  </h1>..<h3>Theor
0120: 65 74 69 63 61 6c 20 66 6f 75 6e 64 61 74 69 6f  etical foundatio
0130: 6e 73 3c 2f 68 33 3e 0d 0a 54 65 63 68 6e 69 63  ns</h3>..Technic
0140: 61 6c 6c 79 20 73 70 65 61 6b 69 6e 67 2c 20 53  ally speaking, S
0150: 70 61 74 69 61 4c 69 74 65 20 73 69 6d 70 6c 79  patiaLite simply
0160: 20 69 73 20 61 6e 20 65 78 74 65 6e 73 69 6f 6e   is an extension
0170: 20 6d 6f 64 75 6c 65 20 61 64 64 69 6e 67 20 53   module adding S
0180: 70 61 74 69 61 6c 20 70 72 6f 63 65 73 73 69 6e  patial processin
0190: 67 20 63 61 70 61 62 69 6c 69 74 69 65 73 20 74  g capabilities t
01a0: 6f 20 53 51 4c 69 74 65 2e 3c 62 72 3e 0d 0a 43  o SQLite.<br>..C
01b0: 6f 6e 73 65 71 75 65 6e 74 6c 79 20 73 6f 6d 65  onsequently some
01c0: 20 61 70 70 72 6f 70 72 69 61 74 65 20 6d 65 63   appropriate mec
01d0: 68 61 6e 69 73 6d 20 61 6c 6c 6f 77 69 6e 67 20  hanism allowing 
01e0: 74 6f 20 6c 6f 61 64 20 62 6f 74 68 20 62 69 6e  to load both bin
01f0: 61 72 79 20 6c 69 62 72 61 72 69 65 73 20 28 3c  ary libraries (<
0200: 69 3e 6c 69 62 73 71 6c 69 74 65 33 3c 2f 69 3e  i>libsqlite3</i>
0210: 20 61 6e 64 20 3c 69 3e 6c 69 62 73 70 61 74 69   and <i>libspati
0220: 61 6c 69 74 65 3c 2f 69 3e 29 20 74 68 65 6e 20  alite</i>) then 
0230: 70 72 6f 70 65 72 6c 79 20 72 65 67 69 73 74 65  properly registe
0240: 72 69 6e 67 20 77 69 74 68 69 6e 20 53 51 4c 69  ring within SQLi
0250: 74 65 33 20 74 68 65 20 6d 61 6e 79 20 3c 62 3e  te3 the many <b>
0260: 3c 69 3e 65 78 74 65 6e 64 65 64 20 53 70 61 74  <i>extended Spat
0270: 69 61 6c 20 53 51 4c 20 66 75 6e 63 74 69 6f 6e  ial SQL function
0280: 73 3c 2f 69 3e 3c 2f 62 3e 20 69 6d 70 6c 65 6d  s</i></b> implem
0290: 65 6e 74 65 64 20 62 79 20 53 70 61 74 69 61 4c  ented by SpatiaL
02a0: 69 74 65 20 69 73 20 61 20 73 74 72 69 63 74 6c  ite is a strictl
02b0: 79 20 72 65 71 75 69 72 65 64 20 74 61 73 6b 2e  y required task.
02c0: 3c 62 72 3e 0d 0a 41 20 66 75 72 74 68 65 72 20  <br>..A further 
02d0: 63 6f 6d 70 6c 69 63 61 74 69 6f 6e 20 73 68 6f  complication sho
02e0: 75 6c 64 20 62 65 20 74 61 6b 65 6e 20 69 6e 20  uld be taken in 
02f0: 70 72 6f 70 65 72 20 64 65 62 74 3b 20 3c 69 3e  proper debt; <i>
0300: 6c 69 62 73 70 61 74 69 61 6c 69 74 65 3c 2f 69  libspatialite</i
0310: 3e 20 69 73 6e 27 74 20 61 20 73 69 6d 70 6c 65  > isn't a simple
0320: 20 73 74 61 6e 64 2d 61 6c 6f 6e 65 20 73 65 6c   stand-alone sel
0330: 66 2d 63 6f 6e 74 61 69 6e 65 64 20 6c 69 62 72  f-contained libr
0340: 61 72 79 20 61 6e 64 20 64 65 70 65 6e 64 73 20  ary and depends 
0350: 6f 6e 20 73 65 76 65 72 61 6c 20 66 75 72 74 68  on several furth
0360: 65 72 20 6c 69 62 72 61 72 69 65 73 20 28 3c 69  er libraries (<i
0370: 3e 6c 69 62 67 65 6f 73 3c 2f 69 3e 2c 20 3c 69  >libgeos</i>, <i
0380: 3e 6c 69 62 70 72 6f 6a 3c 2f 69 3e 2c 20 3c 69  >libproj</i>, <i
0390: 3e 6c 69 62 78 6d 6c 32 3c 2f 69 3e 20 61 6e 64  >libxml2</i> and
03a0: 20 73 6f 20 6f 6e 29 2e 3c 62 72 3e 3c 62 72 3e   so on).<br><br>
03b0: 0d 0a 54 68 65 72 65 20 61 72 65 20 73 65 76 65  ..There are seve
03c0: 72 61 6c 20 70 6f 73 73 69 62 6c 65 20 61 6c 74  ral possible alt
03d0: 65 72 6e 61 74 69 76 65 20 70 61 74 68 73 20 6c  ernative paths l
03e0: 65 61 64 69 6e 67 20 74 6f 20 74 68 69 73 20 66  eading to this f
03f0: 69 6e 61 6c 20 67 6f 61 6c 3a 0d 0a 3c 75 6c 3e  inal goal:..<ul>
0400: 0d 0a 3c 6c 69 3e 75 73 69 6e 67 20 3c 62 3e 3c  ..<li>using <b><
0410: 69 3e 73 74 61 74 69 63 20 6c 69 6e 6b 61 67 65  i>static linkage
0420: 3c 2f 69 3e 3c 2f 62 3e 3a 20 61 20 73 74 72 61  </i></b>: a stra
0430: 69 67 68 74 66 6f 72 77 61 72 64 20 73 6f 6c 75  ightforward solu
0440: 74 69 6f 6e 20 61 76 6f 69 64 69 6e 67 20 6d 61  tion avoiding ma
0450: 6e 79 20 73 75 62 73 65 71 75 65 6e 74 20 68 65  ny subsequent he
0460: 61 64 61 63 68 65 73 20 72 65 6c 61 74 65 64 20  adaches related 
0470: 74 6f 20 69 6e 73 74 61 6c 6c 61 74 69 6f 6e 20  to installation 
0480: 61 6e 64 20 72 75 6e 2d 74 69 6d 65 20 63 6f 6e  and run-time con
0490: 66 69 67 75 72 61 74 69 6f 6e 2e 3c 62 72 3e 0d  figuration.<br>.
04a0: 0a 46 6f 6c 6c 6f 77 69 6e 67 20 74 68 69 73 20  .Following this 
04b0: 61 70 70 72 6f 61 63 68 20 61 20 73 69 6e 67 6c  approach a singl
04c0: 65 20 6d 6f 6e 6f 6c 69 74 68 69 63 20 65 78 65  e monolithic exe
04d0: 63 75 74 61 62 6c 65 20 69 6e 74 65 72 6e 61 6c  cutable internal
04e0: 6c 79 20 63 6f 6e 74 61 69 6e 69 6e 67 20 61 6c  ly containing al
04f0: 6c 20 72 65 71 75 69 72 65 64 20 62 69 6e 61 72  l required binar
0500: 79 20 63 6f 64 65 20 77 69 6c 6c 20 62 65 20 63  y code will be c
0510: 72 65 61 74 65 64 20 61 74 20 62 75 69 6c 64 20  reated at build 
0520: 74 69 6d 65 3b 20 74 68 69 73 20 6d 6f 6e 6f 6c  time; this monol
0530: 69 74 68 69 63 20 65 78 65 63 75 74 61 62 6c 65  ithic executable
0540: 20 77 69 6c 6c 20 63 6f 6e 73 65 71 75 65 6e 74   will consequent
0550: 6c 79 20 68 61 76 65 20 6e 6f 20 65 78 74 65 72  ly have no exter
0560: 6e 61 6c 20 64 65 70 65 6e 64 65 6e 63 69 65 73  nal dependencies
0570: 20 61 74 20 61 6c 6c 2c 20 74 68 75 73 20 72 61   at all, thus ra
0580: 64 69 63 61 6c 6c 79 20 73 69 6d 70 6c 69 66 79  dically simplify
0590: 69 6e 67 20 61 6e 79 20 73 75 62 73 65 71 75 65  ing any subseque
05a0: 6e 74 20 69 6e 73 74 61 6c 6c 61 74 69 6f 6e 20  nt installation 
05b0: 74 61 73 6b 2e 3c 62 72 3e 0d 0a 53 75 63 68 20  task.<br>..Such 
05c0: 73 74 72 61 74 65 67 79 20 6e 69 63 65 6c 79 20  strategy nicely 
05d0: 77 6f 72 6b 73 20 69 6e 20 74 68 65 20 63 61 73  works in the cas
05e0: 65 20 6f 66 20 73 74 61 6e 64 2d 61 6c 6f 6e 65  e of stand-alone
05f0: 20 73 65 6c 66 2d 63 6f 6e 74 61 69 6e 65 64 20   self-contained 
0600: 61 70 70 73 20 28 65 2e 67 2e 20 62 6f 74 68 20  apps (e.g. both 
0610: 3c 62 3e 73 70 61 74 69 61 6c 69 74 65 2e 65 78  <b>spatialite.ex
0620: 65 3c 2f 62 3e 20 61 6e 64 20 3c 62 3e 73 70 61  e</b> and <b>spa
0630: 74 69 61 6c 69 74 65 5f 67 75 69 2e 65 78 65 3c  tialite_gui.exe<
0640: 2f 62 3e 20 57 69 6e 64 6f 77 73 20 62 69 6e 61  /b> Windows bina
0650: 72 69 65 73 20 61 72 65 20 75 73 75 61 6c 6c 79  ries are usually
0660: 20 62 75 69 6c 74 20 74 68 69 73 20 77 61 79 29   built this way)
0670: 2e 3c 62 72 3e 0d 0a 55 6e 68 61 70 70 69 6c 79  .<br>..Unhappily
0680: 20 74 68 69 73 20 65 6c 65 6d 65 6e 74 61 72 79   this elementary
0690: 20 73 69 6d 70 6c 65 20 73 6f 6c 75 74 69 6f 6e   simple solution
06a0: 20 64 6f 65 73 6e 27 74 20 66 69 74 20 77 65 6c   doesn't fit wel
06b0: 6c 20 69 6e 20 4c 69 6e 75 78 20 61 6e 64 20 55  l in Linux and U
06c0: 6e 69 78 2d 6c 69 6b 65 20 65 6e 76 69 72 6f 6e  nix-like environ
06d0: 6d 65 6e 74 73 3b 20 61 6e 64 20 65 76 65 6e 20  ments; and even 
06e0: 77 6f 72 73 74 20 6f 66 74 65 6e 20 64 69 72 65  worst often dire
06f0: 63 74 6c 79 20 63 6f 6e 66 6c 69 63 74 73 20 77  ctly conflicts w
0700: 69 74 68 20 74 68 65 20 69 6e 74 65 72 6e 61 6c  ith the internal
0710: 20 61 72 63 68 69 74 65 63 74 75 72 65 20 73 75   architecture su
0720: 70 70 6f 72 74 65 64 20 62 79 20 6d 61 6e 79 20  pported by many 
0730: 6c 61 6e 67 75 61 67 65 20 63 6f 6e 6e 65 63 74  language connect
0740: 6f 72 73 20 6f 72 20 62 79 20 6f 74 68 65 72 20  ors or by other 
0750: 63 6f 6d 70 6c 65 78 20 66 72 61 6d 65 77 6f 72  complex framewor
0760: 6b 73 20 28 61 73 20 65 2e 67 2e 20 69 73 20 3c  ks (as e.g. is <
0770: 62 3e 51 47 49 53 3c 2f 62 3e 29 2e 3c 2f 6c 69  b>QGIS</b>).</li
0780: 3e 0d 0a 3c 6c 69 3e 75 73 69 6e 67 20 3c 62 3e  >..<li>using <b>
0790: 3c 69 3e 73 68 61 72 65 64 20 6c 69 62 72 61 72  <i>shared librar
07a0: 69 65 73 3c 69 3e 3c 2f 62 3e 20 28 61 6b 61 20  ies<i></b> (aka 
07b0: 3c 62 3e 3c 69 3e 44 4c 4c 73 3c 2f 69 3e 3c 2f  <b><i>DLLs</i></
07c0: 62 3e 20 6f 6e 20 57 69 6e 64 6f 77 73 29 2e 3c  b> on Windows).<
07d0: 62 72 3e 0d 0a 54 68 69 73 20 73 65 63 6f 6e 64  br>..This second
07e0: 20 61 70 70 72 6f 61 63 68 20 63 61 72 65 66 75   approach carefu
07f0: 6c 6c 79 20 61 76 6f 69 64 73 20 6c 69 6e 6b 69  lly avoids linki
0800: 6e 67 20 6f 6e 63 65 20 66 6f 72 20 61 6c 6c 20  ng once for all 
0810: 61 20 6d 6f 6e 6f 6c 69 74 68 69 63 20 65 78 65  a monolithic exe
0820: 63 75 74 61 62 6c 65 3b 20 61 74 20 74 68 65 20  cutable; at the 
0830: 6f 70 70 6f 73 69 74 65 2c 20 65 61 63 68 20 73  opposite, each s
0840: 69 6e 67 6c 65 20 63 6f 64 65 20 63 6f 6d 70 6f  ingle code compo
0850: 6e 65 6e 74 20 77 69 6c 6c 20 62 65 20 70 61 63  nent will be pac
0860: 6b 61 67 65 64 20 61 73 20 61 6e 20 61 75 74 6f  kaged as an auto
0870: 6e 6f 6d 6f 75 73 20 69 6e 64 69 76 69 64 75 61  nomous individua
0880: 6c 20 6d 65 6d 62 65 72 2c 20 61 6e 64 20 6f 6e  l member, and on
0890: 6c 79 20 61 74 20 72 75 6e 2d 74 69 6d 65 20 61  ly at run-time a
08a0: 6c 6c 20 63 6f 6d 70 6f 6e 65 6e 74 73 20 77 69  ll components wi
08b0: 6c 6c 20 62 65 20 66 69 6e 61 6c 6c 79 20 62 6f  ll be finally bo
08c0: 75 6e 64 20 74 6f 67 65 74 68 65 72 2e 3c 62 72  und together.<br
08d0: 3e 0d 0a 54 68 65 20 67 6f 6f 64 20 6e 65 77 3a  >..The good new:
08e0: 20 66 6f 6c 6c 6f 77 69 6e 67 20 74 68 69 73 20   following this 
08f0: 61 70 70 72 6f 61 63 68 20 65 61 63 68 20 6c 69  approach each li
0900: 62 72 61 72 79 2f 63 6f 6d 70 6f 6e 65 6e 74 20  brary/component 
0910: 77 69 6c 6c 20 62 65 20 28 68 6f 70 65 66 75 6c  will be (hopeful
0920: 6c 79 29 20 69 6e 73 74 61 6c 6c 65 64 20 6f 6e  ly) installed on
0930: 6c 79 20 6f 6e 63 65 20 6f 6e 20 74 68 65 20 74  ly once on the t
0940: 61 72 67 65 74 20 73 79 73 74 65 6d 2c 20 61 6e  arget system, an
0950: 64 20 65 76 65 72 79 20 65 78 65 63 75 74 61 62  d every executab
0960: 6c 65 20 64 65 70 65 6e 64 69 6e 67 20 6f 6e 20  le depending on 
0970: 74 68 61 74 20 6c 69 62 72 61 72 79 20 77 69 6c  that library wil
0980: 6c 20 6c 6f 61 64 20 65 78 61 63 74 6c 79 20 74  l load exactly t
0990: 68 65 20 73 61 6d 65 20 62 69 6e 61 72 79 20 63  he same binary c
09a0: 6f 64 65 20 74 68 75 73 20 67 72 61 6e 74 69 6e  ode thus grantin
09b0: 67 20 61 20 72 6f 62 75 73 74 20 6f 76 65 72 61  g a robust overa
09c0: 6c 6c 20 63 6f 6e 73 69 73 74 65 6e 63 79 2e 3c  ll consistency.<
09d0: 62 72 3e 0d 0a 54 68 65 20 62 61 64 20 6e 65 77  br>..The bad new
09e0: 3a 20 69 66 20 61 20 73 69 6e 67 6c 65 20 72 65  : if a single re
09f0: 71 75 69 72 65 64 20 63 6f 6d 70 6f 6e 65 6e 74  quired component
0a00: 20 63 6f 75 6c 64 6e 27 74 20 62 65 20 6c 6f 61   couldn't be loa
0a10: 64 65 64 20 61 74 20 72 75 6e 2d 74 69 6d 65 20  ded at run-time 
0a20: 28 66 6f 72 20 61 6e 79 20 70 6f 73 73 69 62 6c  (for any possibl
0a30: 65 20 72 65 61 73 6f 6e 29 20 74 68 65 20 65 78  e reason) the ex
0a40: 65 63 75 74 61 62 6c 65 20 61 73 20 61 20 77 68  ecutable as a wh
0a50: 6f 6c 65 20 77 69 6c 6c 20 66 61 69 6c 20 74 6f  ole will fail to
0a60: 20 72 75 6e 2e 3c 62 72 3e 0d 0a 54 6f 20 6d 61   run.<br>..To ma
0a70: 6b 65 20 74 68 69 6e 67 73 20 65 76 65 6e 20 77  ke things even w
0a80: 6f 72 73 74 2c 20 74 68 69 73 20 73 63 68 65 6d  orst, this schem
0a90: 61 20 77 6f 72 6b 73 20 6e 69 63 65 6c 79 20 6f  a works nicely o
0aa0: 6e 20 4c 69 6e 75 78 2c 20 55 6e 69 78 20 61 6e  n Linux, Unix an
0ab0: 64 20 4d 61 63 20 4f 53 20 58 3b 20 62 75 74 20  d Mac OS X; but 
0ac0: 6f 6e 20 57 69 6e 64 6f 77 73 20 69 74 27 73 20  on Windows it's 
0ad0: 70 6c 61 67 75 65 64 20 62 79 20 6d 61 6e 79 20  plagued by many 
0ae0: 73 65 72 69 6f 75 73 20 69 73 73 75 65 73 20 28  serious issues (
0af0: 74 68 65 20 69 6e 66 61 6d 6f 75 73 20 3c 62 3e  the infamous <b>
0b00: 3c 69 3e 44 4c 4c 20 68 65 6c 6c 3c 2f 69 3e 3c  <i>DLL hell</i><
0b10: 2f 62 3e 29 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e  /b>).</li>..<li>
0b20: 75 73 69 6e 67 20 3c 62 3e 3c 69 3e 64 79 6e 61  using <b><i>dyna
0b30: 6d 69 63 20 6c 6f 61 64 69 6e 67 3c 2f 69 3e 3c  mic loading</i><
0b40: 2f 62 3e 20 61 6b 61 20 3c 62 3e 3c 69 3e 6c 61  /b> aka <b><i>la
0b50: 74 65 20 62 69 6e 64 69 6e 67 3c 2f 69 3e 3c 2f  te binding</i></
0b60: 62 3e 20 28 77 68 69 63 68 20 68 61 73 6e 27 74  b> (which hasn't
0b70: 20 74 6f 20 62 65 20 63 6f 6e 66 75 73 65 64 20   to be confused 
0b80: 77 69 74 68 20 73 69 6d 70 6c 79 20 75 73 69 6e  with simply usin
0b90: 67 20 73 68 61 72 65 64 20 6c 69 62 72 61 72 69  g shared librari
0ba0: 65 73 29 2e 3c 62 72 3e 0d 0a 46 6f 6c 6c 6f 77  es).<br>..Follow
0bb0: 69 6e 67 20 74 68 69 73 20 74 68 69 72 64 20 61  ing this third a
0bc0: 70 70 72 6f 61 63 68 20 61 6e 20 65 78 74 65 6e  pproach an exten
0bd0: 73 69 6f 6e 20 6d 6f 64 75 6c 65 20 63 6f 75 6c  sion module coul
0be0: 64 20 62 65 20 73 65 6c 65 63 74 69 76 65 6c 79  d be selectively
0bf0: 20 6c 6f 61 64 65 64 20 6f 72 20 6e 6f 74 20 61   loaded or not a
0c00: 6e 64 20 74 68 65 20 61 63 74 75 61 6c 20 61 63  nd the actual ac
0c10: 74 69 6f 6e 20 77 69 6c 6c 20 62 65 20 61 63 74  tion will be act
0c20: 69 76 61 74 65 64 20 6f 6e 6c 79 20 61 74 20 72  ivated only at r
0c30: 75 6e 2d 74 69 6d 65 20 64 65 70 65 6e 64 69 6e  un-time dependin
0c40: 67 20 6f 6e 20 73 6f 6d 65 20 72 65 71 75 65 73  g on some reques
0c50: 74 20 65 76 65 6e 74 2e 0d 0a 49 66 20 66 6f 72  t event...If for
0c60: 20 61 6e 79 20 72 65 61 73 6f 6e 20 74 68 65 20   any reason the 
0c70: 6d 61 69 6e 20 65 78 65 63 75 74 61 62 6c 65 20  main executable 
0c80: 66 61 69 6c 73 20 74 6f 20 6c 6f 61 64 20 61 6e  fails to load an
0c90: 20 65 76 65 6e 74 75 61 6c 20 65 78 74 65 6e 73   eventual extens
0ca0: 69 6f 6e 20 6d 6f 64 75 6c 65 2c 20 69 74 20 77  ion module, it w
0cb0: 69 6c 6c 20 73 74 69 6c 6c 20 63 6f 6e 74 69 6e  ill still contin
0cc0: 75 65 20 74 6f 20 77 6f 72 6b 20 62 79 20 73 69  ue to work by si
0cd0: 6d 70 6c 79 20 69 67 6e 6f 72 69 6e 67 20 65 76  mply ignoring ev
0ce0: 65 72 79 20 6f 70 74 69 6f 6e 61 6c 20 66 65 61  ery optional fea
0cf0: 74 75 72 65 20 72 65 71 75 69 72 69 6e 67 20 74  ture requiring t
0d00: 68 65 20 66 61 69 6c 69 6e 67 20 6d 6f 64 75 6c  he failing modul
0d10: 65 2e 0d 0a 41 73 20 61 20 64 69 72 65 63 74 20  e...As a direct 
0d20: 63 6f 6e 73 65 71 75 65 6e 63 65 2c 20 61 6e 20  consequence, an 
0d30: 65 78 65 63 75 74 61 62 6c 65 20 62 75 69 6c 74  executable built
0d40: 20 74 68 69 73 20 77 61 79 20 63 61 6e 20 74 68   this way can th
0d50: 65 6f 72 65 74 69 63 61 6c 6c 79 20 67 72 6f 77  eoretically grow
0d60: 74 68 20 74 6f 20 74 68 65 20 69 6e 66 69 6e 69  th to the infini
0d70: 74 65 20 69 6e 20 61 20 68 69 67 68 6c 79 20 64  te in a highly d
0d80: 79 6e 61 6d 69 63 20 66 61 73 68 69 6f 6e 3b 20  ynamic fashion; 
0d90: 74 68 69 73 20 63 6f 72 72 65 73 70 6f 6e 64 73  this corresponds
0da0: 20 74 6f 20 61 20 73 6f 20 63 61 6c 6c 65 64 20   to a so called 
0db0: 3c 62 3e 3c 69 3e 70 6c 75 67 2d 69 6e 3c 2f 69  <b><i>plug-in</i
0dc0: 3e 3c 2f 62 3e 20 61 72 63 68 69 74 65 63 74 75  ></b> architectu
0dd0: 72 65 2e 3c 62 72 3e 0d 0a 48 61 70 70 69 6c 79  re.<br>..Happily
0de0: 20 65 6e 6f 75 67 68 20 53 51 4c 69 74 65 33 20   enough SQLite3 
0df0: 66 75 6c 6c 79 20 73 75 70 70 6f 72 74 73 20 74  fully supports t
0e00: 68 69 73 20 6d 6f 72 65 20 61 64 76 61 6e 63 65  his more advance
0e10: 64 20 6d 65 63 68 61 6e 69 73 6d 3b 20 61 6e 64  d mechanism; and
0e20: 20 74 68 69 73 20 6f 70 74 69 6f 6e 20 69 73 20   this option is 
0e30: 77 69 64 65 6c 79 20 73 75 70 70 6f 72 74 65 64  widely supported
0e40: 20 62 79 20 6d 61 6e 79 20 6c 61 6e 67 75 61 67   by many languag
0e50: 65 20 63 6f 6e 6e 65 63 74 6f 72 73 20 28 3c 69  e connectors (<i
0e60: 3e 50 79 74 68 6f 6e 3c 2f 69 3e 2c 20 3c 69 3e  >Python</i>, <i>
0e70: 4a 61 76 61 2f 4a 44 42 43 3c 2f 69 3e 2c 20 3c  Java/JDBC</i>, <
0e80: 69 3e 50 48 50 3c 2f 69 3e 2c 20 3c 69 3e 43 23  i>PHP</i>, <i>C#
0e90: 20 2e 4e 45 54 3c 2f 69 3e 20 61 6e 64 20 6f 74   .NET</i> and ot
0ea0: 68 65 72 73 29 2e 3c 2f 6c 69 3e 0d 0a 3c 2f 6c  hers).</li>..</l
0eb0: 69 3e 0d 0a 3c 2f 75 6c 3e 3c 62 72 3e 0d 0a 53  i>..</ul><br>..S
0ec0: 69 6c 6c 79 20 6f 64 64 69 74 69 65 73 20 28 74  illy oddities (t
0ed0: 6f 20 62 65 20 63 61 72 65 66 75 6c 6c 79 20 61  o be carefully a
0ee0: 76 6f 69 64 65 64 29 3a 0d 0a 3c 75 6c 3e 0d 0a  voided):..<ul>..
0ef0: 3c 6c 69 3e 6e 6f 74 68 69 6e 67 20 66 6f 72 62  <li>nothing forb
0f00: 69 64 73 20 74 6f 20 63 72 65 61 74 65 20 68 79  ids to create hy
0f10: 62 72 69 64 20 63 6f 6e 66 69 67 75 72 61 74 69  brid configurati
0f20: 6f 6e 73 2c 20 65 2e 67 2e 20 61 64 6f 70 74 69  ons, e.g. adopti
0f30: 6e 67 20 61 20 6d 69 78 20 6f 66 20 62 6f 74 68  ng a mix of both
0f40: 20 73 74 61 74 69 63 20 61 6e 64 20 64 79 6e 61   static and dyna
0f50: 6d 69 63 20 6c 69 6e 6b 61 67 65 2e 3c 2f 6c 69  mic linkage.</li
0f60: 3e 0d 0a 3c 6c 69 3e 73 75 63 68 20 61 20 73 6f  >..<li>such a so
0f70: 6c 75 74 69 6f 6e 20 63 6f 75 6c 64 20 65 61 73  lution could eas
0f80: 69 6c 79 20 61 70 70 65 61 6c 20 6e 61 69 76 65  ily appeal naive
0f90: 20 70 61 63 6b 61 67 65 72 73 2c 20 62 65 63 61   packagers, beca
0fa0: 75 73 65 20 69 74 20 61 70 70 61 72 65 6e 74 6c  use it apparentl
0fb0: 79 20 61 6c 6c 6f 77 73 20 74 6f 20 73 69 6d 70  y allows to simp
0fc0: 6c 69 66 79 20 69 6e 73 74 61 6c 6c 61 74 69 6f  lify installatio
0fd0: 6e 20 61 6e 64 20 63 6f 6e 66 69 67 75 72 61 74  n and configurat
0fe0: 69 6f 6e 20 74 61 73 6b 2e 3c 2f 6c 69 3e 0d 0a  ion task.</li>..
0ff0: 3c 6c 69 3e 61 6e 79 77 61 79 20 74 68 69 73 20  <li>anyway this 
1000: 69 73 20 6f 66 74 65 6e 20 61 20 64 61 6e 67 65  is often a dange
1010: 72 6f 75 73 20 70 69 74 66 61 6c 6c 2c 20 73 69  rous pitfall, si
1020: 6d 70 6c 79 20 6c 65 61 64 69 6e 67 20 74 6f 20  mply leading to 
1030: 70 6f 74 65 6e 74 69 61 6c 6c 79 20 75 6e 73 74  potentially unst
1040: 61 62 6c 65 20 61 6e 64 20 73 65 6c 66 2d 63 6f  able and self-co
1050: 6e 66 6c 69 63 74 69 6e 67 20 63 6f 6e 66 69 67  nflicting config
1060: 75 72 61 74 69 6f 6e 73 3a 20 69 74 27 73 20 74  urations: it's t
1070: 68 65 20 73 6f 20 63 61 6c 6c 65 64 20 3c 62 3e  he so called <b>
1080: 3c 69 3e 63 6f 62 72 61 20 65 66 66 65 63 74 3c  <i>cobra effect<
1090: 2f 69 3e 3c 2f 62 3e 20 28 69 2e 65 2e 20 77 68  /i></b> (i.e. wh
10a0: 65 6e 20 61 6e 20 61 74 74 65 6d 70 74 65 64 20  en an attempted 
10b0: 73 6f 6c 75 74 69 6f 6e 20 74 6f 20 61 20 70 72  solution to a pr
10c0: 6f 62 6c 65 6d 20 61 63 74 75 61 6c 6c 79 20 6d  oblem actually m
10d0: 61 6b 65 73 20 74 68 65 20 70 72 6f 62 6c 65 6d  akes the problem
10e0: 20 77 6f 72 73 65 29 2e 3c 2f 6c 69 3e 0d 0a 3c   worse).</li>..<
10f0: 6c 69 3e 3c 62 3e 3c 75 3e 47 6f 6c 64 65 6e 20  li><b><u>Golden 
1100: 72 75 6c 65 3c 2f 75 3e 3c 2f 62 3e 3a 20 6e 65  rule</u></b>: ne
1110: 76 65 72 20 61 74 74 65 6d 70 74 20 74 6f 20 69  ver attempt to i
1120: 6e 74 72 6f 64 75 63 65 20 73 74 61 74 69 63 61  ntroduce statica
1130: 6c 6c 79 20 6c 69 6e 6b 65 64 20 6c 69 62 72 61  lly linked libra
1140: 72 69 65 73 20 69 6e 20 61 20 63 6f 6e 66 69 67  ries in a config
1150: 75 72 61 74 69 6f 6e 20 77 69 64 65 6c 79 20 62  uration widely b
1160: 61 73 65 64 20 6f 6e 20 73 68 61 72 65 64 20 6c  ased on shared l
1170: 69 62 72 61 72 69 65 73 2e 20 54 68 69 73 20 6f  ibraries. This o
1180: 6e 65 20 69 73 6e 27 74 20 61 20 63 6c 65 76 65  ne isn't a cleve
1190: 72 20 73 6f 6c 75 74 69 6f 6e 2c 20 61 6e 64 20  r solution, and 
11a0: 77 69 6c 6c 20 73 69 6d 70 6c 79 20 69 6e 74 72  will simply intr
11b0: 6f 64 75 63 65 20 6d 61 6e 79 20 66 75 72 74 68  oduce many furth
11c0: 65 72 20 75 6e 65 78 70 65 63 74 65 64 20 63 6f  er unexpected co
11d0: 6d 70 6c 69 63 61 74 69 6f 6e 73 2e 3c 2f 6c 69  mplications.</li
11e0: 3e 0d 0a 3c 2f 75 6c 3e 3c 62 72 3e 0d 0a 3c 68  >..</ul><br>..<h
11f0: 33 3e 44 79 6e 61 6d 69 63 20 6c 6f 61 64 69 6e  3>Dynamic loadin
1200: 67 3a 20 68 6f 77 20 69 74 20 77 6f 72 6b 73 3c  g: how it works<
1210: 2f 68 33 3e 0d 0a 3c 69 3e 6c 69 62 73 71 6c 69  /h3>..<i>libsqli
1220: 74 65 33 3c 2f 69 3e 20 68 61 73 20 74 68 65 20  te3</i> has the 
1230: 63 61 70 61 62 69 6c 69 74 79 20 74 6f 20 64 79  capability to dy
1240: 6e 61 6d 69 63 61 6c 6c 79 20 6c 6f 61 64 20 65  namically load e
1250: 78 74 65 6e 73 69 6f 6e 20 6d 6f 64 75 6c 65 73  xtension modules
1260: 2e 20 54 68 69 73 20 66 65 61 74 75 72 65 20 69  . This feature i
1270: 73 20 61 76 61 69 6c 61 62 6c 65 20 61 73 20 61  s available as a
1280: 20 43 2d 6c 61 6e 67 75 61 67 65 20 41 50 49 2c   C-language API,
1290: 20 62 75 74 20 69 73 20 61 76 61 69 6c 61 62 6c   but is availabl
12a0: 65 20 61 73 20 61 20 3c 69 3e 73 70 65 63 69 61  e as a <i>specia
12b0: 6c 3c 2f 69 3e 20 53 51 4c 20 66 75 6e 63 74 69  l</i> SQL functi
12c0: 6f 6e 20 61 73 20 77 65 6c 6c 3a 0d 0a 3c 76 65  on as well:..<ve
12d0: 72 62 61 74 69 6d 3e 0d 0a 53 45 4c 45 43 54 20  rbatim>..SELECT 
12e0: 6c 6f 61 64 5f 65 78 74 65 6e 73 69 6f 6e 28 27  load_extension('
12f0: 6d 6f 64 5f 73 70 61 74 69 61 6c 69 74 65 27 29  mod_spatialite')
1300: 3b 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 3e 0d 0a  ;..</verbatim>..
1310: 54 68 69 73 20 53 51 4c 20 66 75 6e 63 74 69 6f  This SQL functio
1320: 6e 20 6d 61 6b 65 20 65 6c 65 6d 65 6e 74 61 72  n make elementar
1330: 79 20 73 69 6d 70 6c 65 20 28 61 6e 64 20 61 62  y simple (and ab
1340: 73 6f 6c 75 74 65 6c 79 20 6c 61 6e 67 75 61 67  solutely languag
1350: 65 20 69 6e 64 65 70 65 6e 64 65 6e 74 29 20 74  e independent) t
1360: 68 65 20 70 72 6f 62 6c 65 6d 20 6f 66 20 6c 6f  he problem of lo
1370: 61 64 69 6e 67 20 61 6e 79 20 70 6f 73 73 69 62  ading any possib
1380: 6c 65 20 65 78 74 65 6e 73 69 6f 6e 3b 20 79 6f  le extension; yo
1390: 75 20 61 72 65 20 73 69 6d 70 6c 79 20 65 78 70  u are simply exp
13a0: 65 63 74 65 64 20 74 6f 20 65 78 65 63 75 74 65  ected to execute
13b0: 20 61 20 72 61 74 68 65 72 20 74 72 69 76 69 61   a rather trivia
13c0: 6c 20 53 51 4c 20 73 74 61 74 65 6d 65 6e 74 20  l SQL statement 
13d0: 69 6e 20 6f 72 64 65 72 20 74 6f 20 6c 6f 61 64  in order to load
13e0: 20 61 6e 20 65 78 74 65 72 6e 61 6c 20 65 78 74   an external ext
13f0: 65 6e 73 69 6f 6e 20 6f 6e 6c 79 20 77 68 65 6e  ension only when
1400: 20 69 74 27 73 20 61 63 74 75 61 6c 6c 79 20 72   it's actually r
1410: 65 71 75 69 72 65 64 2e 3c 62 72 3e 3c 62 72 3e  equired.<br><br>
1420: 0d 0a 4c 6f 61 64 61 62 6c 65 20 65 78 74 65 6e  ..Loadable exten
1430: 73 69 6f 6e 20 61 6e 61 74 6f 6d 79 3a 0d 0a 3c  sion anatomy:..<
1440: 75 6c 3e 0d 0a 3c 6c 69 3e 61 6e 79 20 53 51 4c  ul>..<li>any SQL
1450: 69 74 65 27 73 20 65 78 74 65 6e 73 69 6f 6e 20  ite's extension 
1460: 6d 6f 64 75 6c 65 20 69 73 20 65 78 70 65 63 74  module is expect
1470: 65 64 20 74 6f 20 64 65 63 6c 61 72 65 20 61 20  ed to declare a 
1480: 77 65 6c 6c 20 6b 6e 6f 77 6e 20 63 6f 6e 76 65  well known conve
1490: 6e 74 69 6f 6e 61 6c 20 69 6e 74 65 72 66 61 63  ntional interfac
14a0: 65 2e 0d 0a 45 78 63 65 70 74 20 66 6f 72 20 74  e...Except for t
14b0: 68 69 73 2c 20 61 6e 79 20 53 51 4c 69 74 65 27  his, any SQLite'
14c0: 73 20 6f 77 6e 20 65 78 74 65 6e 73 69 6f 6e 20  s own extension 
14d0: 73 69 6d 70 6c 79 20 69 73 20 61 6e 20 6f 72 64  simply is an ord
14e0: 69 6e 61 72 79 20 73 68 61 72 65 64 20 6c 69 62  inary shared lib
14f0: 72 61 72 79 20 28 6f 72 20 44 4c 4c 29 20 61 73  rary (or DLL) as
1500: 20 61 6e 79 20 6f 74 68 65 72 2e 3c 2f 6c 69 3e   any other.</li>
1510: 0d 0a 3c 6c 69 3e 61 20 72 65 61 6c 20 65 78 74  ..<li>a real ext
1520: 65 6e 73 69 6f 6e 20 6d 6f 64 75 6c 65 20 77 69  ension module wi
1530: 6c 6c 20 6e 65 76 65 72 20 65 78 70 6c 69 63 69  ll never explici
1540: 74 6c 79 20 64 65 70 65 6e 64 20 6f 6e 20 53 51  tly depend on SQ
1550: 4c 69 74 65 33 2c 20 62 65 63 61 75 73 65 20 74  Lite3, because t
1560: 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 61 63 74  he following act
1570: 69 6f 6e 73 20 77 69 6c 6c 20 62 65 20 61 75 74  ions will be aut
1580: 6f 6d 61 74 69 63 61 6c 6c 79 20 74 61 6b 65 6e  omatically taken
1590: 20 62 79 20 53 51 4c 69 74 65 33 20 77 68 65 6e   by SQLite3 when
15a0: 20 6c 6f 61 64 69 6e 67 3a 0d 0a 3c 75 6c 3e 0d   loading:..<ul>.
15b0: 0a 3c 6c 69 3e 61 6c 6c 20 53 51 4c 20 66 75 6e  .<li>all SQL fun
15c0: 63 74 69 6f 6e 73 20 64 65 66 69 6e 65 64 2f 73  ctions defined/s
15d0: 75 70 70 6f 72 74 65 64 20 62 79 20 74 68 65 20  upported by the 
15e0: 65 78 74 65 6e 73 69 6f 6e 20 77 69 6c 6c 20 62  extension will b
15f0: 65 20 61 64 64 65 64 20 74 6f 20 74 68 65 20 73  e added to the s
1600: 74 61 6e 64 61 72 64 20 6c 69 73 74 3b 20 61 6e  tandard list; an
1610: 64 20 65 76 65 6e 74 75 61 6c 6c 79 20 61 6e 20  d eventually an 
1620: 65 78 74 65 6e 73 69 6f 6e 20 63 6f 75 6c 64 20  extension could 
1630: 65 76 65 72 20 6f 76 65 72 6c 6f 61 64 20 61 6e  ever overload an
1640: 79 20 70 72 65 2d 64 65 66 69 6e 65 64 20 53 51  y pre-defined SQ
1650: 4c 20 66 75 6e 63 74 69 6f 6e 20 64 69 72 65 63  L function direc
1660: 74 6c 79 20 64 65 66 69 6e 65 64 20 62 79 20 53  tly defined by S
1670: 51 4c 69 74 65 33 20 69 74 73 65 6c 66 2e 3c 2f  QLite3 itself.</
1680: 6c 69 3e 0d 0a 3c 6c 69 3e 74 68 61 74 27 73 20  li>..<li>that's 
1690: 6e 6f 74 20 61 6c 6c 3b 20 53 51 4c 69 74 65 33  not all; SQLite3
16a0: 20 77 69 6c 6c 20 69 6d 70 6c 69 63 69 74 6c 79   will implicitly
16b0: 20 70 61 73 73 20 74 6f 20 74 68 65 20 65 78 74   pass to the ext
16c0: 65 6e 73 69 6f 6e 20 61 20 3c 69 3e 3c 75 3e 6d  ension a <i><u>m
16d0: 69 72 72 6f 72 20 63 6f 70 79 3c 2f 75 3e 3c 2f  irror copy</u></
16e0: 69 3e 20 6f 66 20 69 74 73 20 6f 77 6e 20 41 50  i> of its own AP
16f0: 49 73 3a 20 74 68 69 73 20 77 69 6c 6c 20 65 6e  Is: this will en
1700: 73 75 72 65 20 74 68 61 74 20 65 78 61 63 74 6c  sure that exactl
1710: 79 20 74 68 65 20 73 61 6d 65 20 63 6f 64 65 20  y the same code 
1720: 77 69 6c 6c 20 73 75 70 70 6f 72 74 20 62 6f 74  will support bot
1730: 68 20 74 68 65 20 53 51 4c 69 74 65 27 73 20 6f  h the SQLite's o
1740: 77 6e 20 63 6f 72 65 20 61 6e 64 20 74 68 65 20  wn core and the 
1750: 65 78 74 65 6e 73 69 6f 6e 2c 20 61 6e 64 20 77  extension, and w
1760: 69 6c 6c 20 65 66 66 65 63 74 69 76 65 6c 79 20  ill effectively 
1770: 61 76 6f 69 64 20 61 6e 79 20 70 6f 73 73 69 62  avoid any possib
1780: 6c 65 20 63 6f 6e 66 6c 69 63 74 20 62 65 74 77  le conflict betw
1790: 65 65 6e 20 74 68 65 6d 2e 3c 2f 6c 69 3e 20 0d  een them.</li> .
17a0: 0a 3c 2f 75 6c 3e 3c 2f 6c 69 3e 0d 0a 3c 6c 69  .</ul></li>..<li
17b0: 3e 73 74 61 72 74 69 6e 67 20 73 69 6e 63 65 20  >starting since 
17c0: 53 51 4c 69 74 65 20 76 65 72 73 69 6f 6e 20 33  SQLite version 3
17d0: 2e 37 2e 31 37 20 28 72 65 6c 65 61 73 65 64 20  .7.17 (released 
17e0: 6f 6e 20 32 30 31 33 2d 30 35 2d 32 30 29 20 74  on 2013-05-20) t
17f0: 68 65 20 6c 6f 61 64 61 62 6c 65 20 65 78 74 65  he loadable exte
1800: 6e 73 69 6f 6e 20 6d 65 63 68 61 6e 69 73 6d 20  nsion mechanism 
1810: 77 61 73 20 73 69 67 6e 69 66 69 63 61 6e 74 6c  was significantl
1820: 79 20 65 6e 68 61 6e 63 65 64 3a 3c 75 6c 3e 0d  y enhanced:<ul>.
1830: 0a 3c 6c 69 3e 61 6e 79 20 65 78 74 65 6e 73 69  .<li>any extensi
1840: 6f 6e 20 6d 6f 64 75 6c 65 20 69 73 20 6e 6f 77  on module is now
1850: 20 65 78 70 65 63 74 65 64 20 74 6f 20 64 65 63   expected to dec
1860: 6c 61 72 65 20 69 74 73 20 6f 77 6e 20 69 6e 64  lare its own ind
1870: 69 76 69 64 75 61 6c 20 65 6e 74 72 79 20 70 6f  ividual entry po
1880: 69 6e 74 20 64 69 72 65 63 74 6c 79 20 72 65 6c  int directly rel
1890: 61 74 65 64 20 74 6f 20 74 68 65 20 6e 61 6d 65  ated to the name
18a0: 20 6f 66 20 74 68 65 20 65 78 74 65 6e 73 69 6f   of the extensio
18b0: 6e 3b 20 74 68 69 73 20 6d 61 6b 65 20 73 69 6d  n; this make sim
18c0: 70 6c 65 72 20 6c 6f 61 64 69 6e 67 20 6d 6f 72  pler loading mor
18d0: 65 20 6d 6f 64 75 6c 65 73 20 61 74 20 74 68 65  e modules at the
18e0: 20 73 61 6d 65 20 74 69 6d 65 2e 3c 2f 6c 69 3e   same time.</li>
18f0: 0d 0a 3c 6c 69 3e 6a 75 73 74 20 74 68 65 20 3c  ..<li>just the <
1900: 62 3e 3c 69 3e 62 61 73 65 20 6e 61 6d 65 3c 2f  b><i>base name</
1910: 69 3e 3c 2f 62 3e 20 6f 66 20 74 68 65 20 6d 6f  i></b> of the mo
1920: 64 75 6c 65 20 69 73 20 65 78 70 65 63 74 65 64  dule is expected
1930: 20 74 6f 20 62 65 20 73 70 65 63 69 66 69 65 64   to be specified
1940: 3b 20 61 6e 79 20 65 76 65 6e 74 75 61 6c 20 3c  ; any eventual <
1950: 62 3e 3c 69 3e 73 75 66 66 69 78 3c 2f 69 3e 3c  b><i>suffix</i><
1960: 2f 62 3e 20 28 61 73 20 65 2e 67 2e 20 3c 69 3e  /b> (as e.g. <i>
1970: 2e 73 6f 3c 2f 69 3e 20 6f 72 20 3c 69 3e 2e 64  .so</i> or <i>.d
1980: 6c 6c 3c 2f 69 3e 29 20 77 69 6c 6c 20 62 65 20  ll</i>) will be 
1990: 61 75 74 6f 6d 61 74 69 63 61 6c 6c 79 20 61 64  automatically ad
19a0: 64 65 64 20 62 79 20 53 51 4c 69 74 65 20 69 74  ded by SQLite it
19b0: 73 65 6c 66 20 61 63 63 6f 72 64 69 6e 67 6c 79  self accordingly
19c0: 20 74 6f 20 74 68 65 20 73 70 65 63 69 66 69 63   to the specific
19d0: 20 74 61 72 67 65 74 20 73 79 73 74 65 6d 20 65   target system e
19e0: 78 70 65 63 74 61 74 69 6f 6e 73 3a 20 74 68 69  xpectations: thi
19f0: 73 20 61 6c 6c 6f 77 73 20 66 6f 72 20 61 6e 20  s allows for an 
1a00: 65 61 73 69 65 72 20 63 72 6f 73 73 2d 70 6c 61  easier cross-pla
1a10: 74 66 6f 72 6d 20 70 6f 72 74 61 62 69 6c 69 74  tform portabilit
1a20: 79 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 61 6e 79  y.</li>..<li>any
1a30: 20 65 78 74 65 6e 73 69 6f 6e 20 6d 6f 64 75 6c   extension modul
1a40: 65 20 61 64 6f 70 74 69 6e 67 20 74 68 65 20 6d  e adopting the m
1a50: 6f 72 65 20 72 65 63 65 6e 74 20 63 6f 6e 76 65  ore recent conve
1a60: 6e 74 69 6f 6e 73 20 63 6f 75 6c 64 20 62 65 20  ntions could be 
1a70: 65 76 65 6e 74 75 61 6c 6c 79 20 62 65 20 6c 6f  eventually be lo
1a80: 61 64 65 64 20 65 76 65 6e 20 77 68 65 6e 20 75  aded even when u
1a90: 73 69 6e 67 20 73 6f 6d 65 20 6f 62 73 6f 6c 65  sing some obsole
1aa0: 74 65 20 76 65 72 73 69 6f 6e 20 28 3c 20 33 2e  te version (< 3.
1ab0: 37 2e 31 37 29 2c 20 62 75 74 20 69 6e 20 74 68  7.17), but in th
1ac0: 69 73 20 63 61 73 65 20 73 61 6d 65 20 73 70 65  is case same spe
1ad0: 63 69 61 6c 20 61 63 74 69 6f 6e 73 20 61 72 65  cial actions are
1ae0: 20 72 65 71 75 69 72 65 64 2e 0d 0a 50 6c 65 61   required...Plea
1af0: 73 65 20 63 6f 6e 73 75 6c 74 20 74 68 65 20 53  se consult the S
1b00: 51 4c 69 74 65 27 73 20 6f 77 6e 20 3c 61 20 68  QLite's own <a h
1b10: 72 65 66 3d 22 68 74 74 70 3a 2f 2f 77 77 77 2e  ref="http://www.
1b20: 73 71 6c 69 74 65 2e 6f 72 67 2f 6c 6f 61 64 65  sqlite.org/loade
1b30: 78 74 2e 68 74 6d 6c 22 3e 64 6f 63 75 6d 65 6e  xt.html">documen
1b40: 74 61 74 69 6f 6e 3c 2f 61 3e 20 66 6f 72 20 6d  tation</a> for m
1b50: 6f 72 65 20 64 65 74 61 69 6c 73 2e 3c 2f 6c 69  ore details.</li
1b60: 3e 0d 0a 3c 2f 75 6c 3e 3c 2f 6c 69 3e 0d 0a 3c  >..</ul></li>..<
1b70: 2f 75 6c 3e 0d 0a 3c 62 72 3e 0d 0a 43 6f 6d 6d  /ul>..<br>..Comm
1b80: 6f 6e 20 66 61 69 6c 75 72 65 20 63 61 75 73 65  on failure cause
1b90: 73 3a 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e 69 66  s:..<ul>..<li>if
1ba0: 20 74 68 65 20 65 78 70 65 63 74 65 64 20 63 6f   the expected co
1bb0: 6e 76 65 6e 74 69 6f 6e 61 6c 20 69 6e 74 65 72  nventional inter
1bc0: 66 61 63 65 20 69 73 6e 27 74 20 63 6f 72 72 65  face isn't corre
1bd0: 63 74 6c 79 20 64 65 63 6c 61 72 65 64 20 62 79  ctly declared by
1be0: 20 74 68 65 20 73 68 61 72 65 64 20 6c 69 62 72   the shared libr
1bf0: 61 72 79 20 62 65 69 6e 67 20 6c 6f 61 64 65 64  ary being loaded
1c00: 2c 20 74 68 65 6e 20 53 51 4c 69 74 65 33 20 77  , then SQLite3 w
1c10: 69 6c 6c 20 73 69 6d 70 6c 79 20 61 73 73 75 6d  ill simply assum
1c20: 65 20 74 68 61 74 20 69 74 27 73 20 6e 6f 74 20  e that it's not 
1c30: 61 20 76 61 6c 69 64 20 65 78 74 65 6e 73 69 6f  a valid extensio
1c40: 6e 20 6d 6f 64 75 6c 65 2e 3c 62 72 3e 0d 0a 41  n module.<br>..A
1c50: 6e 64 20 63 6f 6e 73 65 71 75 65 6e 74 6c 79 20  nd consequently 
1c60: 77 69 6c 6c 20 72 65 66 75 73 65 20 74 6f 20 6c  will refuse to l
1c70: 6f 61 64 20 74 68 65 20 6d 6f 64 75 6c 65 20 77  oad the module w
1c80: 69 74 68 6f 75 74 20 61 6e 79 20 6f 74 68 65 72  ithout any other
1c90: 20 63 6f 6e 73 65 71 75 65 6e 63 65 20 28 65 78   consequence (ex
1ca0: 63 65 70 74 20 6d 61 79 20 62 65 20 70 72 69 6e  cept may be prin
1cb0: 74 69 6e 67 20 73 6f 6d 65 20 61 70 70 72 6f 70  ting some approp
1cc0: 72 69 61 74 65 20 65 72 72 6f 72 20 6d 65 73 73  riate error mess
1cd0: 61 67 65 29 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e  age).</li>..<li>
1ce0: 61 20 6d 6f 72 65 20 6f 62 76 69 6f 75 73 20 66  a more obvious f
1cf0: 61 69 6c 75 72 65 20 63 61 75 73 65 20 63 6f 75  ailure cause cou
1d00: 6c 64 20 62 65 20 74 68 65 20 6f 6e 65 20 74 6f  ld be the one to
1d10: 20 61 74 74 65 6d 70 74 20 6c 6f 61 64 69 6e 67   attempt loading
1d20: 20 61 20 6e 6f 74 20 65 78 69 73 74 69 6e 67 20   a not existing 
1d30: 6d 6f 64 75 6c 65 20 28 6f 72 20 70 6f 73 73 69  module (or possi
1d40: 62 6c 79 2c 20 61 20 6d 6f 64 75 6c 65 20 77 68  bly, a module wh
1d50: 6f 6d 20 61 63 74 75 61 6c 20 61 64 64 72 65 73  om actual addres
1d60: 73 20 63 6f 75 6c 64 6e 27 74 20 62 65 20 72 65  s couldn't be re
1d70: 73 6f 6c 76 65 64 20 62 79 20 61 70 70 6c 79 69  solved by applyi
1d80: 6e 67 20 74 68 65 20 73 74 61 6e 64 61 72 64 20  ng the standard 
1d90: 73 79 73 74 65 6d 2d 64 65 70 65 6e 64 65 6e 74  system-dependent
1da0: 20 73 65 61 72 63 68 69 6e 67 20 72 75 6c 65 73   searching rules
1db0: 29 2e 3c 2f 6c 69 3e 20 0d 0a 3c 6c 69 3e 66 69  ).</li> ..<li>fi
1dc0: 6e 61 6c 6c 79 2c 20 74 68 65 20 6d 6f 64 75 6c  nally, the modul
1dd0: 65 20 63 6f 75 6c 64 20 65 66 66 65 63 74 69 76  e could effectiv
1de0: 65 6c 79 20 65 78 69 73 74 73 20 61 6e 64 20 63  ely exists and c
1df0: 6f 75 6c 64 20 63 6f 72 72 65 63 74 6c 79 20 64  ould correctly d
1e00: 65 63 6c 61 72 65 20 61 20 76 61 6c 69 64 20 63  eclare a valid c
1e10: 6f 6e 76 65 6e 74 69 6f 6e 61 6c 20 69 6e 74 65  onventional inte
1e20: 72 66 61 63 65 2e 20 41 6e 79 77 61 79 2c 20 69  rface. Anyway, i
1e30: 66 20 74 68 65 20 63 6f 72 72 65 73 70 6f 6e 64  f the correspond
1e40: 69 6e 67 20 73 68 61 72 65 64 20 6c 69 62 72 61  ing shared libra
1e50: 72 79 20 68 61 73 20 66 75 72 74 68 65 72 20 64  ry has further d
1e60: 65 70 65 6e 64 65 6e 63 69 65 73 20 73 6f 6d 65  ependencies some
1e70: 20 62 72 6f 6b 65 6e 20 6c 69 6e 6b 20 63 6f 75   broken link cou
1e80: 6c 64 20 70 6f 73 73 69 62 6c 79 20 66 6f 72 62  ld possibly forb
1e90: 69 64 20 61 20 73 75 63 63 65 73 73 66 75 6c 20  id a successful 
1ea0: 6c 6f 61 64 69 6e 67 2e 3c 2f 6c 69 3e 0d 0a 3c  loading.</li>..<
1eb0: 6c 69 3e 74 68 65 20 6c 61 73 74 20 68 69 6c 6c  li>the last hill
1ec0: 2d 66 61 74 65 64 20 63 6f 6d 62 69 6e 61 74 69  -fated combinati
1ed0: 6f 6e 3a 20 53 51 4c 69 74 65 33 20 69 73 20 61  on: SQLite3 is a
1ee0: 20 73 74 72 6f 6e 67 6c 79 20 63 6f 6e 66 69 67   strongly config
1ef0: 75 72 61 62 6c 65 20 63 6f 6d 70 6f 6e 65 6e 74  urable component
1f00: 2e 20 49 66 20 66 6f 72 20 61 6e 79 20 68 69 67  . If for any hig
1f10: 68 6c 79 20 71 75 65 73 74 69 6f 6e 61 62 6c 65  hly questionable
1f20: 20 63 68 6f 69 63 65 20 79 6f 75 72 20 73 79 73   choice your sys
1f30: 74 65 6d 20 70 61 63 6b 61 67 65 72 20 68 61 64  tem packager had
1f40: 20 64 65 63 69 64 65 64 20 74 6f 20 64 69 73 61   decided to disa
1f50: 62 6c 65 20 61 74 20 61 6c 6c 20 74 68 65 20 65  ble at all the e
1f60: 78 74 65 6e 73 69 6f 6e 20 6d 6f 64 75 6c 65 20  xtension module 
1f70: 6d 65 63 68 61 6e 69 73 6d 20 79 6f 75 27 6c 6c  mechanism you'll
1f80: 20 74 68 65 6e 20 6e 65 76 65 72 20 62 65 20 61   then never be a
1f90: 62 6c 65 20 74 6f 20 6c 6f 61 64 20 61 6e 79 20  ble to load any 
1fa0: 65 78 74 65 6e 73 69 6f 6e 2e 20 46 75 6c 6c 20  extension. Full 
1fb0: 73 74 6f 70 2e 20 28 61 6e 79 77 61 79 20 79 6f  stop. (anyway yo
1fc0: 75 27 6c 6c 20 70 72 6f 62 61 62 6c 79 20 62 65  u'll probably be
1fd0: 20 61 62 6c 65 20 74 6f 20 73 77 69 74 63 68 20   able to switch 
1fe0: 74 6f 20 73 6f 6d 65 20 6d 6f 72 65 20 72 65 61  to some more rea
1ff0: 73 6f 6e 61 62 6c 65 20 2f 20 6c 65 73 73 20 70  sonable / less p
2000: 61 72 61 6e 6f 69 64 20 64 69 73 74 72 69 62 75  aranoid distribu
2010: 74 69 6f 6e 29 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69  tion).</li>..<li
2020: 3e 3c 62 3e 3c 75 3e 55 73 65 66 75 6c 20 68 69  ><b><u>Useful hi
2030: 6e 74 3c 2f 75 3e 3c 2f 62 3e 3a 20 6d 61 6e 79  nt</u></b>: many
2040: 20 6c 61 6e 67 75 61 67 65 20 63 6f 6e 6e 65 63   language connec
2050: 74 6f 72 73 20 73 75 70 70 6f 72 74 20 61 20 76  tors support a v
2060: 65 72 79 20 6d 69 6e 69 6d 61 6c 69 73 74 69 63  ery minimalistic
2070: 20 61 6e 64 20 72 61 74 68 65 72 20 75 73 65 6c   and rather usel
2080: 65 73 73 20 64 69 61 67 6e 6f 73 74 69 63 2e 20  ess diagnostic. 
2090: 49 66 20 79 6f 75 20 61 72 65 20 65 78 70 65 72  If you are exper
20a0: 69 65 6e 63 69 6e 67 20 73 6f 6d 65 20 74 72 6f  iencing some tro
20b0: 75 62 6c 65 20 69 6e 20 73 75 63 63 65 73 73 66  uble in successf
20c0: 75 6c 6c 79 20 6c 6f 61 64 69 6e 67 20 53 70 61  ully loading Spa
20d0: 74 69 61 4c 69 74 65 20 61 73 20 61 6e 20 65 78  tiaLite as an ex
20e0: 74 65 6e 73 69 6f 6e 2c 20 61 6e 79 20 61 74 74  tension, any att
20f0: 65 6d 70 74 20 74 6f 20 64 69 72 65 63 74 6c 79  empt to directly
2100: 20 64 65 62 75 67 20 79 6f 75 72 20 63 6f 64 65   debug your code
2110: 20 77 69 6c 6c 20 70 72 6f 62 61 62 6c 79 20 62   will probably b
2120: 65 20 61 20 66 72 75 73 74 72 61 74 69 6e 67 20  e a frustrating 
2130: 61 6e 64 20 69 6e 63 6f 6e 63 6c 75 73 69 76 65  and inconclusive
2140: 20 65 78 70 65 72 69 65 6e 63 65 2e 3c 62 72 3e   experience.<br>
2150: 0d 0a 41 6e 79 77 61 79 20 79 6f 75 20 63 61 6e  ..Anyway you can
2160: 20 61 6c 77 61 79 73 20 61 70 70 6c 79 20 61 6e   always apply an
2170: 20 61 6c 74 65 72 6e 61 74 69 76 65 20 61 70 70   alternative app
2180: 72 6f 61 63 68 3a 0d 0a 3c 75 6c 3e 0d 0a 3c 6c  roach:..<ul>..<l
2190: 69 3e 73 74 61 72 74 20 74 68 65 20 3c 62 3e 73  i>start the <b>s
21a0: 71 6c 69 74 65 33 3c 2f 62 3e 20 43 6f 6d 6d 61  qlite3</b> Comma
21b0: 6e 64 20 4c 69 6e 65 20 66 72 6f 6e 74 2d 65 6e  nd Line front-en
21c0: 64 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 74 68 65  d.</li>..<li>the
21d0: 6e 20 65 78 65 63 75 74 65 20 79 6f 75 72 20 70  n execute your p
21e0: 72 6f 62 6c 65 6d 61 74 69 63 20 3c 62 3e 53 45  roblematic <b>SE
21f0: 4c 45 43 54 20 6c 6f 61 64 5f 65 78 74 65 6e 73  LECT load_extens
2200: 69 6f 6e 3c 2f 62 3e 20 73 74 61 74 65 6d 65 6e  ion</b> statemen
2210: 74 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 69 66 20  t.</li>..<li>if 
2220: 73 6f 6d 65 20 66 61 69 6c 75 72 65 20 66 6f 72  some failure for
2230: 62 69 64 73 20 74 6f 20 73 75 63 63 65 73 73 66  bids to successf
2240: 75 6c 6c 79 20 6c 6f 61 64 20 74 68 65 20 65 78  ully load the ex
2250: 74 65 6e 73 69 6f 6e 20 6d 6f 64 75 6c 65 20 74  tension module t
2260: 68 65 6e 20 3c 62 3e 73 71 6c 69 74 65 33 3c 2f  hen <b>sqlite3</
2270: 62 3e 20 77 69 6c 6c 20 61 6c 77 61 79 73 20 70  b> will always p
2280: 72 69 6e 74 20 6d 61 6e 79 20 75 73 65 66 75 6c  rint many useful
2290: 20 65 72 72 6f 72 20 6d 65 73 73 61 67 65 73 20   error messages 
22a0: 63 6c 65 61 72 6c 79 20 65 78 70 6c 61 69 6e 69  clearly explaini
22b0: 6e 67 20 77 68 65 72 65 20 69 73 20 74 68 65 20  ng where is the 
22c0: 6f 66 66 65 6e 64 69 6e 67 20 63 61 75 73 65 2e  offending cause.
22d0: 20 49 6e 20 61 20 72 65 61 73 6f 6e 61 62 6c 65   In a reasonable
22e0: 20 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e 20 62   configuration b
22f0: 6f 74 68 20 74 68 65 20 73 71 6c 69 74 65 33 20  oth the sqlite3 
2300: 74 6f 6f 6c 20 61 6e 64 20 79 6f 75 72 20 6c 61  tool and your la
2310: 6e 67 75 61 67 65 20 63 6f 6e 6e 65 63 74 6f 72  nguage connector
2320: 20 73 68 6f 75 6c 64 20 69 6e 76 6f 6b 65 20 74   should invoke t
2330: 68 65 20 73 61 6d 65 20 69 64 65 6e 74 69 63 61  he same identica
2340: 6c 20 63 6f 70 79 20 6f 66 20 3c 62 3e 3c 69 3e  l copy of <b><i>
2350: 6c 69 62 73 71 6c 69 74 65 33 3c 2f 69 3e 3c 2f  libsqlite3</i></
2360: 62 3e 2c 20 73 6f 20 79 6f 75 27 6c 6c 20 65 66  b>, so you'll ef
2370: 66 65 63 74 69 76 65 6c 79 20 74 65 73 74 20 74  fectively test t
2380: 68 65 20 73 61 6d 65 20 72 75 6e 2d 74 69 6d 65  he same run-time
2390: 20 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e 20 61   configuration a
23a0: 64 6f 70 74 65 64 20 62 79 20 74 68 65 20 6c 61  dopted by the la
23b0: 6e 67 75 61 67 65 20 63 6f 6e 6e 65 63 74 6f 72  nguage connector
23c0: 20 62 75 74 20 74 61 6b 69 6e 67 20 70 72 6f 66   but taking prof
23d0: 69 74 20 66 72 6f 6d 20 72 69 63 68 65 72 20 64  it from richer d
23e0: 69 61 67 6e 6f 73 74 69 63 20 6d 65 73 73 61 67  iagnostic messag
23f0: 65 73 20 28 75 6e 68 61 70 70 69 6c 79 20 6e 6f  es (unhappily no
2400: 74 20 61 6c 6c 20 63 6f 6e 66 69 67 75 72 61 74  t all configurat
2410: 69 6f 6e 73 20 61 72 65 20 61 6c 77 61 79 73 20  ions are always 
2420: 6e 65 74 20 61 6e 64 20 63 6c 65 61 6e 20 61 73  net and clean as
2430: 20 79 6f 75 20 63 6f 75 6c 64 20 65 78 70 65 63   you could expec
2440: 74 20 2e 2e 2e 20 74 68 69 73 20 72 75 6c 65 20  t ... this rule 
2450: 68 61 73 20 6d 61 6e 79 20 65 78 63 65 70 74 69  has many excepti
2460: 6f 6e 73 2c 20 6d 6f 73 74 20 6e 6f 74 61 62 6c  ons, most notabl
2470: 79 20 6f 6e 20 57 69 6e 64 6f 77 73 29 2e 3c 2f  y on Windows).</
2480: 6c 69 3e 0d 0a 3c 2f 75 6c 3e 3c 2f 6c 69 3e 0d  li>..</ul></li>.
2490: 0a 3c 2f 75 6c 3e 0d 0a 3c 68 33 3e 57 68 61 74  .</ul>..<h3>What
24a0: 27 73 20 6e 65 77 20 69 6e 20 3c 75 3e 3c 69 3e  's new in <u><i>
24b0: 6d 6f 64 5f 73 70 61 74 69 61 6c 69 74 65 3c 2f  mod_spatialite</
24c0: 69 3e 3c 2f 75 3e 3c 2f 68 33 3e 0d 0a 59 6f 75  i></u></h3>..You
24d0: 27 6c 6c 20 70 72 6f 62 61 62 6c 79 20 62 65 20  'll probably be 
24e0: 61 6c 72 65 61 64 79 20 61 63 63 75 73 74 6f 6d  already accustom
24f0: 65 64 20 74 6f 20 6c 6f 61 64 20 53 70 61 74 69  ed to load Spati
2500: 61 4c 69 74 65 20 61 73 20 61 20 64 79 6e 61 6d  aLite as a dynam
2510: 69 63 20 65 78 74 65 6e 73 69 6f 6e 3b 20 62 75  ic extension; bu
2520: 74 20 61 6e 79 20 70 72 65 76 69 6f 75 73 20 76  t any previous v
2530: 65 72 73 69 6f 6e 20 62 65 66 6f 72 65 20 3c 62  ersion before <b
2540: 3e 34 2e 32 3c 2f 62 3e 20 6d 61 64 65 20 6e 6f  >4.2</b> made no
2550: 20 72 65 61 6c 20 64 69 73 74 69 6e 63 74 69 6f   real distinctio
2560: 6e 20 62 65 74 77 65 65 6e 20 6c 6f 61 64 61 62  n between loadab
2570: 6c 65 20 6d 6f 64 75 6c 65 73 20 61 6e 64 20 67  le modules and g
2580: 65 6e 65 72 61 6c 2d 70 75 72 70 6f 73 65 20 73  eneral-purpose s
2590: 68 61 72 65 64 20 6c 69 62 72 61 72 69 65 73 2e  hared libraries.
25a0: 3c 62 72 3e 0d 0a 41 73 20 77 65 20 70 61 69 6e  <br>..As we pain
25b0: 66 75 6c 6c 79 20 6c 65 61 72 6e 65 64 20 62 79  fully learned by
25c0: 20 64 69 72 65 63 74 20 6f 6e 2d 74 68 65 2d 66   direct on-the-f
25d0: 69 65 6c 64 20 65 78 70 65 72 69 65 6e 63 65 2c  ield experience,
25e0: 20 74 68 69 73 20 61 70 70 61 72 65 6e 74 6c 79   this apparently
25f0: 20 73 69 6d 70 6c 65 72 20 63 6f 6e 66 69 67 75   simpler configu
2600: 72 61 74 69 6f 6e 20 63 61 75 73 65 64 20 6c 6f  ration caused lo
2610: 74 20 6f 66 20 74 72 6f 75 62 6c 65 73 3a 20 69  t of troubles: i
2620: 6e 73 74 61 62 69 6c 69 74 69 65 73 2c 20 73 75  nstabilities, su
2630: 64 64 65 6e 20 63 72 61 73 68 65 73 20 61 6e 64  dden crashes and
2640: 20 73 6f 20 6f 6e 2e 20 4d 61 6b 69 6e 67 20 61   so on. Making a
2650: 20 63 6c 65 61 72 65 72 20 64 69 73 74 69 6e 63   clearer distinc
2660: 74 69 6f 6e 20 62 65 74 77 65 65 6e 20 61 20 3c  tion between a <
2670: 75 3e 3c 69 3e 67 65 6e 65 72 61 6c 2d 70 75 72  u><i>general-pur
2680: 70 6f 73 65 20 73 68 61 72 65 64 20 6c 69 62 72  pose shared libr
2690: 61 72 79 3c 2f 69 3e 3c 2f 75 3e 20 61 6e 64 20  ary</i></u> and 
26a0: 61 20 3c 75 3e 3c 69 3e 70 75 72 65 20 6c 6f 61  a <u><i>pure loa
26b0: 64 61 62 6c 65 20 6d 6f 64 75 6c 65 3c 2f 69 3e  dable module</i>
26c0: 3c 2f 75 3e 20 73 65 65 6d 73 20 74 6f 20 62 65  </u> seems to be
26d0: 20 74 68 65 20 64 65 66 69 6e 69 74 69 76 65 20   the definitive 
26e0: 73 6f 6c 75 74 69 6f 6e 2e 3c 62 72 3e 0d 0a 45  solution.<br>..E
26f0: 78 61 63 74 6c 79 20 68 65 72 65 20 69 73 20 74  xactly here is t
2700: 68 65 20 72 61 64 69 63 61 6c 20 69 6e 6e 6f 76  he radical innov
2710: 61 74 69 6f 6e 20 69 6e 74 72 6f 64 75 63 65 20  ation introduce 
2720: 73 74 61 72 74 69 6e 67 20 73 69 6e 63 65 20 76  starting since v
2730: 65 72 73 69 6f 6e 20 3c 62 3e 34 2e 32 3c 2f 62  ersion <b>4.2</b
2740: 3e 3b 20 6e 6f 77 20 53 70 61 74 69 61 4c 69 74  >; now SpatiaLit
2750: 65 20 69 73 20 64 69 73 74 72 69 62 75 74 65 64  e is distributed
2760: 20 69 6e 20 74 77 6f 20 61 6c 74 65 72 6e 61 74   in two alternat
2770: 69 76 65 20 66 6c 61 76 6f 72 73 3a 0d 0a 3c 75  ive flavors:..<u
2780: 6c 3e 0d 0a 3c 6c 69 3e 3c 62 3e 3c 69 3e 6c 69  l>..<li><b><i>li
2790: 62 73 70 61 74 69 61 6c 69 74 65 3c 2f 69 3e 3c  bspatialite</i><
27a0: 2f 62 3e 20 28 3c 62 3e 3c 69 3e 2e 73 6f 3c 2f  /b> (<b><i>.so</
27b0: 69 3e 3c 2f 62 3e 2c 20 3c 62 3e 3c 69 3e 2e 64  i></b>, <b><i>.d
27c0: 6c 6c 3c 2f 69 3e 3c 2f 62 3e 2c 20 3c 62 3e 3c  ll</i></b>, <b><
27d0: 69 3e 2e 64 79 6c 69 62 3c 2f 69 3e 3c 2f 62 3e  i>.dylib</i></b>
27e0: 20 61 6e 64 20 73 6f 20 6f 6e 29 3a 20 61 20 67   and so on): a g
27f0: 65 6e 75 69 6e 65 20 63 6c 61 73 73 69 63 20 73  enuine classic s
2800: 68 61 72 65 64 20 6c 69 62 72 61 72 79 2e 3c 62  hared library.<b
2810: 72 3e 0d 0a 49 74 20 77 69 6c 6c 20 61 6c 77 61  r>..It will alwa
2820: 79 73 20 64 65 70 65 6e 64 20 6f 6e 20 73 6f 6d  ys depend on som
2830: 65 20 65 78 74 65 72 6e 61 6c 20 3c 69 3e 6c 69  e external <i>li
2840: 62 73 71 6c 69 74 65 33 3c 2f 69 3e 2c 20 61 6e  bsqlite3</i>, an
2850: 64 20 69 73 20 75 6e 69 71 75 65 6c 79 20 69 6e  d is uniquely in
2860: 74 65 6e 64 65 64 20 74 6f 20 62 65 20 75 73 65  tended to be use
2870: 64 20 62 79 20 73 74 61 6e 64 2d 61 6c 6f 6e 65  d by stand-alone
2880: 20 61 70 70 6c 69 63 61 74 69 6f 6e 73 20 28 73   applications (s
2890: 75 63 68 20 61 73 20 65 2e 67 2e 20 3c 62 3e 3c  uch as e.g. <b><
28a0: 69 3e 73 70 61 74 69 61 6c 69 74 65 3c 2f 69 3e  i>spatialite</i>
28b0: 3c 2f 62 3e 20 6f 72 20 3c 62 3e 3c 69 3e 73 70  </b> or <b><i>sp
28c0: 61 74 69 61 6c 69 74 65 5f 67 75 69 3c 2f 75 3e  atialite_gui</u>
28d0: 3c 2f 62 3e 29 2e 3c 62 72 3e 0d 0a 59 6f 75 27  </b>).<br>..You'
28e0: 6c 6c 20 6e 65 76 65 72 20 62 65 20 61 62 6c 65  ll never be able
28f0: 20 74 6f 20 73 75 63 63 65 73 73 66 75 6c 6c 79   to successfully
2900: 20 6c 6f 61 64 20 74 68 69 73 20 3c 62 3e 3c 69   load this <b><i
2910: 3e 6c 69 62 73 70 61 74 69 61 6c 69 74 65 3c 2f  >libspatialite</
2920: 69 3e 3c 2f 62 3e 20 73 68 61 72 65 64 20 6c 69  i></b> shared li
2930: 62 72 61 72 79 20 61 73 20 61 20 64 79 6e 61 6d  brary as a dynam
2940: 69 63 20 65 78 74 65 6e 73 69 6f 6e 20 76 69 61  ic extension via
2950: 20 74 68 65 20 3c 62 3e 53 45 4c 45 43 54 20 6c   the <b>SELECT l
2960: 6f 61 64 5f 65 78 74 65 6e 73 69 6f 6e 3c 2f 62  oad_extension</b
2970: 3e 20 6d 65 63 68 61 6e 69 73 6d 2c 20 73 69 6d  > mechanism, sim
2980: 70 6c 79 20 62 65 63 61 75 73 65 20 69 74 20 64  ply because it d
2990: 6f 65 73 6e 27 74 20 64 65 63 6c 61 72 65 20 74  oesn't declare t
29a0: 68 65 20 72 65 71 75 69 72 65 64 20 63 6f 6e 76  he required conv
29b0: 65 6e 74 69 6f 6e 61 6c 20 69 6e 74 65 72 66 61  entional interfa
29c0: 63 65 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 3c 62  ce.</li>..<li><b
29d0: 3e 3c 69 3e 6d 6f 64 5f 73 70 61 74 69 61 6c 69  ><i>mod_spatiali
29e0: 74 65 3c 2f 69 3e 3c 2f 62 3e 20 28 3c 62 3e 3c  te</i></b> (<b><
29f0: 69 3e 2e 73 6f 3c 2f 69 3e 3c 2f 62 3e 2c 20 3c  i>.so</i></b>, <
2a00: 62 3e 3c 69 3e 2e 64 6c 6c 3c 2f 69 3e 3c 2f 62  b><i>.dll</i></b
2a10: 3e 2c 20 3c 62 3e 3c 69 3e 2e 64 79 6c 69 62 3c  >, <b><i>.dylib<
2a20: 2f 69 3e 3c 2f 62 3e 20 61 6e 64 20 73 6f 20 6f  /i></b> and so o
2a30: 6e 29 3a 20 74 68 69 73 20 69 73 20 73 69 6d 70  n): this is simp
2a40: 6c 79 20 69 6e 74 65 6e 64 65 64 20 61 73 20 70  ly intended as p
2a50: 75 72 65 20 6c 6f 61 64 61 62 6c 65 20 6d 6f 64  ure loadable mod
2a60: 75 6c 65 20 6c 61 63 6b 69 6e 67 20 61 6e 79 20  ule lacking any 
2a70: 65 78 70 6c 69 63 69 74 20 53 51 4c 69 74 65 33  explicit SQLite3
2a80: 20 64 65 70 65 6e 64 65 6e 63 79 2e 3c 62 72 3e   dependency.<br>
2a90: 0d 0a 59 6f 75 27 6c 6c 20 6e 65 76 65 72 20 62  ..You'll never b
2aa0: 65 20 61 62 6c 65 20 74 6f 20 64 69 72 65 63 74  e able to direct
2ab0: 6c 79 20 6c 69 6e 6b 20 74 68 69 73 20 3c 62 3e  ly link this <b>
2ac0: 3c 69 3e 6d 6f 64 5f 73 70 61 74 69 61 6c 69 74  <i>mod_spatialit
2ad0: 65 3c 2f 69 3e 3c 2f 62 3e 20 73 68 61 72 65 64  e</i></b> shared
2ae0: 20 6c 69 62 72 61 72 79 20 66 6f 6c 6c 6f 77 69   library followi
2af0: 6e 67 20 74 68 65 20 63 6c 61 73 73 69 63 20 77  ng the classic w
2b00: 61 79 2c 20 62 65 63 61 75 73 65 20 69 74 20 64  ay, because it d
2b10: 6f 65 73 6e 27 74 20 64 65 63 6c 61 72 65 20 61  oesn't declare a
2b20: 6e 79 20 65 78 74 65 72 6e 61 6c 20 6c 69 6e 6b  ny external link
2b30: 20 73 79 6d 62 6f 6c 20 65 78 63 65 70 74 20 74   symbol except t
2b40: 68 61 74 20 61 20 73 69 6e 67 6c 65 20 6f 6e 65  hat a single one
2b50: 3a 20 69 2e 65 2e 20 74 68 65 20 63 6f 6e 76 65  : i.e. the conve
2b60: 6e 74 69 6f 6e 61 6c 20 69 6e 74 65 72 66 61 63  ntional interfac
2b70: 65 2e 0d 0a 54 68 65 20 75 6e 69 71 75 65 20 70  e...The unique p
2b80: 6f 73 73 69 62 6c 65 20 77 61 79 20 74 6f 20 6c  ossible way to l
2b90: 6f 61 64 20 61 6e 64 20 61 63 74 69 76 61 74 65  oad and activate
2ba0: 20 74 68 69 73 20 6d 6f 64 75 6c 65 20 69 73 20   this module is 
2bb0: 62 79 20 63 61 6c 6c 69 6e 67 20 61 20 3c 62 3e  by calling a <b>
2bc0: 53 45 4c 45 43 54 20 6c 6f 61 64 5f 65 78 74 65  SELECT load_exte
2bd0: 6e 73 69 6f 6e 3c 2f 62 3e 20 53 51 4c 20 73 74  nsion</b> SQL st
2be0: 61 74 65 6d 65 6e 74 2e 3c 2f 6c 69 3e 0d 0a 3c  atement.</li>..<
2bf0: 2f 75 6c 3e 3c 62 72 3e 0d 0a 3c 68 72 3e 3c 62  /ul><br>..<hr><b
2c00: 72 3e 0d 0a 62 61 63 6b 20 74 6f 20 3c 61 20 68  r>..back to <a h
2c10: 72 65 66 3d 22 68 74 74 70 73 3a 2f 2f 77 77 77  ref="https://www
2c20: 2e 67 61 69 61 2d 67 69 73 2e 69 74 2f 66 6f 73  .gaia-gis.it/fos
2c30: 73 69 6c 2f 6c 69 62 73 70 61 74 69 61 6c 69 74  sil/libspatialit
2c40: 65 2f 77 69 6b 69 3f 6e 61 6d 65 3d 34 2e 32 2e  e/wiki?name=4.2.
2c50: 30 2d 64 6f 63 22 3e 34 2e 32 2e 30 2d 64 6f 63  0-doc">4.2.0-doc
2c60: 3c 2f 61 3e 0a 5a 20 30 63 39 62 63 66 66 66 64  </a>.Z 0c9bcfffd
2c70: 34 31 30 35 38 65 33 32 35 33 36 64 35 36 33 35  41058e32536d5635
2c80: 66 65 36 30 39 63 63 0a                          fe609cc.