The sample programs and the procedures to build them are installed, by default, in the $SYBASE/sample/monclt directory. The two versions of the build procedure are:
Makefile, which uses the native ANSI compiler and linker
Makefile_gcc, which uses the GNU C compiler and linker
To build and run the sample programs, use the following steps:
If the entries for the Adaptive Server, Monitor Server, and Historical Server that you intend to use with the examples do not appear in your interfaces file, add the entries. You can use monclt/bin/sybinit to edit the interfaces file.
Copy the sample files from the monclt/sample directory to another directory to keep the original sample for future reference and enable you to edit your own copy.
If you are not already there, change your directory to the directory that contains your copies of the sample files.
Edit the example.h file to supply the names of:
Adaptive Server
Monitor Server
Historical Server
Login name on Adaptive Server
Password
interfaces file location
If you are using the default interfaces file located in the directory indicated by the SYBASE environment variable, you can accept the default null string ("") for the interfaces file name. If you are not using the default interfaces file, specify the full path name of the interfaces file.
Set the MONCLTLIBDIR environment variable to the root installation directory for Monitor Client Library, which is by default, the monclt directory of the Sybase root installation directory:
setenv MONCLTLIBDIR $SYBASE/monclt
You can edit the make files and change the value of the SYBASE variable to point to a different Sybase root directory. By default, it points to $MONCLTLIBDIR.
Use the make utility to build the test programs.
If you use the native UNIX make utility, enter:
make all
If you use the GNU compiler, enter:
make -f Makefile_gcc
Run the sample programs.
To run the program that retrieves and displays live data from Monitor Server, enter:
./testmon
To run the program that creates a recording session using Historical Server, enter:
./testhist