Building the sample applications

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:

To build and run the sample programs, use the following steps:

  1. 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.

  2. 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.

  3. If you are not already there, change your directory to the directory that contains your copies of the sample files.

  4. Edit the example.h file to supply the names of:

    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.

  5. 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
    
  6. 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.

  7. 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
    
  8. 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