User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040919
Hello,
I am porting Satom (http://savannah.nongnu.org/projects/satom) to Mac OS
X platform. I didn't have any troubles in compiling my project (thanks
to Automake/Autoconf). I have a problem at run time with the set of
functions lt_dlopen, lt_dlsym, lt_dlerror, lt_dlclose (from the library
libltdl). Satom needs to load multiple libraries that defines the same
symbol.
I use two libraries to do my testing: stutils and test02. Both libraries
define the symbol _st_factory_create_class as shown with nm:
$ nm libstutils.dylib | grep st_factory_create_class
00000b70 T _st_factory_create_class
000547f0 S st_factory_create_class.eh
$ nm libtest02.dylib | grep st_factory_create_class
00001780 T _st_factory_create_class
0004613c S st_factory_create_class.eh
When I open the libraries and query for the symbol
st_factory_create_class, it works fine for the first library and doesn't
work for the second library opened. So, the following piece of code:
lt_dlhandle handle = lt_dlopen(filename);
if (handle == 0)
{
std::cerr << "error: " << lt_dlerror();
}
std::cout << filename << " (" << handle << ")" << std::endl;
void* fun = lt_dlsym(handle, "st_factory_create_class");
if (fun == 0)
{
std::cerr << "error: " << lt_dlerror();
}
else
{
std::cout << "fun: " << fun;
}
lt_dlclose(handle);
std::cout << std::endl;
prints the following output:
/Users/thomas/Documents/Applications/satom/lib/libstutils.dylib (0x300220)
fun: 0x1008b70
/Users/thomas/Documents/Applications/satom/lib/libtest02.dylib (0x300390)
error: dlcompat: Symbol "_st_factory_create_class" not found
As, you can see, it works well for the first library loaded but never
for the second. Any hint to explain/solve this problem will be greatly
appreciate.
Thank you very much,
Best regards,
Thomas
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Unix-porting mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/unix-porting/email@hidden