tcl 8.3 + Img 1.2.4 - can not load Img

Viewed 25

sorry I am noob in TCL.

The Img Library is here:

/tcl_tk/libtk_8.3.2/libimg1.2.so
/tcl_tk/libtk_8.3.2/libimg1.2.4.so

The colleague build the script left the company years ago. So can not ask him :-(

At the system (AIX) is tcl from IBM Packet installed. And the older Version here /tcl_tk

When check path with:

puts $tcl_pkgPath
puts $auto_path

Got this:

/opt/freeware/lib
/opt/freeware/lib/tcl8.4 /opt/freeware/lib /usr/lib

How can I change the PATH (tcl_pkgPath) to:

/tcl_tk/libtk_8.3.2 and /tcl_tk/libtcl_8.3.2
1 Answers

Unless you're creating a new package, just pretend that tcl_pkgPath doesn't exist.

auto_path is a list. To append additional paths, use the lappend command:

lappend auto_path path1 path2 path3

To completely redefine auto_path, then use set:

set auto_path [list path1 path2 path3]

I see that the library you want end with .so, so it's a C-extension. I believe you need to use load instead of package require for this.

See more about load: https://wiki.tcl-lang.org/page/load

Related