Hex Artifact Content
Not logged in

Artifact 62e5ac9f4c72ebba44437d5b2dbaf1d578070716:

Wiki page [mod_spatialite] by sandro 2015-07-01 08:21:13.
0000: 44 20 32 30 31 35 2d 30 37 2d 30 31 54 30 38 3a  D 2015-07-01T08:
0010: 32 31 3a 31 33 2e 35 38 31 0a 4c 20 6d 6f 64 5f  21:13.581.L mod_
0020: 73 70 61 74 69 61 6c 69 74 65 0a 50 20 37 31 63  spatialite.P 71c
0030: 35 33 63 66 66 33 38 38 38 32 65 38 36 65 35 38  53cff38882e86e58
0040: 65 39 35 33 66 39 31 63 64 34 36 32 30 64 39 34  e953f91cd4620d94
0050: 66 38 61 63 62 0a 55 20 73 61 6e 64 72 6f 0a 57  f8acb.U sandro.W
0060: 20 31 31 32 33 35 0a 3c 61 20 68 72 65 66 3d 22   11235.<a href="
0070: 68 74 74 70 73 3a 2f 2f 77 77 77 2e 67 61 69 61  https://www.gaia
0080: 2d 67 69 73 2e 69 74 2f 66 6f 73 73 69 6c 2f 6c  -gis.it/fossil/l
0090: 69 62 73 70 61 74 69 61 6c 69 74 65 2f 77 69 6b  ibspatialite/wik
00a0: 69 3f 6e 61 6d 65 3d 34 2e 33 2e 30 2b 64 6f 63  i?name=4.3.0+doc
00b0: 22 3e 62 61 63 6b 3c 2f 61 3e 0d 0a 3c 68 31 3e  ">back</a>..<h1>
00c0: 44 79 6e 61 6d 69 63 61 6c 6c 79 20 6c 6f 61 64  Dynamically load
00d0: 69 6e 67 20 53 70 61 74 69 61 4c 69 74 65 20 61  ing SpatiaLite a
00e0: 73 20 61 6e 20 3c 75 3e 3c 69 3e 65 78 74 65 6e  s an <u><i>exten
00f0: 73 69 6f 6e 20 6d 6f 64 75 6c 65 3c 2f 69 3e 3c  sion module</i><
0100: 2f 75 3e 3c 2f 68 31 3e 0d 0a 3c 68 33 3e 54 68  /u></h1>..<h3>Th
0110: 65 6f 72 65 74 69 63 61 6c 20 66 6f 75 6e 64 61  eoretical founda
0120: 74 69 6f 6e 73 3c 2f 68 33 3e 0d 0a 54 65 63 68  tions</h3>..Tech
0130: 6e 69 63 61 6c 6c 79 20 73 70 65 61 6b 69 6e 67  nically speaking
0140: 2c 20 53 70 61 74 69 61 4c 69 74 65 20 73 69 6d  , SpatiaLite sim
0150: 70 6c 79 20 69 73 20 61 6e 20 65 78 74 65 6e 73  ply is an extens
0160: 69 6f 6e 20 6d 6f 64 75 6c 65 20 61 64 64 69 6e  ion module addin
0170: 67 20 53 70 61 74 69 61 6c 20 70 72 6f 63 65 73  g Spatial proces
0180: 73 69 6e 67 20 63 61 70 61 62 69 6c 69 74 69 65  sing capabilitie
0190: 73 20 74 6f 20 53 51 4c 69 74 65 2e 3c 62 72 3e  s to SQLite.<br>
01a0: 0d 0a 43 6f 6e 73 65 71 75 65 6e 74 6c 79 20 73  ..Consequently s
01b0: 6f 6d 65 20 61 70 70 72 6f 70 72 69 61 74 65 20  ome appropriate 
01c0: 6d 65 63 68 61 6e 69 73 6d 20 61 6c 6c 6f 77 69  mechanism allowi
01d0: 6e 67 20 74 6f 20 6c 6f 61 64 20 62 6f 74 68 20  ng to load both 
01e0: 62 69 6e 61 72 79 20 6c 69 62 72 61 72 69 65 73  binary libraries
01f0: 20 28 3c 69 3e 6c 69 62 73 71 6c 69 74 65 33 3c   (<i>libsqlite3<
0200: 2f 69 3e 20 61 6e 64 20 3c 69 3e 6c 69 62 73 70  /i> and <i>libsp
0210: 61 74 69 61 6c 69 74 65 3c 2f 69 3e 29 20 74 68  atialite</i>) th
0220: 65 6e 20 70 72 6f 70 65 72 6c 79 20 72 65 67 69  en properly regi
0230: 73 74 65 72 69 6e 67 20 77 69 74 68 69 6e 20 53  stering within S
0240: 51 4c 69 74 65 33 20 74 68 65 20 6d 61 6e 79 20  QLite3 the many 
0250: 3c 62 3e 3c 69 3e 65 78 74 65 6e 64 65 64 20 53  <b><i>extended S
0260: 70 61 74 69 61 6c 20 53 51 4c 20 66 75 6e 63 74  patial SQL funct
0270: 69 6f 6e 73 3c 2f 69 3e 3c 2f 62 3e 20 69 6d 70  ions</i></b> imp
0280: 6c 65 6d 65 6e 74 65 64 20 62 79 20 53 70 61 74  lemented by Spat
0290: 69 61 4c 69 74 65 20 69 73 20 61 20 73 74 72 69  iaLite is a stri
02a0: 63 74 6c 79 20 72 65 71 75 69 72 65 64 20 74 61  ctly required ta
02b0: 73 6b 2e 3c 62 72 3e 0d 0a 41 20 66 75 72 74 68  sk.<br>..A furth
02c0: 65 72 20 63 6f 6d 70 6c 69 63 61 74 69 6f 6e 20  er complication 
02d0: 73 68 6f 75 6c 64 20 62 65 20 74 61 6b 65 6e 20  should be taken 
02e0: 69 6e 20 70 72 6f 70 65 72 20 64 65 62 74 3b 20  in proper debt; 
02f0: 3c 69 3e 6c 69 62 73 70 61 74 69 61 6c 69 74 65  <i>libspatialite
0300: 3c 2f 69 3e 20 69 73 6e 27 74 20 61 20 73 69 6d  </i> isn't a sim
0310: 70 6c 65 20 73 74 61 6e 64 2d 61 6c 6f 6e 65 20  ple stand-alone 
0320: 73 65 6c 66 2d 63 6f 6e 74 61 69 6e 65 64 20 6c  self-contained l
0330: 69 62 72 61 72 79 20 61 6e 64 20 64 65 70 65 6e  ibrary and depen
0340: 64 73 20 6f 6e 20 73 65 76 65 72 61 6c 20 66 75  ds on several fu
0350: 72 74 68 65 72 20 6c 69 62 72 61 72 69 65 73 20  rther libraries 
0360: 28 3c 69 3e 6c 69 62 67 65 6f 73 3c 2f 69 3e 2c  (<i>libgeos</i>,
0370: 20 3c 69 3e 6c 69 62 70 72 6f 6a 3c 2f 69 3e 2c   <i>libproj</i>,
0380: 20 3c 69 3e 6c 69 62 78 6d 6c 32 3c 2f 69 3e 20   <i>libxml2</i> 
0390: 61 6e 64 20 73 6f 20 6f 6e 29 2e 3c 62 72 3e 3c  and so on).<br><
03a0: 62 72 3e 0d 0a 54 68 65 72 65 20 61 72 65 20 73  br>..There are s
03b0: 65 76 65 72 61 6c 20 70 6f 73 73 69 62 6c 65 20  everal possible 
03c0: 61 6c 74 65 72 6e 61 74 69 76 65 20 70 61 74 68  alternative path
03d0: 73 20 6c 65 61 64 69 6e 67 20 74 6f 20 74 68 69  s leading to thi
03e0: 73 20 66 69 6e 61 6c 20 67 6f 61 6c 3a 0d 0a 3c  s final goal:..<
03f0: 75 6c 3e 0d 0a 3c 6c 69 3e 75 73 69 6e 67 20 3c  ul>..<li>using <
0400: 62 3e 3c 69 3e 73 74 61 74 69 63 20 6c 69 6e 6b  b><i>static link
0410: 61 67 65 3c 2f 69 3e 3c 2f 62 3e 3a 20 61 20 73  age</i></b>: a s
0420: 74 72 61 69 67 68 74 66 6f 72 77 61 72 64 20 73  traightforward s
0430: 6f 6c 75 74 69 6f 6e 20 61 76 6f 69 64 69 6e 67  olution avoiding
0440: 20 6d 61 6e 79 20 73 75 62 73 65 71 75 65 6e 74   many subsequent
0450: 20 68 65 61 64 61 63 68 65 73 20 72 65 6c 61 74   headaches relat
0460: 65 64 20 74 6f 20 69 6e 73 74 61 6c 6c 61 74 69  ed to installati
0470: 6f 6e 20 61 6e 64 20 72 75 6e 2d 74 69 6d 65 20  on and run-time 
0480: 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e 2e 3c 62  configuration.<b
0490: 72 3e 0d 0a 46 6f 6c 6c 6f 77 69 6e 67 20 74 68  r>..Following th
04a0: 69 73 20 61 70 70 72 6f 61 63 68 20 61 20 73 69  is approach a si
04b0: 6e 67 6c 65 20 6d 6f 6e 6f 6c 69 74 68 69 63 20  ngle monolithic 
04c0: 65 78 65 63 75 74 61 62 6c 65 20 69 6e 74 65 72  executable inter
04d0: 6e 61 6c 6c 79 20 63 6f 6e 74 61 69 6e 69 6e 67  nally containing
04e0: 20 61 6c 6c 20 72 65 71 75 69 72 65 64 20 62 69   all required bi
04f0: 6e 61 72 79 20 63 6f 64 65 20 77 69 6c 6c 20 62  nary code will b
0500: 65 20 63 72 65 61 74 65 64 20 61 74 20 62 75 69  e created at bui
0510: 6c 64 20 74 69 6d 65 3b 20 74 68 69 73 20 6d 6f  ld time; this mo
0520: 6e 6f 6c 69 74 68 69 63 20 65 78 65 63 75 74 61  nolithic executa
0530: 62 6c 65 20 77 69 6c 6c 20 63 6f 6e 73 65 71 75  ble will consequ
0540: 65 6e 74 6c 79 20 68 61 76 65 20 6e 6f 20 65 78  ently have no ex
0550: 74 65 72 6e 61 6c 20 64 65 70 65 6e 64 65 6e 63  ternal dependenc
0560: 69 65 73 20 61 74 20 61 6c 6c 2c 20 74 68 75 73  ies at all, thus
0570: 20 72 61 64 69 63 61 6c 6c 79 20 73 69 6d 70 6c   radically simpl
0580: 69 66 79 69 6e 67 20 61 6e 79 20 73 75 62 73 65  ifying any subse
0590: 71 75 65 6e 74 20 69 6e 73 74 61 6c 6c 61 74 69  quent installati
05a0: 6f 6e 20 74 61 73 6b 2e 3c 62 72 3e 0d 0a 53 75  on task.<br>..Su
05b0: 63 68 20 73 74 72 61 74 65 67 79 20 6e 69 63 65  ch strategy nice
05c0: 6c 79 20 77 6f 72 6b 73 20 69 6e 20 74 68 65 20  ly works in the 
05d0: 63 61 73 65 20 6f 66 20 73 74 61 6e 64 2d 61 6c  case of stand-al
05e0: 6f 6e 65 20 73 65 6c 66 2d 63 6f 6e 74 61 69 6e  one self-contain
05f0: 65 64 20 61 70 70 73 20 28 65 2e 67 2e 20 62 6f  ed apps (e.g. bo
0600: 74 68 20 3c 62 3e 73 70 61 74 69 61 6c 69 74 65  th <b>spatialite
0610: 2e 65 78 65 3c 2f 62 3e 20 61 6e 64 20 3c 62 3e  .exe</b> and <b>
0620: 73 70 61 74 69 61 6c 69 74 65 5f 67 75 69 2e 65  spatialite_gui.e
0630: 78 65 3c 2f 62 3e 20 57 69 6e 64 6f 77 73 20 62  xe</b> Windows b
0640: 69 6e 61 72 69 65 73 20 61 72 65 20 75 73 75 61  inaries are usua
0650: 6c 6c 79 20 62 75 69 6c 74 20 74 68 69 73 20 77  lly built this w
0660: 61 79 29 2e 3c 62 72 3e 0d 0a 55 6e 68 61 70 70  ay).<br>..Unhapp
0670: 69 6c 79 20 74 68 69 73 20 65 6c 65 6d 65 6e 74  ily this element
0680: 61 72 79 20 73 69 6d 70 6c 65 20 73 6f 6c 75 74  ary simple solut
0690: 69 6f 6e 20 64 6f 65 73 6e 27 74 20 66 69 74 20  ion doesn't fit 
06a0: 77 65 6c 6c 20 69 6e 20 4c 69 6e 75 78 20 61 6e  well in Linux an
06b0: 64 20 55 6e 69 78 2d 6c 69 6b 65 20 65 6e 76 69  d Unix-like envi
06c0: 72 6f 6e 6d 65 6e 74 73 3b 20 61 6e 64 20 65 76  ronments; and ev
06d0: 65 6e 20 77 6f 72 73 74 20 6f 66 74 65 6e 20 64  en worst often d
06e0: 69 72 65 63 74 6c 79 20 63 6f 6e 66 6c 69 63 74  irectly conflict
06f0: 73 20 77 69 74 68 20 74 68 65 20 69 6e 74 65 72  s with the inter
0700: 6e 61 6c 20 61 72 63 68 69 74 65 63 74 75 72 65  nal architecture
0710: 20 73 75 70 70 6f 72 74 65 64 20 62 79 20 6d 61   supported by ma
0720: 6e 79 20 6c 61 6e 67 75 61 67 65 20 63 6f 6e 6e  ny language conn
0730: 65 63 74 6f 72 73 20 6f 72 20 62 79 20 6f 74 68  ectors or by oth
0740: 65 72 20 63 6f 6d 70 6c 65 78 20 66 72 61 6d 65  er complex frame
0750: 77 6f 72 6b 73 20 28 61 73 20 65 2e 67 2e 20 69  works (as e.g. i
0760: 73 20 3c 62 3e 51 47 49 53 3c 2f 62 3e 29 2e 3c  s <b>QGIS</b>).<
0770: 2f 6c 69 3e 0d 0a 3c 6c 69 3e 75 73 69 6e 67 20  /li>..<li>using 
0780: 3c 62 3e 3c 69 3e 73 68 61 72 65 64 20 6c 69 62  <b><i>shared lib
0790: 72 61 72 69 65 73 3c 69 3e 3c 2f 62 3e 20 28 61  raries<i></b> (a
07a0: 6b 61 20 3c 62 3e 3c 69 3e 44 4c 4c 73 3c 2f 69  ka <b><i>DLLs</i
07b0: 3e 3c 2f 62 3e 20 6f 6e 20 57 69 6e 64 6f 77 73  ></b> on Windows
07c0: 29 2e 3c 62 72 3e 0d 0a 54 68 69 73 20 73 65 63  ).<br>..This sec
07d0: 6f 6e 64 20 61 70 70 72 6f 61 63 68 20 63 61 72  ond approach car
07e0: 65 66 75 6c 6c 79 20 61 76 6f 69 64 73 20 6c 69  efully avoids li
07f0: 6e 6b 69 6e 67 20 6f 6e 63 65 20 66 6f 72 20 61  nking once for a
0800: 6c 6c 20 61 20 6d 6f 6e 6f 6c 69 74 68 69 63 20  ll a monolithic 
0810: 65 78 65 63 75 74 61 62 6c 65 3b 20 61 74 20 74  executable; at t
0820: 68 65 20 6f 70 70 6f 73 69 74 65 2c 20 65 61 63  he opposite, eac
0830: 68 20 73 69 6e 67 6c 65 20 63 6f 64 65 20 63 6f  h single code co
0840: 6d 70 6f 6e 65 6e 74 20 77 69 6c 6c 20 62 65 20  mponent will be 
0850: 70 61 63 6b 61 67 65 64 20 61 73 20 61 6e 20 61  packaged as an a
0860: 75 74 6f 6e 6f 6d 6f 75 73 20 69 6e 64 69 76 69  utonomous indivi
0870: 64 75 61 6c 20 6d 65 6d 62 65 72 2c 20 61 6e 64  dual member, and
0880: 20 6f 6e 6c 79 20 61 74 20 72 75 6e 2d 74 69 6d   only at run-tim
0890: 65 20 61 6c 6c 20 63 6f 6d 70 6f 6e 65 6e 74 73  e all components
08a0: 20 77 69 6c 6c 20 62 65 20 66 69 6e 61 6c 6c 79   will be finally
08b0: 20 62 6f 75 6e 64 20 74 6f 67 65 74 68 65 72 2e   bound together.
08c0: 3c 62 72 3e 0d 0a 54 68 65 20 67 6f 6f 64 20 6e  <br>..The good n
08d0: 65 77 3a 20 66 6f 6c 6c 6f 77 69 6e 67 20 74 68  ew: following th
08e0: 69 73 20 61 70 70 72 6f 61 63 68 20 65 61 63 68  is approach each
08f0: 20 6c 69 62 72 61 72 79 2f 63 6f 6d 70 6f 6e 65   library/compone
0900: 6e 74 20 77 69 6c 6c 20 62 65 20 28 68 6f 70 65  nt will be (hope
0910: 66 75 6c 6c 79 29 20 69 6e 73 74 61 6c 6c 65 64  fully) installed
0920: 20 6f 6e 6c 79 20 6f 6e 63 65 20 6f 6e 20 74 68   only once on th
0930: 65 20 74 61 72 67 65 74 20 73 79 73 74 65 6d 2c  e target system,
0940: 20 61 6e 64 20 65 76 65 72 79 20 65 78 65 63 75   and every execu
0950: 74 61 62 6c 65 20 64 65 70 65 6e 64 69 6e 67 20  table depending 
0960: 6f 6e 20 74 68 61 74 20 6c 69 62 72 61 72 79 20  on that library 
0970: 77 69 6c 6c 20 6c 6f 61 64 20 65 78 61 63 74 6c  will load exactl
0980: 79 20 74 68 65 20 73 61 6d 65 20 62 69 6e 61 72  y the same binar
0990: 79 20 63 6f 64 65 20 74 68 75 73 20 67 72 61 6e  y code thus gran
09a0: 74 69 6e 67 20 61 20 72 6f 62 75 73 74 20 6f 76  ting a robust ov
09b0: 65 72 61 6c 6c 20 63 6f 6e 73 69 73 74 65 6e 63  erall consistenc
09c0: 79 2e 3c 62 72 3e 0d 0a 54 68 65 20 62 61 64 20  y.<br>..The bad 
09d0: 6e 65 77 3a 20 69 66 20 61 20 73 69 6e 67 6c 65  new: if a single
09e0: 20 72 65 71 75 69 72 65 64 20 63 6f 6d 70 6f 6e   required compon
09f0: 65 6e 74 20 63 6f 75 6c 64 6e 27 74 20 62 65 20  ent couldn't be 
0a00: 6c 6f 61 64 65 64 20 61 74 20 72 75 6e 2d 74 69  loaded at run-ti
0a10: 6d 65 20 28 66 6f 72 20 61 6e 79 20 70 6f 73 73  me (for any poss
0a20: 69 62 6c 65 20 72 65 61 73 6f 6e 29 20 74 68 65  ible reason) the
0a30: 20 65 78 65 63 75 74 61 62 6c 65 20 61 73 20 61   executable as a
0a40: 20 77 68 6f 6c 65 20 77 69 6c 6c 20 66 61 69 6c   whole will fail
0a50: 20 74 6f 20 72 75 6e 2e 3c 62 72 3e 0d 0a 54 6f   to run.<br>..To
0a60: 20 6d 61 6b 65 20 74 68 69 6e 67 73 20 65 76 65   make things eve
0a70: 6e 20 77 6f 72 73 74 2c 20 74 68 69 73 20 73 63  n worst, this sc
0a80: 68 65 6d 61 20 77 6f 72 6b 73 20 6e 69 63 65 6c  hema works nicel
0a90: 79 20 6f 6e 20 4c 69 6e 75 78 2c 20 55 6e 69 78  y on Linux, Unix
0aa0: 20 61 6e 64 20 4d 61 63 20 4f 53 20 58 3b 20 62   and Mac OS X; b
0ab0: 75 74 20 6f 6e 20 57 69 6e 64 6f 77 73 20 69 74  ut on Windows it
0ac0: 27 73 20 70 6c 61 67 75 65 64 20 62 79 20 6d 61  's plagued by ma
0ad0: 6e 79 20 73 65 72 69 6f 75 73 20 69 73 73 75 65  ny serious issue
0ae0: 73 20 28 74 68 65 20 69 6e 66 61 6d 6f 75 73 20  s (the infamous 
0af0: 3c 62 3e 3c 69 3e 44 4c 4c 20 68 65 6c 6c 3c 2f  <b><i>DLL hell</
0b00: 69 3e 3c 2f 62 3e 29 2e 3c 2f 6c 69 3e 0d 0a 3c  i></b>).</li>..<
0b10: 6c 69 3e 75 73 69 6e 67 20 3c 62 3e 3c 69 3e 64  li>using <b><i>d
0b20: 79 6e 61 6d 69 63 20 6c 6f 61 64 69 6e 67 3c 2f  ynamic loading</
0b30: 69 3e 3c 2f 62 3e 20 61 6b 61 20 3c 62 3e 3c 69  i></b> aka <b><i
0b40: 3e 6c 61 74 65 20 62 69 6e 64 69 6e 67 3c 2f 69  >late binding</i
0b50: 3e 3c 2f 62 3e 20 28 77 68 69 63 68 20 68 61 73  ></b> (which has
0b60: 6e 27 74 20 74 6f 20 62 65 20 63 6f 6e 66 75 73  n't to be confus
0b70: 65 64 20 77 69 74 68 20 73 69 6d 70 6c 79 20 75  ed with simply u
0b80: 73 69 6e 67 20 73 68 61 72 65 64 20 6c 69 62 72  sing shared libr
0b90: 61 72 69 65 73 29 2e 3c 62 72 3e 0d 0a 46 6f 6c  aries).<br>..Fol
0ba0: 6c 6f 77 69 6e 67 20 74 68 69 73 20 74 68 69 72  lowing this thir
0bb0: 64 20 61 70 70 72 6f 61 63 68 20 61 6e 20 65 78  d approach an ex
0bc0: 74 65 6e 73 69 6f 6e 20 6d 6f 64 75 6c 65 20 63  tension module c
0bd0: 6f 75 6c 64 20 62 65 20 73 65 6c 65 63 74 69 76  ould be selectiv
0be0: 65 6c 79 20 6c 6f 61 64 65 64 20 6f 72 20 6e 6f  ely loaded or no
0bf0: 74 20 61 6e 64 20 74 68 65 20 61 63 74 75 61 6c  t and the actual
0c00: 20 61 63 74 69 6f 6e 20 77 69 6c 6c 20 62 65 20   action will be 
0c10: 61 63 74 69 76 61 74 65 64 20 6f 6e 6c 79 20 61  activated only a
0c20: 74 20 72 75 6e 2d 74 69 6d 65 20 64 65 70 65 6e  t run-time depen
0c30: 64 69 6e 67 20 6f 6e 20 73 6f 6d 65 20 72 65 71  ding on some req
0c40: 75 65 73 74 20 65 76 65 6e 74 2e 0d 0a 49 66 20  uest event...If 
0c50: 66 6f 72 20 61 6e 79 20 72 65 61 73 6f 6e 20 74  for any reason t
0c60: 68 65 20 6d 61 69 6e 20 65 78 65 63 75 74 61 62  he main executab
0c70: 6c 65 20 66 61 69 6c 73 20 74 6f 20 6c 6f 61 64  le fails to load
0c80: 20 61 6e 20 65 76 65 6e 74 75 61 6c 20 65 78 74   an eventual ext
0c90: 65 6e 73 69 6f 6e 20 6d 6f 64 75 6c 65 2c 20 69  ension module, i
0ca0: 74 20 77 69 6c 6c 20 73 74 69 6c 6c 20 63 6f 6e  t will still con
0cb0: 74 69 6e 75 65 20 74 6f 20 77 6f 72 6b 20 62 79  tinue to work by
0cc0: 20 73 69 6d 70 6c 79 20 69 67 6e 6f 72 69 6e 67   simply ignoring
0cd0: 20 65 76 65 72 79 20 6f 70 74 69 6f 6e 61 6c 20   every optional 
0ce0: 66 65 61 74 75 72 65 20 72 65 71 75 69 72 69 6e  feature requirin
0cf0: 67 20 74 68 65 20 66 61 69 6c 69 6e 67 20 6d 6f  g the failing mo
0d00: 64 75 6c 65 2e 0d 0a 41 73 20 61 20 64 69 72 65  dule...As a dire
0d10: 63 74 20 63 6f 6e 73 65 71 75 65 6e 63 65 2c 20  ct consequence, 
0d20: 61 6e 20 65 78 65 63 75 74 61 62 6c 65 20 62 75  an executable bu
0d30: 69 6c 74 20 74 68 69 73 20 77 61 79 20 63 61 6e  ilt this way can
0d40: 20 74 68 65 6f 72 65 74 69 63 61 6c 6c 79 20 67   theoretically g
0d50: 72 6f 77 74 68 20 74 6f 20 74 68 65 20 69 6e 66  rowth to the inf
0d60: 69 6e 69 74 65 20 69 6e 20 61 20 68 69 67 68 6c  inite in a highl
0d70: 79 20 64 79 6e 61 6d 69 63 20 66 61 73 68 69 6f  y dynamic fashio
0d80: 6e 3b 20 74 68 69 73 20 63 6f 72 72 65 73 70 6f  n; this correspo
0d90: 6e 64 73 20 74 6f 20 61 20 73 6f 20 63 61 6c 6c  nds to a so call
0da0: 65 64 20 3c 62 3e 3c 69 3e 70 6c 75 67 2d 69 6e  ed <b><i>plug-in
0db0: 3c 2f 69 3e 3c 2f 62 3e 20 61 72 63 68 69 74 65  </i></b> archite
0dc0: 63 74 75 72 65 2e 3c 62 72 3e 0d 0a 48 61 70 70  cture.<br>..Happ
0dd0: 69 6c 79 20 65 6e 6f 75 67 68 20 53 51 4c 69 74  ily enough SQLit
0de0: 65 33 20 66 75 6c 6c 79 20 73 75 70 70 6f 72 74  e3 fully support
0df0: 73 20 74 68 69 73 20 6d 6f 72 65 20 61 64 76 61  s this more adva
0e00: 6e 63 65 64 20 6d 65 63 68 61 6e 69 73 6d 3b 20  nced mechanism; 
0e10: 61 6e 64 20 74 68 69 73 20 6f 70 74 69 6f 6e 20  and this option 
0e20: 69 73 20 77 69 64 65 6c 79 20 73 75 70 70 6f 72  is widely suppor
0e30: 74 65 64 20 62 79 20 6d 61 6e 79 20 6c 61 6e 67  ted by many lang
0e40: 75 61 67 65 20 63 6f 6e 6e 65 63 74 6f 72 73 20  uage connectors 
0e50: 28 3c 69 3e 50 79 74 68 6f 6e 3c 2f 69 3e 2c 20  (<i>Python</i>, 
0e60: 3c 69 3e 4a 61 76 61 2f 4a 44 42 43 3c 2f 69 3e  <i>Java/JDBC</i>
0e70: 2c 20 3c 69 3e 50 48 50 3c 2f 69 3e 2c 20 3c 69  , <i>PHP</i>, <i
0e80: 3e 43 23 20 2e 4e 45 54 3c 2f 69 3e 20 61 6e 64  >C# .NET</i> and
0e90: 20 6f 74 68 65 72 73 29 2e 3c 2f 6c 69 3e 0d 0a   others).</li>..
0ea0: 3c 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e 3c 62 72 3e  </li>..</ul><br>
0eb0: 0d 0a 53 69 6c 6c 79 20 6f 64 64 69 74 69 65 73  ..Silly oddities
0ec0: 20 28 74 6f 20 62 65 20 63 61 72 65 66 75 6c 6c   (to be carefull
0ed0: 79 20 61 76 6f 69 64 65 64 29 3a 0d 0a 3c 75 6c  y avoided):..<ul
0ee0: 3e 0d 0a 3c 6c 69 3e 6e 6f 74 68 69 6e 67 20 66  >..<li>nothing f
0ef0: 6f 72 62 69 64 73 20 74 6f 20 63 72 65 61 74 65  orbids to create
0f00: 20 68 79 62 72 69 64 20 63 6f 6e 66 69 67 75 72   hybrid configur
0f10: 61 74 69 6f 6e 73 2c 20 65 2e 67 2e 20 61 64 6f  ations, e.g. ado
0f20: 70 74 69 6e 67 20 61 20 6d 69 78 20 6f 66 20 62  pting a mix of b
0f30: 6f 74 68 20 73 74 61 74 69 63 20 61 6e 64 20 64  oth static and d
0f40: 79 6e 61 6d 69 63 20 6c 69 6e 6b 61 67 65 2e 3c  ynamic linkage.<
0f50: 2f 6c 69 3e 0d 0a 3c 6c 69 3e 73 75 63 68 20 61  /li>..<li>such a
0f60: 20 73 6f 6c 75 74 69 6f 6e 20 63 6f 75 6c 64 20   solution could 
0f70: 65 61 73 69 6c 79 20 61 70 70 65 61 6c 20 6e 61  easily appeal na
0f80: 69 76 65 20 70 61 63 6b 61 67 65 72 73 2c 20 62  ive packagers, b
0f90: 65 63 61 75 73 65 20 69 74 20 61 70 70 61 72 65  ecause it appare
0fa0: 6e 74 6c 79 20 61 6c 6c 6f 77 73 20 74 6f 20 73  ntly allows to s
0fb0: 69 6d 70 6c 69 66 79 20 69 6e 73 74 61 6c 6c 61  implify installa
0fc0: 74 69 6f 6e 20 61 6e 64 20 63 6f 6e 66 69 67 75  tion and configu
0fd0: 72 61 74 69 6f 6e 20 74 61 73 6b 2e 3c 2f 6c 69  ration task.</li
0fe0: 3e 0d 0a 3c 6c 69 3e 61 6e 79 77 61 79 20 74 68  >..<li>anyway th
0ff0: 69 73 20 69 73 20 6f 66 74 65 6e 20 61 20 64 61  is is often a da
1000: 6e 67 65 72 6f 75 73 20 70 69 74 66 61 6c 6c 2c  ngerous pitfall,
1010: 20 73 69 6d 70 6c 79 20 6c 65 61 64 69 6e 67 20   simply leading 
1020: 74 6f 20 70 6f 74 65 6e 74 69 61 6c 6c 79 20 75  to potentially u
1030: 6e 73 74 61 62 6c 65 20 61 6e 64 20 73 65 6c 66  nstable and self
1040: 2d 63 6f 6e 66 6c 69 63 74 69 6e 67 20 63 6f 6e  -conflicting con
1050: 66 69 67 75 72 61 74 69 6f 6e 73 3a 20 69 74 27  figurations: it'
1060: 73 20 74 68 65 20 73 6f 20 63 61 6c 6c 65 64 20  s the so called 
1070: 3c 62 3e 3c 69 3e 63 6f 62 72 61 20 65 66 66 65  <b><i>cobra effe
1080: 63 74 3c 2f 69 3e 3c 2f 62 3e 20 28 69 2e 65 2e  ct</i></b> (i.e.
1090: 20 77 68 65 6e 20 61 6e 20 61 74 74 65 6d 70 74   when an attempt
10a0: 65 64 20 73 6f 6c 75 74 69 6f 6e 20 74 6f 20 61  ed solution to a
10b0: 20 70 72 6f 62 6c 65 6d 20 61 63 74 75 61 6c 6c   problem actuall
10c0: 79 20 6d 61 6b 65 73 20 74 68 65 20 70 72 6f 62  y makes the prob
10d0: 6c 65 6d 20 77 6f 72 73 65 29 2e 3c 2f 6c 69 3e  lem worse).</li>
10e0: 0d 0a 3c 6c 69 3e 3c 62 3e 3c 75 3e 47 6f 6c 64  ..<li><b><u>Gold
10f0: 65 6e 20 72 75 6c 65 3c 2f 75 3e 3c 2f 62 3e 3a  en rule</u></b>:
1100: 20 6e 65 76 65 72 20 61 74 74 65 6d 70 74 20 74   never attempt t
1110: 6f 20 69 6e 74 72 6f 64 75 63 65 20 73 74 61 74  o introduce stat
1120: 69 63 61 6c 6c 79 20 6c 69 6e 6b 65 64 20 6c 69  ically linked li
1130: 62 72 61 72 69 65 73 20 69 6e 20 61 20 63 6f 6e  braries in a con
1140: 66 69 67 75 72 61 74 69 6f 6e 20 77 69 64 65 6c  figuration widel
1150: 79 20 62 61 73 65 64 20 6f 6e 20 73 68 61 72 65  y based on share
1160: 64 20 6c 69 62 72 61 72 69 65 73 2e 20 54 68 69  d libraries. Thi
1170: 73 20 6f 6e 65 20 69 73 6e 27 74 20 61 20 63 6c  s one isn't a cl
1180: 65 76 65 72 20 73 6f 6c 75 74 69 6f 6e 2c 20 61  ever solution, a
1190: 6e 64 20 77 69 6c 6c 20 73 69 6d 70 6c 79 20 69  nd will simply i
11a0: 6e 74 72 6f 64 75 63 65 20 6d 61 6e 79 20 66 75  ntroduce many fu
11b0: 72 74 68 65 72 20 75 6e 65 78 70 65 63 74 65 64  rther unexpected
11c0: 20 63 6f 6d 70 6c 69 63 61 74 69 6f 6e 73 2e 3c   complications.<
11d0: 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e 3c 62 72 3e 0d  /li>..</ul><br>.
11e0: 0a 3c 68 33 3e 44 79 6e 61 6d 69 63 20 6c 6f 61  .<h3>Dynamic loa
11f0: 64 69 6e 67 3a 20 68 6f 77 20 69 74 20 77 6f 72  ding: how it wor
1200: 6b 73 3c 2f 68 33 3e 0d 0a 3c 69 3e 6c 69 62 73  ks</h3>..<i>libs
1210: 71 6c 69 74 65 33 3c 2f 69 3e 20 68 61 73 20 74  qlite3</i> has t
1220: 68 65 20 63 61 70 61 62 69 6c 69 74 79 20 74 6f  he capability to
1230: 20 64 79 6e 61 6d 69 63 61 6c 6c 79 20 6c 6f 61   dynamically loa
1240: 64 20 65 78 74 65 6e 73 69 6f 6e 20 6d 6f 64 75  d extension modu
1250: 6c 65 73 2e 20 54 68 69 73 20 66 65 61 74 75 72  les. This featur
1260: 65 20 69 73 20 61 76 61 69 6c 61 62 6c 65 20 61  e is available a
1270: 73 20 61 20 43 2d 6c 61 6e 67 75 61 67 65 20 41  s a C-language A
1280: 50 49 2c 20 62 75 74 20 69 73 20 61 76 61 69 6c  PI, but is avail
1290: 61 62 6c 65 20 61 73 20 61 20 3c 69 3e 73 70 65  able as a <i>spe
12a0: 63 69 61 6c 3c 2f 69 3e 20 53 51 4c 20 66 75 6e  cial</i> SQL fun
12b0: 63 74 69 6f 6e 20 61 73 20 77 65 6c 6c 3a 0d 0a  ction as well:..
12c0: 3c 76 65 72 62 61 74 69 6d 3e 0d 0a 53 45 4c 45  <verbatim>..SELE
12d0: 43 54 20 6c 6f 61 64 5f 65 78 74 65 6e 73 69 6f  CT load_extensio
12e0: 6e 28 27 6d 6f 64 5f 73 70 61 74 69 61 6c 69 74  n('mod_spatialit
12f0: 65 27 29 3b 0d 0a 3c 2f 76 65 72 62 61 74 69 6d  e');..</verbatim
1300: 3e 0d 0a 54 68 69 73 20 53 51 4c 20 66 75 6e 63  >..This SQL func
1310: 74 69 6f 6e 20 6d 61 6b 65 20 65 6c 65 6d 65 6e  tion make elemen
1320: 74 61 72 79 20 73 69 6d 70 6c 65 20 28 61 6e 64  tary simple (and
1330: 20 61 62 73 6f 6c 75 74 65 6c 79 20 6c 61 6e 67   absolutely lang
1340: 75 61 67 65 20 69 6e 64 65 70 65 6e 64 65 6e 74  uage independent
1350: 29 20 74 68 65 20 70 72 6f 62 6c 65 6d 20 6f 66  ) the problem of
1360: 20 6c 6f 61 64 69 6e 67 20 61 6e 79 20 70 6f 73   loading any pos
1370: 73 69 62 6c 65 20 65 78 74 65 6e 73 69 6f 6e 3b  sible extension;
1380: 20 79 6f 75 20 61 72 65 20 73 69 6d 70 6c 79 20   you are simply 
1390: 65 78 70 65 63 74 65 64 20 74 6f 20 65 78 65 63  expected to exec
13a0: 75 74 65 20 61 20 72 61 74 68 65 72 20 74 72 69  ute a rather tri
13b0: 76 69 61 6c 20 53 51 4c 20 73 74 61 74 65 6d 65  vial SQL stateme
13c0: 6e 74 20 69 6e 20 6f 72 64 65 72 20 74 6f 20 6c  nt in order to l
13d0: 6f 61 64 20 61 6e 20 65 78 74 65 72 6e 61 6c 20  oad an external 
13e0: 65 78 74 65 6e 73 69 6f 6e 20 6f 6e 6c 79 20 77  extension only w
13f0: 68 65 6e 20 69 74 27 73 20 61 63 74 75 61 6c 6c  hen it's actuall
1400: 79 20 72 65 71 75 69 72 65 64 2e 3c 62 72 3e 3c  y required.<br><
1410: 62 72 3e 0d 0a 4c 6f 61 64 61 62 6c 65 20 65 78  br>..Loadable ex
1420: 74 65 6e 73 69 6f 6e 20 61 6e 61 74 6f 6d 79 3a  tension anatomy:
1430: 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e 61 6e 79 20  ..<ul>..<li>any 
1440: 53 51 4c 69 74 65 27 73 20 65 78 74 65 6e 73 69  SQLite's extensi
1450: 6f 6e 20 6d 6f 64 75 6c 65 20 69 73 20 65 78 70  on module is exp
1460: 65 63 74 65 64 20 74 6f 20 64 65 63 6c 61 72 65  ected to declare
1470: 20 61 20 77 65 6c 6c 20 6b 6e 6f 77 6e 20 63 6f   a well known co
1480: 6e 76 65 6e 74 69 6f 6e 61 6c 20 69 6e 74 65 72  nventional inter
1490: 66 61 63 65 2e 0d 0a 45 78 63 65 70 74 20 66 6f  face...Except fo
14a0: 72 20 74 68 69 73 2c 20 61 6e 79 20 53 51 4c 69  r this, any SQLi
14b0: 74 65 27 73 20 6f 77 6e 20 65 78 74 65 6e 73 69  te's own extensi
14c0: 6f 6e 20 73 69 6d 70 6c 79 20 69 73 20 61 6e 20  on simply is an 
14d0: 6f 72 64 69 6e 61 72 79 20 73 68 61 72 65 64 20  ordinary shared 
14e0: 6c 69 62 72 61 72 79 20 28 6f 72 20 44 4c 4c 29  library (or DLL)
14f0: 20 61 73 20 61 6e 79 20 6f 74 68 65 72 2e 3c 2f   as any other.</
1500: 6c 69 3e 0d 0a 3c 6c 69 3e 61 20 72 65 61 6c 20  li>..<li>a real 
1510: 65 78 74 65 6e 73 69 6f 6e 20 6d 6f 64 75 6c 65  extension module
1520: 20 77 69 6c 6c 20 6e 65 76 65 72 20 65 78 70 6c   will never expl
1530: 69 63 69 74 6c 79 20 64 65 70 65 6e 64 20 6f 6e  icitly depend on
1540: 20 53 51 4c 69 74 65 33 2c 20 62 65 63 61 75 73   SQLite3, becaus
1550: 65 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20  e the following 
1560: 61 63 74 69 6f 6e 73 20 77 69 6c 6c 20 62 65 20  actions will be 
1570: 61 75 74 6f 6d 61 74 69 63 61 6c 6c 79 20 74 61  automatically ta
1580: 6b 65 6e 20 62 79 20 53 51 4c 69 74 65 33 20 77  ken by SQLite3 w
1590: 68 65 6e 20 6c 6f 61 64 69 6e 67 3a 0d 0a 3c 75  hen loading:..<u
15a0: 6c 3e 0d 0a 3c 6c 69 3e 61 6c 6c 20 53 51 4c 20  l>..<li>all SQL 
15b0: 66 75 6e 63 74 69 6f 6e 73 20 64 65 66 69 6e 65  functions define
15c0: 64 2f 73 75 70 70 6f 72 74 65 64 20 62 79 20 74  d/supported by t
15d0: 68 65 20 65 78 74 65 6e 73 69 6f 6e 20 77 69 6c  he extension wil
15e0: 6c 20 62 65 20 61 64 64 65 64 20 74 6f 20 74 68  l be added to th
15f0: 65 20 73 74 61 6e 64 61 72 64 20 6c 69 73 74 3b  e standard list;
1600: 20 61 6e 64 20 65 76 65 6e 74 75 61 6c 6c 79 20   and eventually 
1610: 61 6e 20 65 78 74 65 6e 73 69 6f 6e 20 63 6f 75  an extension cou
1620: 6c 64 20 65 76 65 72 20 6f 76 65 72 6c 6f 61 64  ld ever overload
1630: 20 61 6e 79 20 70 72 65 2d 64 65 66 69 6e 65 64   any pre-defined
1640: 20 53 51 4c 20 66 75 6e 63 74 69 6f 6e 20 64 69   SQL function di
1650: 72 65 63 74 6c 79 20 64 65 66 69 6e 65 64 20 62  rectly defined b
1660: 79 20 53 51 4c 69 74 65 33 20 69 74 73 65 6c 66  y SQLite3 itself
1670: 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 74 68 61 74  .</li>..<li>that
1680: 27 73 20 6e 6f 74 20 61 6c 6c 3b 20 53 51 4c 69  's not all; SQLi
1690: 74 65 33 20 77 69 6c 6c 20 69 6d 70 6c 69 63 69  te3 will implici
16a0: 74 6c 79 20 70 61 73 73 20 74 6f 20 74 68 65 20  tly pass to the 
16b0: 65 78 74 65 6e 73 69 6f 6e 20 61 20 3c 69 3e 3c  extension a <i><
16c0: 75 3e 6d 69 72 72 6f 72 20 63 6f 70 79 3c 2f 75  u>mirror copy</u
16d0: 3e 3c 2f 69 3e 20 6f 66 20 69 74 73 20 6f 77 6e  ></i> of its own
16e0: 20 41 50 49 73 3a 20 74 68 69 73 20 77 69 6c 6c   APIs: this will
16f0: 20 65 6e 73 75 72 65 20 74 68 61 74 20 65 78 61   ensure that exa
1700: 63 74 6c 79 20 74 68 65 20 73 61 6d 65 20 63 6f  ctly the same co
1710: 64 65 20 77 69 6c 6c 20 73 75 70 70 6f 72 74 20  de will support 
1720: 62 6f 74 68 20 74 68 65 20 53 51 4c 69 74 65 27  both the SQLite'
1730: 73 20 6f 77 6e 20 63 6f 72 65 20 61 6e 64 20 74  s own core and t
1740: 68 65 20 65 78 74 65 6e 73 69 6f 6e 2c 20 61 6e  he extension, an
1750: 64 20 77 69 6c 6c 20 65 66 66 65 63 74 69 76 65  d will effective
1760: 6c 79 20 61 76 6f 69 64 20 61 6e 79 20 70 6f 73  ly avoid any pos
1770: 73 69 62 6c 65 20 63 6f 6e 66 6c 69 63 74 20 62  sible conflict b
1780: 65 74 77 65 65 6e 20 74 68 65 6d 2e 3c 2f 6c 69  etween them.</li
1790: 3e 20 0d 0a 3c 2f 75 6c 3e 3c 2f 6c 69 3e 0d 0a  > ..</ul></li>..
17a0: 3c 6c 69 3e 73 74 61 72 74 69 6e 67 20 73 69 6e  <li>starting sin
17b0: 63 65 20 53 51 4c 69 74 65 20 76 65 72 73 69 6f  ce SQLite versio
17c0: 6e 20 33 2e 37 2e 31 37 20 28 72 65 6c 65 61 73  n 3.7.17 (releas
17d0: 65 64 20 6f 6e 20 32 30 31 33 2d 30 35 2d 32 30  ed on 2013-05-20
17e0: 29 20 74 68 65 20 6c 6f 61 64 61 62 6c 65 20 65  ) the loadable e
17f0: 78 74 65 6e 73 69 6f 6e 20 6d 65 63 68 61 6e 69  xtension mechani
1800: 73 6d 20 77 61 73 20 73 69 67 6e 69 66 69 63 61  sm was significa
1810: 6e 74 6c 79 20 65 6e 68 61 6e 63 65 64 3a 3c 75  ntly enhanced:<u
1820: 6c 3e 0d 0a 3c 6c 69 3e 61 6e 79 20 65 78 74 65  l>..<li>any exte
1830: 6e 73 69 6f 6e 20 6d 6f 64 75 6c 65 20 69 73 20  nsion module is 
1840: 6e 6f 77 20 65 78 70 65 63 74 65 64 20 74 6f 20  now expected to 
1850: 64 65 63 6c 61 72 65 20 69 74 73 20 6f 77 6e 20  declare its own 
1860: 69 6e 64 69 76 69 64 75 61 6c 20 65 6e 74 72 79  individual entry
1870: 20 70 6f 69 6e 74 20 64 69 72 65 63 74 6c 79 20   point directly 
1880: 72 65 6c 61 74 65 64 20 74 6f 20 74 68 65 20 6e  related to the n
1890: 61 6d 65 20 6f 66 20 74 68 65 20 65 78 74 65 6e  ame of the exten
18a0: 73 69 6f 6e 3b 20 74 68 69 73 20 6d 61 6b 65 20  sion; this make 
18b0: 73 69 6d 70 6c 65 72 20 6c 6f 61 64 69 6e 67 20  simpler loading 
18c0: 6d 6f 72 65 20 6d 6f 64 75 6c 65 73 20 61 74 20  more modules at 
18d0: 74 68 65 20 73 61 6d 65 20 74 69 6d 65 2e 3c 2f  the same time.</
18e0: 6c 69 3e 0d 0a 3c 6c 69 3e 6a 75 73 74 20 74 68  li>..<li>just th
18f0: 65 20 3c 62 3e 3c 69 3e 62 61 73 65 20 6e 61 6d  e <b><i>base nam
1900: 65 3c 2f 69 3e 3c 2f 62 3e 20 6f 66 20 74 68 65  e</i></b> of the
1910: 20 6d 6f 64 75 6c 65 20 69 73 20 65 78 70 65 63   module is expec
1920: 74 65 64 20 74 6f 20 62 65 20 73 70 65 63 69 66  ted to be specif
1930: 69 65 64 3b 20 61 6e 79 20 65 76 65 6e 74 75 61  ied; any eventua
1940: 6c 20 3c 62 3e 3c 69 3e 73 75 66 66 69 78 3c 2f  l <b><i>suffix</
1950: 69 3e 3c 2f 62 3e 20 28 61 73 20 65 2e 67 2e 20  i></b> (as e.g. 
1960: 3c 69 3e 2e 73 6f 3c 2f 69 3e 20 6f 72 20 3c 69  <i>.so</i> or <i
1970: 3e 2e 64 6c 6c 3c 2f 69 3e 29 20 77 69 6c 6c 20  >.dll</i>) will 
1980: 62 65 20 61 75 74 6f 6d 61 74 69 63 61 6c 6c 79  be automatically
1990: 20 61 64 64 65 64 20 62 79 20 53 51 4c 69 74 65   added by SQLite
19a0: 20 69 74 73 65 6c 66 20 61 63 63 6f 72 64 69 6e   itself accordin
19b0: 67 6c 79 20 74 6f 20 74 68 65 20 73 70 65 63 69  gly to the speci
19c0: 66 69 63 20 74 61 72 67 65 74 20 73 79 73 74 65  fic target syste
19d0: 6d 20 65 78 70 65 63 74 61 74 69 6f 6e 73 3a 20  m expectations: 
19e0: 74 68 69 73 20 61 6c 6c 6f 77 73 20 66 6f 72 20  this allows for 
19f0: 61 6e 20 65 61 73 69 65 72 20 63 72 6f 73 73 2d  an easier cross-
1a00: 70 6c 61 74 66 6f 72 6d 20 70 6f 72 74 61 62 69  platform portabi
1a10: 6c 69 74 79 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e  lity.</li>..<li>
1a20: 61 6e 79 20 65 78 74 65 6e 73 69 6f 6e 20 6d 6f  any extension mo
1a30: 64 75 6c 65 20 61 64 6f 70 74 69 6e 67 20 74 68  dule adopting th
1a40: 65 20 6d 6f 72 65 20 72 65 63 65 6e 74 20 63 6f  e more recent co
1a50: 6e 76 65 6e 74 69 6f 6e 73 20 63 6f 75 6c 64 20  nventions could 
1a60: 62 65 20 65 76 65 6e 74 75 61 6c 6c 79 20 62 65  be eventually be
1a70: 20 6c 6f 61 64 65 64 20 65 76 65 6e 20 77 68 65   loaded even whe
1a80: 6e 20 75 73 69 6e 67 20 73 6f 6d 65 20 6f 62 73  n using some obs
1a90: 6f 6c 65 74 65 20 76 65 72 73 69 6f 6e 20 28 3c  olete version (<
1aa0: 20 33 2e 37 2e 31 37 29 2c 20 62 75 74 20 69 6e   3.7.17), but in
1ab0: 20 74 68 69 73 20 63 61 73 65 20 73 61 6d 65 20   this case same 
1ac0: 73 70 65 63 69 61 6c 20 61 63 74 69 6f 6e 73 20  special actions 
1ad0: 61 72 65 20 72 65 71 75 69 72 65 64 2e 0d 0a 50  are required...P
1ae0: 6c 65 61 73 65 20 63 6f 6e 73 75 6c 74 20 74 68  lease consult th
1af0: 65 20 53 51 4c 69 74 65 27 73 20 6f 77 6e 20 3c  e SQLite's own <
1b00: 61 20 68 72 65 66 3d 22 68 74 74 70 3a 2f 2f 77  a href="http://w
1b10: 77 77 2e 73 71 6c 69 74 65 2e 6f 72 67 2f 6c 6f  ww.sqlite.org/lo
1b20: 61 64 65 78 74 2e 68 74 6d 6c 22 3e 64 6f 63 75  adext.html">docu
1b30: 6d 65 6e 74 61 74 69 6f 6e 3c 2f 61 3e 20 66 6f  mentation</a> fo
1b40: 72 20 6d 6f 72 65 20 64 65 74 61 69 6c 73 2e 3c  r more details.<
1b50: 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e 3c 2f 6c 69 3e  /li>..</ul></li>
1b60: 0d 0a 3c 2f 75 6c 3e 0d 0a 3c 62 72 3e 0d 0a 43  ..</ul>..<br>..C
1b70: 6f 6d 6d 6f 6e 20 66 61 69 6c 75 72 65 20 63 61  ommon failure ca
1b80: 75 73 65 73 3a 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69  uses:..<ul>..<li
1b90: 3e 69 66 20 74 68 65 20 65 78 70 65 63 74 65 64  >if the expected
1ba0: 20 63 6f 6e 76 65 6e 74 69 6f 6e 61 6c 20 69 6e   conventional in
1bb0: 74 65 72 66 61 63 65 20 69 73 6e 27 74 20 63 6f  terface isn't co
1bc0: 72 72 65 63 74 6c 79 20 64 65 63 6c 61 72 65 64  rrectly declared
1bd0: 20 62 79 20 74 68 65 20 73 68 61 72 65 64 20 6c   by the shared l
1be0: 69 62 72 61 72 79 20 62 65 69 6e 67 20 6c 6f 61  ibrary being loa
1bf0: 64 65 64 2c 20 74 68 65 6e 20 53 51 4c 69 74 65  ded, then SQLite
1c00: 33 20 77 69 6c 6c 20 73 69 6d 70 6c 79 20 61 73  3 will simply as
1c10: 73 75 6d 65 20 74 68 61 74 20 69 74 27 73 20 6e  sume that it's n
1c20: 6f 74 20 61 20 76 61 6c 69 64 20 65 78 74 65 6e  ot a valid exten
1c30: 73 69 6f 6e 20 6d 6f 64 75 6c 65 2e 3c 62 72 3e  sion module.<br>
1c40: 0d 0a 41 6e 64 20 63 6f 6e 73 65 71 75 65 6e 74  ..And consequent
1c50: 6c 79 20 77 69 6c 6c 20 72 65 66 75 73 65 20 74  ly will refuse t
1c60: 6f 20 6c 6f 61 64 20 74 68 65 20 6d 6f 64 75 6c  o load the modul
1c70: 65 20 77 69 74 68 6f 75 74 20 61 6e 79 20 6f 74  e without any ot
1c80: 68 65 72 20 63 6f 6e 73 65 71 75 65 6e 63 65 20  her consequence 
1c90: 28 65 78 63 65 70 74 20 6d 61 79 20 62 65 20 70  (except may be p
1ca0: 72 69 6e 74 69 6e 67 20 73 6f 6d 65 20 61 70 70  rinting some app
1cb0: 72 6f 70 72 69 61 74 65 20 65 72 72 6f 72 20 6d  ropriate error m
1cc0: 65 73 73 61 67 65 29 2e 3c 2f 6c 69 3e 0d 0a 3c  essage).</li>..<
1cd0: 6c 69 3e 61 20 6d 6f 72 65 20 6f 62 76 69 6f 75  li>a more obviou
1ce0: 73 20 66 61 69 6c 75 72 65 20 63 61 75 73 65 20  s failure cause 
1cf0: 63 6f 75 6c 64 20 62 65 20 74 68 65 20 6f 6e 65  could be the one
1d00: 20 74 6f 20 61 74 74 65 6d 70 74 20 6c 6f 61 64   to attempt load
1d10: 69 6e 67 20 61 20 6e 6f 74 20 65 78 69 73 74 69  ing a not existi
1d20: 6e 67 20 6d 6f 64 75 6c 65 20 28 6f 72 20 70 6f  ng module (or po
1d30: 73 73 69 62 6c 79 2c 20 61 20 6d 6f 64 75 6c 65  ssibly, a module
1d40: 20 77 68 6f 6d 20 61 63 74 75 61 6c 20 61 64 64   whom actual add
1d50: 72 65 73 73 20 63 6f 75 6c 64 6e 27 74 20 62 65  ress couldn't be
1d60: 20 72 65 73 6f 6c 76 65 64 20 62 79 20 61 70 70   resolved by app
1d70: 6c 79 69 6e 67 20 74 68 65 20 73 74 61 6e 64 61  lying the standa
1d80: 72 64 20 73 79 73 74 65 6d 2d 64 65 70 65 6e 64  rd system-depend
1d90: 65 6e 74 20 73 65 61 72 63 68 69 6e 67 20 72 75  ent searching ru
1da0: 6c 65 73 29 2e 3c 2f 6c 69 3e 20 0d 0a 3c 6c 69  les).</li> ..<li
1db0: 3e 66 69 6e 61 6c 6c 79 2c 20 74 68 65 20 6d 6f  >finally, the mo
1dc0: 64 75 6c 65 20 63 6f 75 6c 64 20 65 66 66 65 63  dule could effec
1dd0: 74 69 76 65 6c 79 20 65 78 69 73 74 73 20 61 6e  tively exists an
1de0: 64 20 63 6f 75 6c 64 20 63 6f 72 72 65 63 74 6c  d could correctl
1df0: 79 20 64 65 63 6c 61 72 65 20 61 20 76 61 6c 69  y declare a vali
1e00: 64 20 63 6f 6e 76 65 6e 74 69 6f 6e 61 6c 20 69  d conventional i
1e10: 6e 74 65 72 66 61 63 65 2e 20 41 6e 79 77 61 79  nterface. Anyway
1e20: 2c 20 69 66 20 74 68 65 20 63 6f 72 72 65 73 70  , if the corresp
1e30: 6f 6e 64 69 6e 67 20 73 68 61 72 65 64 20 6c 69  onding shared li
1e40: 62 72 61 72 79 20 68 61 73 20 66 75 72 74 68 65  brary has furthe
1e50: 72 20 64 65 70 65 6e 64 65 6e 63 69 65 73 20 73  r dependencies s
1e60: 6f 6d 65 20 62 72 6f 6b 65 6e 20 6c 69 6e 6b 20  ome broken link 
1e70: 63 6f 75 6c 64 20 70 6f 73 73 69 62 6c 79 20 66  could possibly f
1e80: 6f 72 62 69 64 20 61 20 73 75 63 63 65 73 73 66  orbid a successf
1e90: 75 6c 20 6c 6f 61 64 69 6e 67 2e 3c 2f 6c 69 3e  ul loading.</li>
1ea0: 0d 0a 3c 6c 69 3e 74 68 65 20 6c 61 73 74 20 68  ..<li>the last h
1eb0: 69 6c 6c 2d 66 61 74 65 64 20 63 6f 6d 62 69 6e  ill-fated combin
1ec0: 61 74 69 6f 6e 3a 20 53 51 4c 69 74 65 33 20 69  ation: SQLite3 i
1ed0: 73 20 61 20 73 74 72 6f 6e 67 6c 79 20 63 6f 6e  s a strongly con
1ee0: 66 69 67 75 72 61 62 6c 65 20 63 6f 6d 70 6f 6e  figurable compon
1ef0: 65 6e 74 2e 20 49 66 20 66 6f 72 20 61 6e 79 20  ent. If for any 
1f00: 68 69 67 68 6c 79 20 71 75 65 73 74 69 6f 6e 61  highly questiona
1f10: 62 6c 65 20 63 68 6f 69 63 65 20 79 6f 75 72 20  ble choice your 
1f20: 73 79 73 74 65 6d 20 70 61 63 6b 61 67 65 72 20  system packager 
1f30: 68 61 64 20 64 65 63 69 64 65 64 20 74 6f 20 64  had decided to d
1f40: 69 73 61 62 6c 65 20 61 74 20 61 6c 6c 20 74 68  isable at all th
1f50: 65 20 65 78 74 65 6e 73 69 6f 6e 20 6d 6f 64 75  e extension modu
1f60: 6c 65 20 6d 65 63 68 61 6e 69 73 6d 20 79 6f 75  le mechanism you
1f70: 27 6c 6c 20 74 68 65 6e 20 6e 65 76 65 72 20 62  'll then never b
1f80: 65 20 61 62 6c 65 20 74 6f 20 6c 6f 61 64 20 61  e able to load a
1f90: 6e 79 20 65 78 74 65 6e 73 69 6f 6e 2e 20 46 75  ny extension. Fu
1fa0: 6c 6c 20 73 74 6f 70 2e 20 28 61 6e 79 77 61 79  ll stop. (anyway
1fb0: 20 79 6f 75 27 6c 6c 20 70 72 6f 62 61 62 6c 79   you'll probably
1fc0: 20 62 65 20 61 62 6c 65 20 74 6f 20 73 77 69 74   be able to swit
1fd0: 63 68 20 74 6f 20 73 6f 6d 65 20 6d 6f 72 65 20  ch to some more 
1fe0: 72 65 61 73 6f 6e 61 62 6c 65 20 2f 20 6c 65 73  reasonable / les
1ff0: 73 20 70 61 72 61 6e 6f 69 64 20 64 69 73 74 72  s paranoid distr
2000: 69 62 75 74 69 6f 6e 29 2e 3c 2f 6c 69 3e 0d 0a  ibution).</li>..
2010: 3c 6c 69 3e 3c 62 3e 3c 75 3e 55 73 65 66 75 6c  <li><b><u>Useful
2020: 20 68 69 6e 74 3c 2f 75 3e 3c 2f 62 3e 3a 20 6d   hint</u></b>: m
2030: 61 6e 79 20 6c 61 6e 67 75 61 67 65 20 63 6f 6e  any language con
2040: 6e 65 63 74 6f 72 73 20 73 75 70 70 6f 72 74 20  nectors support 
2050: 61 20 76 65 72 79 20 6d 69 6e 69 6d 61 6c 69 73  a very minimalis
2060: 74 69 63 20 61 6e 64 20 72 61 74 68 65 72 20 75  tic and rather u
2070: 73 65 6c 65 73 73 20 64 69 61 67 6e 6f 73 74 69  seless diagnosti
2080: 63 2e 20 49 66 20 79 6f 75 20 61 72 65 20 65 78  c. If you are ex
2090: 70 65 72 69 65 6e 63 69 6e 67 20 73 6f 6d 65 20  periencing some 
20a0: 74 72 6f 75 62 6c 65 20 69 6e 20 73 75 63 63 65  trouble in succe
20b0: 73 73 66 75 6c 6c 79 20 6c 6f 61 64 69 6e 67 20  ssfully loading 
20c0: 53 70 61 74 69 61 4c 69 74 65 20 61 73 20 61 6e  SpatiaLite as an
20d0: 20 65 78 74 65 6e 73 69 6f 6e 2c 20 61 6e 79 20   extension, any 
20e0: 61 74 74 65 6d 70 74 20 74 6f 20 64 69 72 65 63  attempt to direc
20f0: 74 6c 79 20 64 65 62 75 67 20 79 6f 75 72 20 63  tly debug your c
2100: 6f 64 65 20 77 69 6c 6c 20 70 72 6f 62 61 62 6c  ode will probabl
2110: 79 20 62 65 20 61 20 66 72 75 73 74 72 61 74 69  y be a frustrati
2120: 6e 67 20 61 6e 64 20 69 6e 63 6f 6e 63 6c 75 73  ng and inconclus
2130: 69 76 65 20 65 78 70 65 72 69 65 6e 63 65 2e 3c  ive experience.<
2140: 62 72 3e 0d 0a 41 6e 79 77 61 79 20 79 6f 75 20  br>..Anyway you 
2150: 63 61 6e 20 61 6c 77 61 79 73 20 61 70 70 6c 79  can always apply
2160: 20 61 6e 20 61 6c 74 65 72 6e 61 74 69 76 65 20   an alternative 
2170: 61 70 70 72 6f 61 63 68 3a 0d 0a 3c 75 6c 3e 0d  approach:..<ul>.
2180: 0a 3c 6c 69 3e 73 74 61 72 74 20 74 68 65 20 3c  .<li>start the <
2190: 62 3e 73 71 6c 69 74 65 33 3c 2f 62 3e 20 43 6f  b>sqlite3</b> Co
21a0: 6d 6d 61 6e 64 20 4c 69 6e 65 20 66 72 6f 6e 74  mmand Line front
21b0: 2d 65 6e 64 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e  -end.</li>..<li>
21c0: 74 68 65 6e 20 65 78 65 63 75 74 65 20 79 6f 75  then execute you
21d0: 72 20 70 72 6f 62 6c 65 6d 61 74 69 63 20 3c 62  r problematic <b
21e0: 3e 53 45 4c 45 43 54 20 6c 6f 61 64 5f 65 78 74  >SELECT load_ext
21f0: 65 6e 73 69 6f 6e 3c 2f 62 3e 20 73 74 61 74 65  ension</b> state
2200: 6d 65 6e 74 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e  ment.</li>..<li>
2210: 69 66 20 73 6f 6d 65 20 66 61 69 6c 75 72 65 20  if some failure 
2220: 66 6f 72 62 69 64 73 20 74 6f 20 73 75 63 63 65  forbids to succe
2230: 73 73 66 75 6c 6c 79 20 6c 6f 61 64 20 74 68 65  ssfully load the
2240: 20 65 78 74 65 6e 73 69 6f 6e 20 6d 6f 64 75 6c   extension modul
2250: 65 20 74 68 65 6e 20 3c 62 3e 73 71 6c 69 74 65  e then <b>sqlite
2260: 33 3c 2f 62 3e 20 77 69 6c 6c 20 61 6c 77 61 79  3</b> will alway
2270: 73 20 70 72 69 6e 74 20 6d 61 6e 79 20 75 73 65  s print many use
2280: 66 75 6c 20 65 72 72 6f 72 20 6d 65 73 73 61 67  ful error messag
2290: 65 73 20 63 6c 65 61 72 6c 79 20 65 78 70 6c 61  es clearly expla
22a0: 69 6e 69 6e 67 20 77 68 65 72 65 20 69 73 20 74  ining where is t
22b0: 68 65 20 6f 66 66 65 6e 64 69 6e 67 20 63 61 75  he offending cau
22c0: 73 65 2e 20 49 6e 20 61 20 72 65 61 73 6f 6e 61  se. In a reasona
22d0: 62 6c 65 20 63 6f 6e 66 69 67 75 72 61 74 69 6f  ble configuratio
22e0: 6e 20 62 6f 74 68 20 74 68 65 20 73 71 6c 69 74  n both the sqlit
22f0: 65 33 20 74 6f 6f 6c 20 61 6e 64 20 79 6f 75 72  e3 tool and your
2300: 20 6c 61 6e 67 75 61 67 65 20 63 6f 6e 6e 65 63   language connec
2310: 74 6f 72 20 73 68 6f 75 6c 64 20 69 6e 76 6f 6b  tor should invok
2320: 65 20 74 68 65 20 73 61 6d 65 20 69 64 65 6e 74  e the same ident
2330: 69 63 61 6c 20 63 6f 70 79 20 6f 66 20 3c 62 3e  ical copy of <b>
2340: 3c 69 3e 6c 69 62 73 71 6c 69 74 65 33 3c 2f 69  <i>libsqlite3</i
2350: 3e 3c 2f 62 3e 2c 20 73 6f 20 79 6f 75 27 6c 6c  ></b>, so you'll
2360: 20 65 66 66 65 63 74 69 76 65 6c 79 20 74 65 73   effectively tes
2370: 74 20 74 68 65 20 73 61 6d 65 20 72 75 6e 2d 74  t the same run-t
2380: 69 6d 65 20 63 6f 6e 66 69 67 75 72 61 74 69 6f  ime configuratio
2390: 6e 20 61 64 6f 70 74 65 64 20 62 79 20 74 68 65  n adopted by the
23a0: 20 6c 61 6e 67 75 61 67 65 20 63 6f 6e 6e 65 63   language connec
23b0: 74 6f 72 20 62 75 74 20 74 61 6b 69 6e 67 20 70  tor but taking p
23c0: 72 6f 66 69 74 20 66 72 6f 6d 20 72 69 63 68 65  rofit from riche
23d0: 72 20 64 69 61 67 6e 6f 73 74 69 63 20 6d 65 73  r diagnostic mes
23e0: 73 61 67 65 73 20 28 75 6e 68 61 70 70 69 6c 79  sages (unhappily
23f0: 20 6e 6f 74 20 61 6c 6c 20 63 6f 6e 66 69 67 75   not all configu
2400: 72 61 74 69 6f 6e 73 20 61 72 65 20 61 6c 77 61  rations are alwa
2410: 79 73 20 6e 65 74 20 61 6e 64 20 63 6c 65 61 6e  ys net and clean
2420: 20 61 73 20 79 6f 75 20 63 6f 75 6c 64 20 65 78   as you could ex
2430: 70 65 63 74 20 2e 2e 2e 20 74 68 69 73 20 72 75  pect ... this ru
2440: 6c 65 20 68 61 73 20 6d 61 6e 79 20 65 78 63 65  le has many exce
2450: 70 74 69 6f 6e 73 2c 20 6d 6f 73 74 20 6e 6f 74  ptions, most not
2460: 61 62 6c 79 20 6f 6e 20 57 69 6e 64 6f 77 73 29  ably on Windows)
2470: 2e 3c 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e 3c 2f 6c  .</li>..</ul></l
2480: 69 3e 0d 0a 3c 2f 75 6c 3e 0d 0a 3c 68 33 3e 57  i>..</ul>..<h3>W
2490: 68 61 74 27 73 20 6e 65 77 20 69 6e 20 3c 75 3e  hat's new in <u>
24a0: 3c 69 3e 6d 6f 64 5f 73 70 61 74 69 61 6c 69 74  <i>mod_spatialit
24b0: 65 3c 2f 69 3e 3c 2f 75 3e 3c 2f 68 33 3e 0d 0a  e</i></u></h3>..
24c0: 59 6f 75 27 6c 6c 20 70 72 6f 62 61 62 6c 79 20  You'll probably 
24d0: 62 65 20 61 6c 72 65 61 64 79 20 61 63 63 75 73  be already accus
24e0: 74 6f 6d 65 64 20 74 6f 20 6c 6f 61 64 20 53 70  tomed to load Sp
24f0: 61 74 69 61 4c 69 74 65 20 61 73 20 61 20 64 79  atiaLite as a dy
2500: 6e 61 6d 69 63 20 65 78 74 65 6e 73 69 6f 6e 3b  namic extension;
2510: 20 62 75 74 20 61 6e 79 20 70 72 65 76 69 6f 75   but any previou
2520: 73 20 76 65 72 73 69 6f 6e 20 62 65 66 6f 72 65  s version before
2530: 20 3c 62 3e 34 2e 32 3c 2f 62 3e 20 6d 61 64 65   <b>4.2</b> made
2540: 20 6e 6f 20 72 65 61 6c 20 64 69 73 74 69 6e 63   no real distinc
2550: 74 69 6f 6e 20 62 65 74 77 65 65 6e 20 6c 6f 61  tion between loa
2560: 64 61 62 6c 65 20 6d 6f 64 75 6c 65 73 20 61 6e  dable modules an
2570: 64 20 67 65 6e 65 72 61 6c 2d 70 75 72 70 6f 73  d general-purpos
2580: 65 20 73 68 61 72 65 64 20 6c 69 62 72 61 72 69  e shared librari
2590: 65 73 2e 3c 62 72 3e 0d 0a 41 73 20 77 65 20 70  es.<br>..As we p
25a0: 61 69 6e 66 75 6c 6c 79 20 6c 65 61 72 6e 65 64  ainfully learned
25b0: 20 62 79 20 64 69 72 65 63 74 20 6f 6e 2d 74 68   by direct on-th
25c0: 65 2d 66 69 65 6c 64 20 65 78 70 65 72 69 65 6e  e-field experien
25d0: 63 65 2c 20 74 68 69 73 20 61 70 70 61 72 65 6e  ce, this apparen
25e0: 74 6c 79 20 73 69 6d 70 6c 65 72 20 63 6f 6e 66  tly simpler conf
25f0: 69 67 75 72 61 74 69 6f 6e 20 63 61 75 73 65 64  iguration caused
2600: 20 6c 6f 74 20 6f 66 20 74 72 6f 75 62 6c 65 73   lot of troubles
2610: 3a 20 69 6e 73 74 61 62 69 6c 69 74 69 65 73 2c  : instabilities,
2620: 20 73 75 64 64 65 6e 20 63 72 61 73 68 65 73 20   sudden crashes 
2630: 61 6e 64 20 73 6f 20 6f 6e 2e 20 4d 61 6b 69 6e  and so on. Makin
2640: 67 20 61 20 63 6c 65 61 72 65 72 20 64 69 73 74  g a clearer dist
2650: 69 6e 63 74 69 6f 6e 20 62 65 74 77 65 65 6e 20  inction between 
2660: 61 20 3c 75 3e 3c 69 3e 67 65 6e 65 72 61 6c 2d  a <u><i>general-
2670: 70 75 72 70 6f 73 65 20 73 68 61 72 65 64 20 6c  purpose shared l
2680: 69 62 72 61 72 79 3c 2f 69 3e 3c 2f 75 3e 20 61  ibrary</i></u> a
2690: 6e 64 20 61 20 3c 75 3e 3c 69 3e 70 75 72 65 20  nd a <u><i>pure 
26a0: 6c 6f 61 64 61 62 6c 65 20 6d 6f 64 75 6c 65 3c  loadable module<
26b0: 2f 69 3e 3c 2f 75 3e 20 73 65 65 6d 73 20 74 6f  /i></u> seems to
26c0: 20 62 65 20 74 68 65 20 64 65 66 69 6e 69 74 69   be the definiti
26d0: 76 65 20 73 6f 6c 75 74 69 6f 6e 2e 3c 62 72 3e  ve solution.<br>
26e0: 0d 0a 45 78 61 63 74 6c 79 20 68 65 72 65 20 69  ..Exactly here i
26f0: 73 20 74 68 65 20 72 61 64 69 63 61 6c 20 69 6e  s the radical in
2700: 6e 6f 76 61 74 69 6f 6e 20 69 6e 74 72 6f 64 75  novation introdu
2710: 63 65 20 73 74 61 72 74 69 6e 67 20 73 69 6e 63  ce starting sinc
2720: 65 20 76 65 72 73 69 6f 6e 20 3c 62 3e 34 2e 32  e version <b>4.2
2730: 3c 2f 62 3e 3b 20 6e 6f 77 20 53 70 61 74 69 61  </b>; now Spatia
2740: 4c 69 74 65 20 69 73 20 64 69 73 74 72 69 62 75  Lite is distribu
2750: 74 65 64 20 69 6e 20 74 77 6f 20 61 6c 74 65 72  ted in two alter
2760: 6e 61 74 69 76 65 20 66 6c 61 76 6f 72 73 3a 0d  native flavors:.
2770: 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e 3c 62 3e 3c 69  .<ul>..<li><b><i
2780: 3e 6c 69 62 73 70 61 74 69 61 6c 69 74 65 3c 2f  >libspatialite</
2790: 69 3e 3c 2f 62 3e 20 28 3c 62 3e 3c 69 3e 2e 73  i></b> (<b><i>.s
27a0: 6f 3c 2f 69 3e 3c 2f 62 3e 2c 20 3c 62 3e 3c 69  o</i></b>, <b><i
27b0: 3e 2e 64 6c 6c 3c 2f 69 3e 3c 2f 62 3e 2c 20 3c  >.dll</i></b>, <
27c0: 62 3e 3c 69 3e 2e 64 79 6c 69 62 3c 2f 69 3e 3c  b><i>.dylib</i><
27d0: 2f 62 3e 20 61 6e 64 20 73 6f 20 6f 6e 29 3a 20  /b> and so on): 
27e0: 61 20 67 65 6e 75 69 6e 65 20 63 6c 61 73 73 69  a genuine classi
27f0: 63 20 73 68 61 72 65 64 20 6c 69 62 72 61 72 79  c shared library
2800: 2e 3c 62 72 3e 0d 0a 49 74 20 77 69 6c 6c 20 61  .<br>..It will a
2810: 6c 77 61 79 73 20 64 65 70 65 6e 64 20 6f 6e 20  lways depend on 
2820: 73 6f 6d 65 20 65 78 74 65 72 6e 61 6c 20 3c 69  some external <i
2830: 3e 6c 69 62 73 71 6c 69 74 65 33 3c 2f 69 3e 2c  >libsqlite3</i>,
2840: 20 61 6e 64 20 69 73 20 75 6e 69 71 75 65 6c 79   and is uniquely
2850: 20 69 6e 74 65 6e 64 65 64 20 74 6f 20 62 65 20   intended to be 
2860: 75 73 65 64 20 62 79 20 73 74 61 6e 64 2d 61 6c  used by stand-al
2870: 6f 6e 65 20 61 70 70 6c 69 63 61 74 69 6f 6e 73  one applications
2880: 20 28 73 75 63 68 20 61 73 20 65 2e 67 2e 20 3c   (such as e.g. <
2890: 62 3e 3c 69 3e 73 70 61 74 69 61 6c 69 74 65 3c  b><i>spatialite<
28a0: 2f 69 3e 3c 2f 62 3e 20 6f 72 20 3c 62 3e 3c 69  /i></b> or <b><i
28b0: 3e 73 70 61 74 69 61 6c 69 74 65 5f 67 75 69 3c  >spatialite_gui<
28c0: 2f 75 3e 3c 2f 62 3e 29 2e 3c 62 72 3e 0d 0a 59  /u></b>).<br>..Y
28d0: 6f 75 27 6c 6c 20 6e 65 76 65 72 20 62 65 20 61  ou'll never be a
28e0: 62 6c 65 20 74 6f 20 73 75 63 63 65 73 73 66 75  ble to successfu
28f0: 6c 6c 79 20 6c 6f 61 64 20 74 68 69 73 20 3c 62  lly load this <b
2900: 3e 3c 69 3e 6c 69 62 73 70 61 74 69 61 6c 69 74  ><i>libspatialit
2910: 65 3c 2f 69 3e 3c 2f 62 3e 20 73 68 61 72 65 64  e</i></b> shared
2920: 20 6c 69 62 72 61 72 79 20 61 73 20 61 20 64 79   library as a dy
2930: 6e 61 6d 69 63 20 65 78 74 65 6e 73 69 6f 6e 20  namic extension 
2940: 76 69 61 20 74 68 65 20 3c 62 3e 53 45 4c 45 43  via the <b>SELEC
2950: 54 20 6c 6f 61 64 5f 65 78 74 65 6e 73 69 6f 6e  T load_extension
2960: 3c 2f 62 3e 20 6d 65 63 68 61 6e 69 73 6d 2c 20  </b> mechanism, 
2970: 73 69 6d 70 6c 79 20 62 65 63 61 75 73 65 20 69  simply because i
2980: 74 20 64 6f 65 73 6e 27 74 20 64 65 63 6c 61 72  t doesn't declar
2990: 65 20 74 68 65 20 72 65 71 75 69 72 65 64 20 63  e the required c
29a0: 6f 6e 76 65 6e 74 69 6f 6e 61 6c 20 69 6e 74 65  onventional inte
29b0: 72 66 61 63 65 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69  rface.</li>..<li
29c0: 3e 3c 62 3e 3c 69 3e 6d 6f 64 5f 73 70 61 74 69  ><b><i>mod_spati
29d0: 61 6c 69 74 65 3c 2f 69 3e 3c 2f 62 3e 20 28 3c  alite</i></b> (<
29e0: 62 3e 3c 69 3e 2e 73 6f 3c 2f 69 3e 3c 2f 62 3e  b><i>.so</i></b>
29f0: 2c 20 3c 62 3e 3c 69 3e 2e 64 6c 6c 3c 2f 69 3e  , <b><i>.dll</i>
2a00: 3c 2f 62 3e 2c 20 3c 62 3e 3c 69 3e 2e 64 79 6c  </b>, <b><i>.dyl
2a10: 69 62 3c 2f 69 3e 3c 2f 62 3e 20 61 6e 64 20 73  ib</i></b> and s
2a20: 6f 20 6f 6e 29 3a 20 74 68 69 73 20 69 73 20 73  o on): this is s
2a30: 69 6d 70 6c 79 20 69 6e 74 65 6e 64 65 64 20 61  imply intended a
2a40: 73 20 70 75 72 65 20 6c 6f 61 64 61 62 6c 65 20  s pure loadable 
2a50: 6d 6f 64 75 6c 65 20 6c 61 63 6b 69 6e 67 20 61  module lacking a
2a60: 6e 79 20 65 78 70 6c 69 63 69 74 20 53 51 4c 69  ny explicit SQLi
2a70: 74 65 33 20 64 65 70 65 6e 64 65 6e 63 79 2e 3c  te3 dependency.<
2a80: 62 72 3e 0d 0a 59 6f 75 27 6c 6c 20 6e 65 76 65  br>..You'll neve
2a90: 72 20 62 65 20 61 62 6c 65 20 74 6f 20 64 69 72  r be able to dir
2aa0: 65 63 74 6c 79 20 6c 69 6e 6b 20 74 68 69 73 20  ectly link this 
2ab0: 3c 62 3e 3c 69 3e 6d 6f 64 5f 73 70 61 74 69 61  <b><i>mod_spatia
2ac0: 6c 69 74 65 3c 2f 69 3e 3c 2f 62 3e 20 73 68 61  lite</i></b> sha
2ad0: 72 65 64 20 6c 69 62 72 61 72 79 20 66 6f 6c 6c  red library foll
2ae0: 6f 77 69 6e 67 20 74 68 65 20 63 6c 61 73 73 69  owing the classi
2af0: 63 20 77 61 79 2c 20 62 65 63 61 75 73 65 20 69  c way, because i
2b00: 74 20 64 6f 65 73 6e 27 74 20 64 65 63 6c 61 72  t doesn't declar
2b10: 65 20 61 6e 79 20 65 78 74 65 72 6e 61 6c 20 6c  e any external l
2b20: 69 6e 6b 20 73 79 6d 62 6f 6c 20 65 78 63 65 70  ink symbol excep
2b30: 74 20 74 68 61 74 20 61 20 73 69 6e 67 6c 65 20  t that a single 
2b40: 6f 6e 65 3a 20 69 2e 65 2e 20 74 68 65 20 63 6f  one: i.e. the co
2b50: 6e 76 65 6e 74 69 6f 6e 61 6c 20 69 6e 74 65 72  nventional inter
2b60: 66 61 63 65 2e 0d 0a 54 68 65 20 75 6e 69 71 75  face...The uniqu
2b70: 65 20 70 6f 73 73 69 62 6c 65 20 77 61 79 20 74  e possible way t
2b80: 6f 20 6c 6f 61 64 20 61 6e 64 20 61 63 74 69 76  o load and activ
2b90: 61 74 65 20 74 68 69 73 20 6d 6f 64 75 6c 65 20  ate this module 
2ba0: 69 73 20 62 79 20 63 61 6c 6c 69 6e 67 20 61 20  is by calling a 
2bb0: 3c 62 3e 53 45 4c 45 43 54 20 6c 6f 61 64 5f 65  <b>SELECT load_e
2bc0: 78 74 65 6e 73 69 6f 6e 3c 2f 62 3e 20 53 51 4c  xtension</b> SQL
2bd0: 20 73 74 61 74 65 6d 65 6e 74 2e 3c 2f 6c 69 3e   statement.</li>
2be0: 0d 0a 3c 2f 75 6c 3e 3c 62 72 3e 0d 0a 3c 68 72  ..</ul><br>..<hr
2bf0: 3e 3c 62 72 3e 0d 0a 3c 61 20 68 72 65 66 3d 22  ><br>..<a href="
2c00: 68 74 74 70 73 3a 2f 2f 77 77 77 2e 67 61 69 61  https://www.gaia
2c10: 2d 67 69 73 2e 69 74 2f 66 6f 73 73 69 6c 2f 6c  -gis.it/fossil/l
2c20: 69 62 73 70 61 74 69 61 6c 69 74 65 2f 77 69 6b  ibspatialite/wik
2c30: 69 3f 6e 61 6d 65 3d 34 2e 33 2e 30 2b 64 6f 63  i?name=4.3.0+doc
2c40: 22 3e 62 61 63 6b 3c 2f 61 3e 0a 5a 20 31 65 63  ">back</a>.Z 1ec
2c50: 31 39 36 32 37 33 34 30 35 64 66 30 61 35 65 33  196273405df0a5e3
2c60: 34 32 33 63 38 35 30 64 65 63 34 61 66 0a        423c850dec4af.