Chris Twiner said:
> Also I'm still a little confused as to why you needed to change the
> build dll script anyway, what release of cygwin are you using?
> Maybe I and the others have an older/newer version.
So, the fundamental problem is that gcc-3.2 does name mangling in a
different way than gcc-2.95. In xwinclip.c you have code which
references "SetHook__Fv" and "RemHook__Fv". Under gcc-2.95, SetHook
gets mangled to _SetHook__Fv and so it is found properly. Under
gcc-3.2, SetHook gets mangled to __Z7SetHookv, so it isn't found.
This is the fundamental problem with mixing C++ and C code together.
I've attached a patch to take care of the problem.
--- xwinclip_hook.cpp.orig 2002-10-24 07:51:37.000000000 -0400
+++ xwinclip_hook.cpp 2002-10-24 08:05:50.000000000 -0400
@@ -125,6 +125,7 @@
}
+namespace std { extern "C" {
__declspec(dllexport) int
SetHook () {
@@ -148,6 +149,7 @@
UnhookWindowsHookEx(XWinclip_hook->hhHookHandle);
return 1;
}
+}}
extern "C" int WINAPI
DllMain(HINSTANCE hinst, unsigned long reason, void*)
--- xwinclip.c.orig 2002-10-24 08:07:42.000000000 -0400
+++ xwinclip.c 2002-10-24 08:07:45.000000000 -0400
@@ -477,7 +477,7 @@
}
g_hinstanceActivateHookDLL=hinstanceActivateHookDLL;
- pSetHookFunc = (HookFunction)GetProcAddress(hinstanceActivateHookDLL,
"SetHook__Fv");
+ pSetHookFunc = (HookFunction)GetProcAddress(hinstanceActivateHookDLL, "SetHook");
if (pSetHookFunc==NULL)
{
@@ -486,7 +486,7 @@
return 1;
}
- phcRemHookFunc = (HookFunction)GetProcAddress(hinstanceActivateHookDLL,
"RemHook__Fv");
+ phcRemHookFunc = (HookFunction)GetProcAddress(hinstanceActivateHookDLL,
+"RemHook");
if (phcRemHookFunc==NULL)
{
printf("could not get rem hook func \n");