This is the mail archive of the
cygwin-apps
mailing list for the Cygwin project.
Re: [ITP] perl-Tk
On Sun, Nov 20, 2005 at 12:34:33AM -0500, Charles Wilson wrote:
> Yitzchak Scott-Thoennes wrote:
>
> >Hence the suggestion of using the features provided by the
> >alternatives package. Am I correct in assuming this works even for
> >dynamically loaded dlls?
> >
>
> No. It works for .so's on Linux, because the Linux loader understands
> symlinks. Cygwin piggybacks on the Window Runtime Loader, which does
> NOT understand symlinks (nor shortcuts!). Because alternatives relies
> entirely on symlinks, it doesn't work for DLLs on windows.
WJFFM (perhaps you missed the "dynamically"?):
$ cat mydll.c
#include <stdio.h>
void hello(void)
{
printf ("Hello World!\n");
}
$ gcc -Wall -shared -o mydll.dll mydll.c
$ ln -s mydll.dll mydllalternate.dll
$ cat myprog.c
#include <dlfcn.h>
int main(int argc, char **argv)
{
void *dlh = dlopen("mydllalternate.dll", RTLD_NOW);
void (*dls)(void) = dlsym(dlh, "hello");
dls();
return 0;
}
$ gcc -Wall -o myprog.exe myprog.c
$ ./myprog.exe
Hello World!