This section describes the steps required and settings you need to modify in order to compile an in-process adapter.
To compile your in-process adapter, you must specify appropriate settings for your compiler, including:
If you are on Microsoft Windows, you can use Microsoft's Visual Studio. If you are using Visual Studio, perform the following actions to compile your in-process adapter:
To do this, go to the menu, click on "Project" and then on "MySample Properties".
You will get a new window titled "MySample Property Pages". In the left-hand pane of this window, click on "Configuration Properties", then on "", and then on "General".
The right-hand pane should now show a list of settings that you can modify. Click in the field to the right of "Additional Include Directories" and add the directory that contains the c8adapters.h file which is included with the Sybase CEP product.
On Microsoft Windows, this directory is typically:
C:\Program Files\SybaseC8\Server\sdk\c\include
On64-bit Microsoft Windows, this directory is typically:
C:\Program Files (x86)\SybaseC8\Server\sdk\c\include
You can add other directories if necessary for your in-process adapter.
In the field to the right of "Additional Library Directories", add the directory that contains the library.
On 32-bit Microsoft Windows, this directory is typically:
C:\Program Files\SybaseC8\Server\sdk\c\lib
On 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
(Note that you do not need to enter the complete path; entering the file name is sufficient.)
If you are using Microsoft's Visual C development and environment and 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 the "Command Line" for the Linker.
To view the command line for the compiler, go to the left-hand pane of the Property Pages window, click on "C/C++" and then click on "Command Line". The command line should look similar to the following:
/Od /I "C:\Program Files\SybaseC8\Server\sdk\c\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_USRDLL" /D "INPROCESSOUTPUTADAPTER4_EXPORTS" /D "_WINDLL" /D "_UNICODE" /D "UNICODE" /Gm /EHsc /RTC1 /MDd /Fo"Debug\\" /Fd"Debug\vc80.pdb" /W4 /nologo /c /Wp64 /ZI /TP /errorReport:prompt
If you set the warning level to a value other than 3, then the "/W3" will be different.
The command line can or can not include
/D "_DEBUG"
If the command line includes this, you can only be able to use the .DLL on a computer that has the debug version of the C runtime library. (For more information, see the Troubleshooting section.)
To view the command line for the linker, go to the left-hand pane of the Property Pages window, click on "Linker" and then click on "Command Line". The command line should look like the following:
/OUT:"C:\c8test\E2\C_SDK\Adapter4\Adapter4\Debug\Adapter4.dll" /INCREMENTAL /NOLOGO /LIBPATH:"C:\Program Files\SybaseC8\Server\sdk\c\lib" /DLL /MANIFEST /MANIFESTFILE:"Debug\Adapter4.dll.intermediate.manifest" /SUBSYSTEM:WINDOWS /MACHINE:X86 /ERRORREPORT:PROMPT c8_sdk_server_lib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
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.
cc -I${HOME}/sybasec8/server/sdk/c/include \ -o libmma.so \ -L${HOME}/sybasec8/server/sdk/c/lib/ \ -lc8_sdk_server_lib \ -fPIC \ -shared \ mma.c
where "mma.c" is the name of your source code file and "libmma.so" is the name you want to use for the library file.
Alternatively, use a makefile or other technique to compile the file.