[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) (134.155.44.4)
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
loaded.
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
problem)
Googleing a couple of pages I found this at
developer.apple.com/technotes/tn2002/tn2071.html
>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 */
int
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;
}
int
hello_init(Slapi_PBlock * pb)
{
int rc = 0; /* 0 means success */
rc |= slapi_pblock_set( /* Plug-in API version */ pb,
SLAPI_PLUGIN_VERSION, SLAPI_PLUGIN_CURRENT_VERSION);
rc |= slapi_pblock_set( /* Plug-in description */ pb,
SLAPI_PLUGIN_DESCRIPTION, (void *) &desc);
rc |= slapi_pblock_set( /* Startup function */ pb,
SLAPI_PLUGIN_POST_SEARCH_FN, (void *) hello);
return rc;
}
Greetings Andreas