Adding Extensions To Expectk

Adding extensions to Expectk is very similar to adding them to Expect. This section describes only the differences.

The template exp_main_tk.c should be used instead of exp_main_exp.c.

Linking requires the Tk library, so the compile line should look like this:

cc -I/usr/local/include exp_main_tk.c ... \
      -L/usr/local/lib -lexpect -ltk -ltcl -lX11 -lm

As with adding extensions to Expect, you may need to adjust this command also. If this does not work, look at the Tcl and Expect Makefiles to see what libraries they use on your system.

Get Exploring Expect now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.