C Programmer’s Checklist
Developers of EMS C programs can use this checklist during the five phases of the development cycle.
Install
Install the EMS software release, which includes the EMS client libraries, binaries, and header files.
Code
Application programs must:
- Add EMS_HOME/include to the include path.
- Include the
tibems.h header file:
#include <tibems/tibems.h>
- Programs that use the C administration API must also include the
emsadmin.h header file:
#include <tibems/emsadmin.h>
- Programs that use the unshared state failover API must also include the
tibufo.h header file:
#include <tibems/tibufo.h>
- Call tibems_Open() to initialize the EMS C API and tibems_Close() to deallocate the memory used by EMS when complete.
Compile and Link
- Compile programs with an ANSI-compliant C compiler.
- Link with the appropriate EMS C library files; see Link These Library Files.
See the samples/c/readme.txt file for details.
Link These Library Files
EMS C programs must link the appropriate library files. The following sections describe which files to link for your operating system platform:
UNIX
In UNIX environments, both shared and static libraries are available. We recommend shared libraries to ease forward migration.
Include EMS_HOME/lib in your library path.
Linker Flag | Description |
---|---|
-ltibems -lssl -lcrypto -lz |
All programs must link using these library flags. |
-ltibemslookup -lldap -llber -lxml2 |
Programs that use EMS LDAP lookup must link using these library flags. |
-ltibemsadmin | Programs that use the C administration library must link using this library flag. |
-ltibemsufo | Programs that use the unshared state failover library must link using this library flag. |
Microsoft Windows
For a list of Windows platforms that this release supports, see the file readme.txt in the installation directory. Both DLLs and static libraries are available. We recommend DLLs to ease forward migration.
Library File | Description |
---|---|
With dynamic libraries (DLLs), use the /MT compiler option. | |
tibems.lib libssl.lib libcrypto.lib zdll.lib |
All programs must link these libraries. |
tibemslookup.lib
libldap.lib liblber.lib libxml2.lib |
Programs that use EMS LDAP lookup must link these libraries. |
tibemsadmin.lib | Programs that use the C administration library must link using this library. |
tibemsufo.lib | Programs that use the C unshared state failover library must link using this library. |
Library File | Description |
---|---|
With static libraries (DLLs), use the /MD compiler option. | |
libtibems.lib libssl_static.lib libcrypto_static.lib zlib.lib |
All programs must link these libraries. |
libtibemsadmin.lib | Programs that use the C administration library must link using this library. |
libtibemsufo.lib | Programs that use the C unshared state failover library must link using this library. |