On Wed, 1 Oct 2003, Harold L Hunt II wrote:
Alexander Gottwald wrote:
Have you tested this with programs which uses libXt and some widgets from
another library?
Yeah, that is what I was saying above. I built a shared version, made
some changes, and rebuilt some clients (xman.exe, xcalc.exe, etc.), but
they keep giving the unresolved inheritence error as above.
The location of _XtInherit still differs in dll and program.
Actually, if you look at
xc/config/cf/ibmLib.rules/SharedLibraryTarget(), you see that
sharedlib.o (which is contained in $(UNSHAREDOBJS)) is linked directly
into the import library, not into the shared library. The idea is that
each application linked against libXt should end up with one copy of the
sharedlib.o code. Thus, comparisons against _XtInherit will work just
fine within one application, which is the only case that we are
concerned with.
no. The structures of the dll are initialized with dll_base + x and the
structures from the program are inititalized with program_base + y. Even
if we find a way to have x == y, the symbols still differ because the
dll is placed on a different place than the program.
Simple testprogram:
--x.h
typedef void (*func)(void);
extern void _XtInherit(void);
typedef struct { func callback; } x;
extern x x1, x2;
--xtinherit.c
#include "x.h"
void _XtInherit(void) {
}
--x1.c
#include "x.h"
x x1 = { _XtInherit };
--x2.c
#include "x.h"
x x2 = { _XtInherit };
--xtest.c
#include "x.h"
#include <stdio.h>
int main(void) {
printf("x1.callback: %p\n", x1.callback);
printf("x2.callback: %p\n", x2.callback);
return 0;
}
--build.sh
gcc -shared -o x1.dll x1.c xtinherit.c