[Date Prev][Date Next] [Chronological] [Thread] [Top]

(ITS#4642) failed to load plugin /tmp/openldap/plugin/hello.dynlib: dlopen(/tmp/openldap/plugin/hello.dynlib, 9): Symbol not found: _slap_cids

Full_Name: Andreas Bohne
Version: 2.3.20 
OS: MacOSX 1.4
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (

Trying to port a plugin to MacOsX I run into trouble.
The plugin is running fine on Solaris (Sun) but on MacOSX the plugin is not

line 91 (pluginlog /tmp/openldap/plugin/)
line 93 (plugin postoperation /tmp/openldap/plugin/hello.dynlib hello_init)
failed to load plugin /tmp/openldap/plugin/hello.dynlib:
dlopen(/tmp/openldap/plugin/hello.dynlib, 9): Symbol not found: _slap_cids
  Referenced from: /tmp/openldap/lib/libslapi-2.3.0.dylib
  Expected in: flat namespace

/tmp/openldap/etc/openldap/slapd.conf: line 93: <plugin> handler exited with 1!

The plugin was compiled as a shared library:

gcc -dynamiclib  -I/tmp/openldap/include -o hello.dynlib  hello.c 
-L/tmp/openldap/lib/ -lslapi

(btw I also tried this:
cc -dynamiclib -flat_namespace -undefined suppress -o hello.dynlib
-L/tmp/openldap/lib -lslapi  -install_name  hello.dylib
-Wl,-compatibility_version -Wl,3 -Wl,-current_version -Wl,3.8 hello.c but same

Googleing a couple of pages I found this at

>Many applications being ported to Mac OS X utilize APIs such as dlopen, dlgets,
and >dlclose these are not supported on Mac OS X. Below are listed these APIs
along with >some alternative APIs or suggestions that will allow port your
application to Mac OS >X.
Could this cause the problem?

Attached my hello.c:
#include <stdio.h>
#include "slapi-plugin.h"

Slapi_PluginDesc desc = {
"Hello, World", /* plug-in identifier */
"MyVendor", /* vendor name */
"5.2", /* plug-in revision number */
"My first plug-in" /* plug-in description */

/* Log a greeting at server startup if info logging is on for plug-ins */
hello(Slapi_PBlock *pb)

        Slapi_Entry     *entry;

        if( slapi_pblock_get(pb, SLAPI_SEARCH_TARGET , &entry) != 0){
                slapi_log_error(SLAPI_LOG_PLUGIN, "Mein Plugin" ,  "error" );
                return -1;

        fprintf(stderr,">Plug-in> Search (%s)\n",entry);

        return 0;

hello_init(Slapi_PBlock * pb)
        int rc = 0; /* 0 means success */
        rc |= slapi_pblock_set( /* Plug-in API version */ pb,
        rc |= slapi_pblock_set( /* Plug-in description */ pb,
        rc |= slapi_pblock_set( /* Startup function */ pb,
        return rc;

Greetings Andreas