[vtkusers] can't find package vtk while executing a .tcl file

Hua-Mei Chen huameichen0523 at gmail.com
Thu Sep 18 07:38:09 EDT 2008


Thank you all who have replied.
I tried to modify $auto_path but had other errors. What I typed were: (I 
tried to run ImagePlaneWidget.tcl to learn how to write a GUI for VTK.)

 % puts $auto_path
C:/Tcl/lib/tcl8.4 C:/Tcl/lib
% source C:/Users/hchen/Documents/VTK/Examples/GUI/Tcl/ImagePlaneWidget.tcl
can't find package vtk
% set auto_path "$auto_path 
C:/Users/hchen/Documents/VTK/bin/Wrapping/Tcl/Debug"
C:/Tcl/lib/tcl8.4 C:/Tcl/lib C:/Tcl/lib/tcllib1.8 C:/Tcl/lib/tklib0.4
C:/Users/hchen/Documents/VTK/bin/Wrapping/Tcl/Debug
% source C:/Users/hchen/Documents/VTK/Examples/GUI/Tcl/ImagePlaneWidget.tcl
couldn't load library
"C:/Users/hchen/Documents/VTK/bin/bin/Debug/vtkCommonTCL.dll": this library
or a dependent library could not be found
in library path
attempt to provide package vtkCommonTCL 5.0 failed: no version of package
vtkCommonTCL provided
attempt to provide package vtkcommon 5.0 failed: no version of package
vtkcommon provided
attempt to provide package vtk 5.0 failed: no version of package vtk
provided
%

I believe I missed something very fundamental and have more questions now. 
Hopefully someone can give me some guidance.
1) why are there so many pkgIndex.tcl files under VTK subdirectories?
2) Does the role of a pkgIndex.tcl similar to the role of a .cmake file in 
CMAKE that guides CMAKE to find the required package?
3) What are exactly needed to run a VTK application wrapped by Tcl? Do I 
need to know which libraries are needed and then set the right path to each 
library?
4) Do I need to know how to write a pkgIndex.tcl file to master it? If yes, 
where can I find more references?

Tcl is something new to me and I know there are many good tutorial and 
references on the web to read online. But I am wondering is there any .pdf 
version of tcl documentation that I can print out and read offline?
Any guidance is highly appreciated.

Chen





----- Original Message ----- 
From: "Peter Wainwright" <prw at ceiriog.eclipse.co.uk>
To: "Hua-Mei Chen" <huameichen0523 at gmail.com>
Cc: <vtkusers at vtk.org>
Sent: Wednesday, September 17, 2008 11:51 AM
Subject: Re: [vtkusers] can't find package vtk while executing a .tcl file


> On Wed, 2008-09-17 at 06:27 -0500, Hua-Mei Chen wrote:
>> Hi,
>>
>>     I am new to this mailing list and have a very basic question that
>> probably has been asked before. But, how do I modify a .tcl file such
>> that it can be executed without any error like "can't find package vtk
>> while executing "package require VTK" "?  In other word, I think my
>> question is how to set path in a .tcl file. Thank you.
>
> I think you need to modify the variable "auto_path".  If you execute
> "puts $auto_path" in tclsh, you will see the default value, for me it is
>
> % puts $auto_path
> /usr/share/tcltk/tcl8.4 /usr/lib /usr/local/lib/tcltk
> /usr/local/share/tcltk /usr/lib/tcltk /usr/share/tcltk
>
> Just add the path to the directory which contains the pkgIndex.tcl file
> for VTK, e.g.
>
> set auto_path "$auto_path /xxxxxx/lib/vtk-5.2"
>
> Peter
>
>>
>>
>> Chen
>> _______________________________________________
>> This is the private VTK discussion list.
>> Please keep messages on-topic. Check the FAQ at:
>> http://www.vtk.org/Wiki/VTK_FAQ
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers




More information about the vtkusers mailing list