#include <exp_main.h> cc files... -lexptcl -ltcl
Briefly, this library allows C programs to provide Expect commands along with Tcl commands. See the Tcl documentation on how to integrate Tcl with a C program (the tclTest program is a good example). To add the Expect calls, add include the file "exp_main.h" and a call to exp_init(interp), where interp has been defined from Tcl_CreateInterp().
Expect's main (in exp_main_exp.c) is an example of this.
Design and implementation of the expect library was paid for by the U.S. government and is therefore in the public domain. However the author and NIST would like credit if this program and documentation or portions of them are used.