Received: from smtp015.mail.yahoo.com (smtp015.mail.yahoo.com [216.136.173.59]) by postgresql.org (8.11.3/8.11.4) with SMTP id fB5Lkjm05969 for ; Wed, 5 Dec 2001 16:46:45 -0500 (EST) (envelope-from janwieck@yahoo.com) Received: from psc.progress.com (HELO saturn.jw.home) (192.233.92.200) by smtp.mail.vip.sc5.yahoo.com with SMTP; 5 Dec 2001 21:46:46 -0000 Received: (from wieck@localhost) by saturn.jw.home (8.11.2/8.11.2) id fB5Li7e02083; Wed, 5 Dec 2001 16:44:07 -0500 From: Jan Wieck Message-Id: <200112052144.fB5Li7e02083@saturn.jw.home> Subject: Re: Cant load pgtclsh library into application In-Reply-To: <19220.1006877462@sss.pgh.pa.us> from Tom Lane at "Nov 27, 2001 11:11:02 am" To: Tom Lane Date: Wed, 5 Dec 2001 16:44:07 -0500 (EST) CC: Amit Padgaonkar , pgsql-interfaces@postgresql.org X-Mailer: ELM [version 2.4ME+ PL68 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Archive-Number: 200112/24 X-Sequence-Number: 2181 Tom Lane wrote: > "Amit Padgaonkar" writes: > > I am using tcl8.3 / tk8.3 and postgreSQL 7.3 . I am not able to > > load pgtclsh library into to my TK application for giving it backend > > support. > > pgtclsh is not a library, it is a prebuilt tclsh application with the > libpgtcl library already loaded into it. You can load the libpgtcl > library into your own application with the usual Tcl "load" command. > pgaccess does it like so: > > if {[info exists env(PGLIB)]} { > set libpgtclpath [file join $env(PGLIB) libpgtcl] > } else { > set libpgtclpath {libpgtcl} > } > load ${libpgtclpath}[info sharedlibextension] > > regards, tom lane I use to have a directory .../tcl8.x/lib/pgtcl where I put a symlink to the libpgtcl.so and the appropriate pgkIndex.tcl file. The pgkIndex can be created by cd'ing into that directory, starting a tclsh and issuing the command pkg_mkIndex . ./libpgtcl.so Once you have that, your Tcl scripts just need to do a package require Pgtcl No need for the user to set PGLIB or even know where it is installed. Jan -- #======================================================================# # It's easier to get forgiveness for being wrong than for being right. # # Let's break this rule - forgive me. # #================================================== JanWieck@Yahoo.com # _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com