dlopen a.exe
Jon Cook
cookj@cs.man.ac.uk
Wed May 31 03:32:00 GMT 2000
Hi,
Can you use dlopen with the pathname set to 0 to open a.exe?
When I tried doing this with the code below, dlsym failed with "Win32
Error 127".
Thanks for any help,
Jon
#include <dlfcn.h>
float fn(float num)
{
return num*5.0;
}
int main(void)
{
void *hnd, *fnaddr;
hnd= dlopen(0, RTLD_NOW);
if (!hnd) {
printf("Failed at dlopen - %s\n", dlerror());
exit(1);
}
fnaddr= dlsym(hnd, "fn");
if (!fnaddr) {
printf("Failed at dlsym - %s\n", dlerror());
exit(1);
}
printf("OK [%x]\n", fnaddr);
}
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com
More information about the Cygwin
mailing list