Apama 10.15.0 | Developing Apama Applications | Developing EPL Plug-ins | Writing EPL Plug-ins in C++ | Creating a plug-in using C++ | Compiling C++ plug-ins
 
Compiling C++ plug-ins
To compile a C++ plug-in, you need to do the following:
1. Add #include <epl_plugin.hpp> to the source file.
2. Put $APAMA_HOME/include on your compiler's include path.
3. Link the plug-in with apclient.dll (Windows) or libapclient.so (Linux).
4. Put $APAMA_HOME/lib on your compiler's linker path.
5. Enable C++11 standards mode.
6. Compile your class into a shared library .dll (Windows) or .so (Linux).
Using GCC on Linux this would look like this:
g++ --shared --std=c++0x -I$APAMA_HOME/include -L$APAMA_HOME/lib -lapclient -o libMyPlugin.so MyPlugin.cpp
You can find example makefiles (Linux) and Visual Studio project files (Windows) in the samples directory of your Apama installation.
The C++ EPL plug-in API is implemented using a C-only ABI, even though it has a C++ API. This means that there is no requirement to compile your plug-in library with a specific compiler or compiler version. However, the compiler must support the C++ 11 syntax used in the API header files. We recommend use of the compilers specified in the Supported Platforms document for the current version, which is available from the following web page: https://documentation.softwareag.com/apama/index.htm.
If you are building a shared library to be used by multiple plug-ins and using the plug-in-specific data structures as part of your API between the library and the plug-ins, then you must ensure that the library and all of the plug-ins are compiled using the same version of the Apama header files. This means that if you upgrade Apama and want to recompile one of them, you must recompile all of them. You can choose not to recompile anything and they will still work.
If you compile with headers from multiple service packs of Apama, then you may see errors similar to the following when you try to link them.
*Linux :
undefined reference to `Foo::test(com::softwareag::connectivity10_5_3::data_t const&)'
*Windows:
testlib2.obj : error LNK2019: unresolved external symbol "public: void __cdecl Foo::test(class com::softwareag::connectivity10_5_3::data_t const &)" (?test@Foo@@QEAAXAEBVdata_t@connectivity10_5_3@softwareag@com@@@Z) referenced in function "public: void __cdecl Bar::test(class com::softwareag::connectivity10_5_3::data_t const &)" (?test@Bar@@QEAAXAEBVdata_t@connectivity10_5_3@softwareag@com@@@Z)
testlib2.dll : fatal error LNK1120: 1 unresolved externals
If you encounter a similar error, try recompiling all your components with the same version of the headers.
If you are compiling a single plug-in, or multiple completely independent plug-ins, you can recompile them in any combination at any time.