This section explains the process of compiling an RPC plugin for a Windows platform.
If you are on Microsoft Windows and are using Microsoft's Visual Studio, please do the following:
#include "c8rpc.h" #include "c8_http_client.h" // exporting stuff from dll #if defined(_MSC_VER) #define USER_ADAPTER_EXPORT __declspec( dllexport ) #else // defined(_MSC_VER) #define USER_ADAPTER_EXPORT #endif // defined(_MSC_VER) // forward declarationsof RPC plugin callback functions #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ USER_ADAPTER_EXPORT C8Status c8_rpc_http_initialize (C8Rpc * rpc_ctx); USER_ADAPTER_EXPORT C8Status c8_rpc_http_execute (C8Rpc * rpc_ctx, const C8Message *); USER_ADAPTER_EXPORT void c8_rpc_http_shutdown (C8Rpc * rpc_ctx); #ifdef __cplusplus } /* extern "C" */ #endif /* __cplusplus */
You can customize the names shown in bold but the names used in the source code file and the names used in the c8-services.xml file must match.
To do this, go to the menu, click on "Project" and then on "Properties". You should get a new window titled something like "MySample Property Pages".
In the left-hand pane of this window, click on "Configuration Properties", then on "C/C++", and then on "General".
The right-hand pane should now show a list of settings that you may modify.
Click in the field to the right of Additional Include Directories and add the directory that contains the files c8rpc.h and c8_client_http.h (which are included with the Sybase CEP product).
On 32-bit Microsoft Windows, this directory containing c8rpc.h is typically:
C:\Program Files\SybaseC8\Server\sdk\c\include
On 64-bit Microsoft Windows, this directory is typically:
C:\Program Files (x86)\SybaseC8\Server\sdk\c\include
The directory containing c8_http_client.h depends upon where you've copied this file to.
You can also add other directories if necessary.
To do this, go to the left-hand pane in the Property Pages window, click on "C/C++" and then on Precompiled headers, then click on "Create/Use Precompiled Header" and set it to "Not Using Precompiled Headers".
In the field to the right of "Additional Library Directories", add the directory that contains the Sybase CEP library.
On 32-bit Microsoft Windows, this directory is typically:
C:\Program Files\SybaseC8\Server\sdk\c\lib
On 64-bit Microsoft Windows, this directory is typically:
C:\Program Files (x86)\SybaseC8\Server\sdk\c\lib
In the field to the right of Additional Dependencies, enter
c8_sdk_server_lib.lib nspr4.lib plc4.lib libxml2.lib
You do not need to enter the complete path; entering the file name is sufficient.)
If you'd like to double check that you haven't skipped a step, you can look at the Command Line for the C/C++ compiler and for the Linker. These show the command-line parameters passed from Microsoft's GUI IDE to the command-line compiler and linker.
To view the command line for the C/C++ compiler, go to the left-hand pane of the Property Pages window, click on "C/C++" and then click on "Command Line".
Now that you have entered all the project properties, click the "OK" button on the Property Pages window. At this point, you should be ready to compile.
C:\Program Files\SybaseC8\Server\bin