Compile and link switches for building dynamically linkable libraries

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:


  1. 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.

  2. 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.

  3. 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:


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:


Related concepts
Creating user-defined functions
User-defined function restrictions
SQL data types
Related tasks
Calling user-defined functions
Dropping user-defined functions
Granting and revoking permissions


Created November 2, 2009. Send feedback on this help topic to Sybase Technical Publications: pubs@sybase.com