This is the mail archive of the
cygwin@sourceware.cygnus.com
mailing list for the Cygwin project.
dlopen a.exe
- To: cygwin at sourceware dot cygnus dot com
- Subject: dlopen a.exe
- From: Jon Cook <cookj at cs dot man dot ac dot uk>
- Date: Wed, 31 May 2000 11:32:36 +0100 (BST)
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