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

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



I am not sure if it is a referencing or loading problem.

One point that is not clear to me:

Is the function lt_dlopen( path ) working correctly on Macosx ?

Reference:
         *pLdHandle = lt_dlopen( path );
./openldap-2.3.20/servers/slapd/slapi/plugin.c

because at http://developer.apple.com/technotes/tn2002/tn2071.html  
Apple writes:

Many applications being ported to Mac OS X utilize APIs such as  
dlopen, dlgets,
and dlclose these are not supported on Mac OS


They suggest to change it to:

For example, if your code contains something similar to:

	const char *filename = argv[1];
	void *handle = dlopen(filename, RTLD_NOW);

You should replace it using the following:

	const char *filename = argv[1];
	NSObjectFileImage *fileImage;
	NSModule handle;
	NSObjectFileImageReturnCode *returnCode =
	NSCreateObjectFileImageFromFile(filename, &fileImage);

	if(returnCode == NSObjectFileImageSuccess)
	{
	    	handle = NSLinkModule(fileImage,filename,
         	NSLINKMODULE_OPTION_RETURN_ON_ERROR|  
NSLINKMODULE_OPTION_PRIVATE);
     		NSDestroyObjectFileImage(fileImage);
     		if (handle) {
   /* do whatever else your code does *


Maybe the plugin.c need a

#if defined (__APPLE_CC__)

---------------

Another idea could be as you already mentioned to change compiler  
flages while building the libslapi.

Hope that there is any Mac freak out there...