📄 dynload.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html><head><title>How to build a dynamically loaded Tcl extension for SQLite</title><style type="text/css">body { margin: auto; font-family: "Verdana" "sans-serif"; padding: 8px 1%;}a { color: #45735f }a:visited { color: #734559 }.logo { position:absolute; margin:3px; }.tagline { float:right; text-align:right; font-style:italic; width:240px; margin:12px; margin-top:58px;}.toolbar { font-variant: small-caps; text-align: center; line-height: 1.6em; margin: 0; padding:1px 8px;}.toolbar a { color: white; text-decoration: none; padding: 6px 12px; }.toolbar a:visited { color: white; }.toolbar a:hover { color: #80a796; background: white; }.content { margin: 5%; }.content dt { font-weight:bold; }.content dd { margin-bottom: 25px; margin-left:20%; }.content ul { padding:0px; padding-left: 15px; margin:0px; }/* rounded corners */.se { background: url(images/se.png) 100% 100% no-repeat #80a796}.sw { background: url(images/sw.png) 0% 100% no-repeat }.ne { background: url(images/ne.png) 100% 0% no-repeat }.nw { background: url(images/nw.png) 0% 0% no-repeat }</style><meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head><body><div><!-- container div to satisfy validator --><a href="index.html"><img class="logo" src="images/SQLite.gif" alt="SQLite Logo" border="0"></a><div><!-- IE hack to prevent disappearing logo--></div><div class="tagline">Small. Fast. Reliable.<br>Choose any three.</div><table width=100% style="clear:both"><tr><td> <div class="se"><div class="sw"><div class="ne"><div class="nw"> <div class="toolbar"> <a href="about.html">About</a> <a href="sitemap.html">Sitemap</a> <a href="docs.html">Documentation</a> <a href="download.html">Download</a> <a href="copyright.html">License</a> <a href="news.html">News</a> <a href="http://www.sqlite.org/cvstrac/index">Developers</a> <a href="support.html">Support</a> </div></div></div></div></div></td></tr></table> <h1 align=center>How To Build A Dynamically Loaded Tcl Extension</h1><p><i>This note was contributed by <a href="bsaunder@tampabay.rr.com.nospam">Bill Saunders</a>. Thanks, Bill!</i></p><p>To compile the SQLite Tcl extension into a dynamically loaded module I did the following:</p><ol><li><p>Do a standard compile(I had a dir called bld at the same level as sqlite ie /root/bld /root/sqliteI followed the directions and did a standard build in the blddirectory)</p></li><li><p>Now do the following in the bld directory<blockquote><pre>gcc -shared -I. -lgdbm ../sqlite/src/tclsqlite.c libsqlite.a -o sqlite.so</pre></blockquote></p></li><li><p>This should produce the file sqlite.so in the bld directory</p></li><li><p>Create a pkgIndex.tcl file that contains this line<blockquote><pre>package ifneeded sqlite 1.0 [list load [file join $dir sqlite.so]]</pre></blockquote></p></li><li><p>To use this put sqlite.so and pkgIndex.tcl in the same directory</p></li><li><p>From that directory start wish</p></li><li><p>Execute the following tcl command (tells tcl where to fine loadablemodules)<blockquote><pre>lappend auto_path [exec pwd]</pre></blockquote></p></li><li><p>Load the package <blockquote><pre>package require sqlite</pre></blockquote></p></li><li><p>Have fun....</p></li></ul><hr><small><i>This page last modified 2007/12/20 02:23:05 UTC</i></small></div></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -