[Xotcl] "Cannot locate library"
Uwe Zdun
uwe.zdun at wu-wien.ac.at
Tue May 13 11:44:10 CEST 2003
maybe, what you have overlooked in my patch was that there is a "return"
in:
if {![info exists success]} {
#puts stderr "Cannot locate the XOTcl library on your system!"
return
}
BTW, ::xotcl::lib is always set at this point. Before the method
"check_library_path", xotcl.c sets it to the compiled-in default. the
auto_path should only be changed if we learn in check_library_path that we
want to change it (and not to the compiled-in default). The code below
does not work, because you use the wrong package name:
% package require XOTcl
1.0
% namespace import ::xotcl::*
% package require package
can't find package package
% package require xotcl::package
0.91
the C findXOTcl searches for the xotcl .so/.dll and is not related
to the "check_library_path" method. Its only used in the xotclAppInit.c
fake shell, not in xotcl.c
I would still propose the patch from yesterday.
--uwe
On Monday 12 May 2003 22:14, Gustaf Neumann wrote:
> On Monday 12 May 2003 20:04, Uwe Zdun wrote:
> > Looking through this code again, the ::xotcl::lib is not really used in
> > XOTcl's code anymore ...
>
> hmm? The line after the error message says:
> set ::auto_path [concat $::xotcl::lib $::auto_path]
> if the variable is not set, you get the error message there.
> it is certainly possible to set a default value, say from the
> configure prefix....
>
> The more sensible change is to use the patch below, which will
> be ok, when you load xotcl via xotclsh, but will not find xotcl
> packages, when xotcl is loaded via tclsh; try:
>
> tclsh
> package require XOTcl
> namespace import ::xotcl::*
> package require package
>
> Currenty, xotcl does a patch checking in C (findXOTcl.c) and
> in tcl (predefined.xotcl). my hope was rather to get rid of the c-code...
> The background of this code is as follows:
> - tcl searches the libraries in auto_path and the subdirs of that.
> - with xotcl i would like the get one more level to organize the
> xotcl packages more nicely.
> - therefore the xotcl library is added to the auto_path.
> We would not need the library, when we assemble a large
> tclIndex.tcl file in the xotcl directory. Maybe that is the better
> way... we will check this more carefully...
>
> best regards
> -gustaf
>
> -- predefined.xotcl~ 2003-04-24 22:49:14.000000000 +0200
> +++ predefined.xotcl 2003-05-12 21:48:20.000000000 +0200
> @@ -357,12 +357,9 @@
> }
> }
>
> - if {![info exists success]} {
> - puts stderr "Cannot locate the XOTcl library on your system!"
> - return 0
> + if {[info exists ::xotcl::lib]} {
> + set ::auto_path [concat $::xotcl::lib $::auto_path]
> }
> - #puts stderr "[info exists success] <$::xotcl::lib>"
> - set ::auto_path [concat $::xotcl::lib $::auto_path]
>
> #
> # and forget all "xotcl::" packages in Tcl's packageTable so that they
--
Uwe Zdun
Department of Information Systems, Vienna University of Economics
Phone: +43 1 313 36 4796, Fax: +43 1 313 36 746
zdun@{xotcl,computer,acm}.org, uwe.zdun at wu-wien.ac.at
More information about the Xotcl
mailing list