Compiling and linking source code to build dynamically linkable libraries

Use compile and link switches when building dynamically linkable libraries for any user-defined function.


  1. A UDF dynamically linkable library must include an implementation of the function extfn_use_new_api(). The source code for this function is in 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; you can use it 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 example, to build the library "libudfex:"


After the dynamically linkable library has been compiled and linked, complete one of these tasks:


Related concepts
User-defined function restrictions
Maintenance of user-defined functions
SQL data types
Related tasks
Creating a user-defined function
Calling user-defined functions
Setting the dynamic library interface
Dropping user-defined functions
Granting and revoking permissions
Using Microsoft Visual Studio debugger for user-defined functions