Use the following compile and link switches when building dynamically linkable libraries for any user-defined function.
The following steps are required to build a UDF dynamically linkable library:
A UDF dynamically linkable library must include an implementation of the function "extfn_use_new_api()". The source code for this function is listed under Setting the dynamic library interface. This function informs the server of the API style that all functions in the library adhere to. The sample source file "my_main.cxx" contains this function and can be used without modification.
A UDF dynamically linkable library must also contain object code for at least one UDF function. A UDF dynamically linkable library may optionally contain multiple UDFs.
Link together the object code for each UDF as well as the extfn_use_new_api() to form a single library.
For instance, steps for building the example dynamically linkable library "libudfex" would consist of:
Compiling each source file to produce an object file.
my_main.cxx my_bit_or.cxx my_bit_xor.cxx my_interpolate.cxx my_plus.cxx my_plus_counter.cxx my_sum.cxx
Linking together each object produced into a single library.
The next section lists platform specific recommendations for compiling source files and linking objects to form a UDF dynamically linkable library. Other versions of compilers may work, these specific examples are provided as a guide
After the dynamically linkable library has been compiled and linked, complete one of the following tasks:
On Unix variants, this can be done by modifying the LD_LIBRARY_PATH within the start_iq startup script. While LD_LIBRARY_PATH is universal to all UNIX variants, SHLIB_PATH is preferred on HP, and LIB_PATH is preferred on AIX.
On Unix platforms, the external name specification can contain a fully qualified name, in which case the LD_LIBRARY_PATH is not used. On the Windows platform, a fully qualified name cannot be used and the library search path is defined by the PATH environment variable.