Include Files
Any files that make references to the Expect library must include the following statement. The statement should appear before any Expect functions are called.
#include "expect.h"
This statement works for both C and C++ programs.
Some of the Expect library functions work with the C standard I/O package. If you use these parts of the library, you must also include that header as well.
#include <stdio.h>
If the compiler needs to be told where the Expect include files come from, add an appropriate argument to the compile command. For example, to compile foo.c, you might have to say:
cc -I/usr/local/include foo.c
The precise filename depends on where the include files have been installed. As before, the Tcl include files should also be available. Normally, both the Expect and Tcl include files live in the same directory, so one −i flag should suffice.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access