Problems building dlls for use with winelib
Martin Troester
TroyMcClure at web.de
Tue Aug 19 05:47:11 CDT 2003
To simplify the problem, I just created a really simple DLL, just
exporting one function:
============ testlib.c ==============
void tstfunc (void);
void tstfunc (void)
{
int a=7;
//printf ("Hello\n");
}
=====================================
The testlib.spec file exports this function the following way:
========== testlib.spec =============
@ stdcall tstfunc() tstfunc
=====================================
Compiling it like explained before, this is what happens (in this case
no .exe is assumed, but it still fails, and I do not know why...)
(1) winegcc -W -g -O0 -I/usr/include/wine -fPIC -o testlib.o -c
testlib.c
(2) ld -r testlib.o -o libtest.dll.temp.o
(3) strip --strip-unneeded libtest.dll.temp.o
(4) winebuild -fPIC -o testlib.spec.c --spec testlib.spec
libtest.dll.temp.o winegcc -W -g -O0 -I/usr/include/wine
-o testlib.spec.o -c testlib.spec.c
(5) gcc -shared -Wl,-Bsymbolic,-z,defs
testlib.o testlib.spec.o -o libtest.dll.so
(OUTPUT) testlib.spec.o(.text+0x1002d): In function
`__wine_spec_testlib_dll_init':/home/mt/testlib/testlib.spec.c:156:
undefined reference to `__wine_dll_register'
collect2: ld returned 1
exit status make: *** [libtest.dll.so] Error 1
Once again, neither changing the spec-file (removing the function from
being exported) nor adding tstfunc as an entry-point changes anything...
Thus, I assume I am getting something very basic wrong here. Since this
may be of some help in the actual dll building, I would again appreciate
any hints on solving these errors...
Cheers,
Martin--
More information about the wine-users
mailing list