Re: Cant load pgtclsh library into application - Mailing list pgsql-interfaces

From Jan Wieck
Subject Re: Cant load pgtclsh library into application
Date
Msg-id 200112052144.fB5Li7e02083@saturn.jw.home
Whole thread Raw
In response to Re: Cant load pgtclsh library into application  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-interfaces
Tom Lane wrote:
> "Amit Padgaonkar" <amit@nsat.co.jp> 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
thecommand
 
       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



pgsql-interfaces by date:

Previous
From: Tom Lane
Date:
Subject: Re: Operator class and index
Next
From: dsmclennan@spipowernet.com.au
Date:
Subject: C interface libpq.so.2 problem