Forum OpenACS Q&A: using Package Command..

Collapse
Posted by Jerome M on
i have a page tcltest.tcl and tcltest.adp i added

package require TGDChart

but it caused an error? are they ways on  loading this package.... i need this for graphing some charts..

[05/Mar/2003:16:38:17][12149.4101][-conn1-] Error: GET /tcltest  can't find package TGDChart
    while executing
"package require TGDChart"
    ("uplevel" body line 2)
    invoked from within
"uplevel {
          package require TGDChart

set sd [dt_widget_datetime -default now start seconds]

Collapse
Posted by Robert Locke on
I recall once trying "package require", failing miserably, and resorting to "load /path/to/library.so", which worked.

Relatedly, you might also want to create a separate package called "tgdchart" (or whatever) containing a single "tgdchart-init.tcl" file which simply loads "libtgdchart.so".  You could make the location of libtgdchart.so a parameter as well.

Hope this helps...

Collapse
Posted by Jamie Rasmussen on
You could try the workarounds here:
https://openacs.org/forums/message-view?message_id=26875
http://www.mail-archive.com/aolserver@listserv.aol.com/msg04459.html
http://ccm.redhat.com/bboard-archive/webdb/000dPR.html

Or, "package require" is supposed to work out of the box with AOLserver 4. I just tried loading a package from tcllib and it seems to.

Also, there used to be a module for AOLserver called ino_chart that was an interface to GDChart. Its author abandoned it, but someone around here might have a copy you could try.

Collapse
Posted by Roberto Mello on
When I had to use tgdchart, I resorted to using load. I'm so glad AOLserver 4 deals with package require without the need for extra hacks.

There are alternatives to tgdchart though. This thread talks about them with examples included:

https://openacs.org/forums/message-view?message_id=44869

-Roberto