Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

tclodbc installed, but tcl dosn't know

Status
Not open for further replies.

royzhang

Programmer
Aug 29, 2011
9
US
Hi, anyone can help me with the issue:
I have installed tclodbc in redhat
/usr/local/tcl/bin/lib/tclodbc2.5/libtclodbc2.5.so
But tcl seems not realize the installation. How can we let it know, register in somewhere?

% package require tclodbc
can't find package tclodbc

 
Hi,

I think you need to inform tcl/tk interpretor where to look for the package. Insert the following to your mainscript, before calling "package require"

lappend auto_path "/usr/local/tcl/bin/lib/tclodbc2.5"

I believe auto_path is a reserved variable of tcl/tk to define where the searchpath is for all package actions.

 
Thank you for replying... thacoda. I added it, but still no luck.

% lappend auto_path "/usr/local/tcl/bin/lib/tclodbc2.5"
/usr/local/lib/tcl8.5 /usr/local/lib /usr/local/tcl/lib /usr/local/tcl/bin/lib/tclodbc2.5
% package require tclodbc
can't find package tclodbc

I found empty pkgIndex.tcl, is anything we can do on this file?
 
Hmmm, first of all, I never used this package myself before. I am only able to give you generic answers.

So, you checked the pkgIndex.tcl file and it looks like it is empty?
Could it be that your tclodbc Linux-distribution is incomplete, because if I examine it tells me that the content AND position of this file is important for any package.

You might also want to check out it explains the usage of tclodbc package.
 
Thanks for your kind advice. I'm going to check them out ;)
 
Do you know teacup?

1. First of all, look if you have teacup
Code:
c:\Users\Roman\Work>teacup version

        8.5.9.0.293667
if teacup is included in your tcl distribution, use it to install packages properly.

2. Look if required package is available
Code:
c:\Users\Roman\Work>teacup list tclodbc
entity  name    version platform
------- ------- ------- ----------
package tclodbc 2.5     win32-ix86
------- ------- ------- ----------
1 entity found

3. Then install the package
Code:
c:\Users\Roman\Work>teacup list tclodbc
entity  name    version platform
------- ------- ------- ----------
package tclodbc 2.5     win32-ix86
------- ------- ------- ----------
1 entity found

c:\Users\Roman\Work>teacup install tclodbc
Resolving tclodbc ... [package tclodbc 2.5 win32-ix86 @ [URL unfurl="true"]http://teapot.activestat[/URL]
e.com]
Resolving Tcl 8.4 -is package ... [package Tcl 8.5.9 _ ... Installed outside rep
ository, probing dependencies]

Retrieving package tclodbc 2.5 win32-ix86 ...@ [URL unfurl="true"]http://teapot.activestate.com[/URL] ...
 Ok

Installing into C:/Tcl/lib/teapot

Installing package tclodbc 2.5 win32-ix86
Then you can use the package in your script.

If you don't need the package, you can remove it
Code:
c:\Users\Roman\Work>teacup remove tclodbc
 Removing instance package tclodbc 2.5 win32-ix86
 
Thank you mikrom, I have run that follow your instruction in Windows platform, It is very interesting although my installation is in Linux. I'm a newbie in Window.
The issue has been resolved. We got tcl lib dir first by

tcl> info library

and then soft link all *.so and *.tcl of tclodbc to tcl lib dir .
 
I think teacup is platform independent, although I'm not sure if it's contained only in ActiveState Tcl distribution or in other distributions too - I'm using only ActiveTcl.
 
I have ActiveTCL installed in Windows and tried teacup with your example, it's very cool. I didn't find the teacup in Linux where tcl/tk came with yum .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top