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!

Undo pkgindex for tcom

Status
Not open for further replies.

watergirl

Technical User
Aug 29, 2002
13
0
0
US
I am having difficulty getting tcl to find tcom. I hard coded the $dir in the pkgindex.tcl to the wrong directory.
How do I undo this and what is the correct directory?
I specified the directory where the tcom.dll is located.
 
Your pkgindex.tcl looks like this.
package ifneeded tcom 3.7 [list load [file join $dir tcom.dll]]\n[list source [file join $dir tcom.tcl]

So the obvious fix is:
set dir "path to tcom"
package ifneeded tcom 3.7 [list load [file join $dir tcom.dll]]\n[list source [file join $dir tcom.tcl]

How do you find tcom??
Run a windows find against tcom.

 
That is what I did...I set dir to the directory path
that contains tcom.dll. That's what started the whole
problem...it still says it can't find it????????
I would like to "undo" the initial setting that pkgindex
made, but considering the fact that putting the correct
path in dir doesn't work, I don't know how to "redo" or
"undo" the pkgindex setting when what should be correct
doesn't work.
 
Okay, Let's break down the code here.
On my *nix box the path to tcl is:
/usr/lib/tcl8.3

So assuming that tcom was in this directory
I would really need to arrange for the directory to read /usr/lib/tcl8.3/tcom
When calling file join after it looks like:
file join /usr/lib/tcl8.3/tcom tcom.dll
/usr/lib/tcl8.3/tcom/tcom.dll
Which is to be expected one would hope.

Now if your problem persists you have a couple choices.
You can reinstall(pain in the heinie).
Or you can preface your scripts using
tcom with two lines.
source c:/pathtotcl/tcom/tcom.tcl
load c:/pathtotcl/tcom/tcom.dll

That should work as well.

Good Luck
 
I am still getting "couldn't load library "c:\Program Files\Tcl\lib\tcom\tcom.dll": this library or a dependant library could not be found.

My guess it that maybe it can't find the registry package
as tcom.tcl requires it??? I am trying to get it working on our most critical production box so I'm very weary of
doing much to it. I can source tcom.tcl fine but if I try to run the load or a pgm which requires tcom, I get the same error message. I have it working on my computer, but
I have lot's of other TCL extensions applied as well.
The production box is pretty much straight tcl 8.3 with
ftp, odbc, tclcurl and oratcl. Any idea what else it may need and where to find it??? Thanks for any and all suggestions!

 
You should never set the dir variable in any pkgIndex.tcl file. The dir variable is "magically" set by Tcl when it searches for packages. So, the first step to repair the damage is to "roll back" to the original version. Either remove all hard-coded paths that you added, or else delete and re-install the package.
- Ken Jones, President, ken@avia-training.com
Avia Training and Consulting, 866-TCL-HELP (866-825-4357) US Toll free
415-643-8692 Voice
415-643-8697 Fax
 
Do you mean I have to reinstall TCL? I've tried deleting
the tcom folder in tcl\lib, then putting it back and dir is
set to nothing just like it came, but somewhere in memory
or that 'magical place', it keeps giving that same error
message. The reason I hard coded it in the first place was
that I was getting that same 'not found' message without my directory prefixing the tcom.dll. Could it be the
'package require registry' inside of tcom.tcl that it
can't find? Where is that magical place????Where did
the pkgindex save that path to????? Thank you.
 
"You should never set the dir variable in any
pkgIndex.tcl file.."

I respectfully disagree. It is a local variable in this situation. The OP complained that the $dir var set was wrong. The easiest, if not best, way to fix it is to set the variable within the loading script IMO.
It seems to me that you are making this more difficult
than it is.
However it does not seem now that this was the problem
at all.


Watergirl,
On my win2000 machine with tcl 8.4.xx, I just loaded and
sourced tcom using the method I proposed above with no
problem and no error. There is no reference to a registry
package in the pkgindex file and no other packages were loaded.
It is the same as using any dynamcially loaded library. If you cannot load (first), then source the tcom.tcl files, then you have a legitimate problem.
 
Here is the problem...it is operating system related.
I can run Tcom all day long on my Windows 2000 box. The
box that I've encountered these difficulties with is a
Windows NT box. Any suggestions? I also tried it on a
Windows 98 box and had the same problems. Tcl is under
the Program Files folder. Does anyone know how to make
it recognize Tcom on Windows NT?
 
Watergirl,
What exactly is the error after you issue the commands:
load c:/pathtotcl/tcom/tcom.dll
source c:/pathtotcl/tcom/tcom.tcl

Does it choke on the load?
 
I get "couldn't load library "c:\Program Files\Tcl\lib\tcom\tcom.dll": this library or a dependant library could not be found." when trying to execute the load.
Believe me, tcom.dll and tcom.tcl are sitting in that
directory. As I stated, it works fine on win2000 just not
on NT and 98. I've put it on multiple 2000 boxes with
no problem.
Thank you for any suggestions you may have.
 
Okay this looks like a bug.
I would get the information together on your platform, tcl version and version of
tcom and use the google portal to comp.lang.tcl:

Report the problem there in your post
and there is an excellent chance someone will know of a fix for the issue or be able
to shed light on it.

Good Luck.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top