Using a Command Line Compiler

This section explains the process of using a command line compiler to compile an RPC plugin.

If you are using a command line compiler (such as "cc"), please perform the following steps.

  1. Create a script to compile the RPC plugin. The example below is based on the "cc" compiler found on many UNIX-like operating systems.
    cc -I${HOME}/sybasec8/server/sdk/c/include \
            -o libmma.so \
            -L${HOME}/sybasec8/server/sdk/c/lib/ \
            -lc8_sdk_server_lib -lnspr4 -lplc4 -llibxml2\
            -fPIC \
            -shared \
            mma.cpp
    

    where mma.c is the name of your source code file and libmma.so is the name you'd like to use for the library file.

    -I specifies the directory(s) to be searched for #include files.

    -o specifies the name of the output file. Typically, this is a shared library file.

    -L specifies the directory(s) to search for library files that need to be linked with this one.

    -l specifies the names of the Sybase CEP libraries to link with to use the Sybase CEP functions.

    -fPIC specifies that the compiler should generate Position-Independent Code for dynamic linking.

    -shared specifies that the output will be a shared object library file as opposed to a stand-alone executable program.

  2. Compile the code by executing the script.
  3. Copy the shared library file to the server's bin directory. For example:

    /home/<userid>/sybasec8/server/bin