[AD] question about dll linking...

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


hi! sat in front of my computer yesterday and tried to edit the mingw32 makefile so that it shouldn't need an export definition file. however when linking to the allegro dll, i get the following error messages:
 
gcc -Wall -Wno-unused -mpentium -O2 -funroll-loops -ffast-math -fomit-frame-poin
ter -fno-strength-reduce -I. -I./include -o obj/mingw32/alleg/demo.o -c demo/dem
o.c
demo/demo.c:1095: initializer element is not constant
demo/demo.c:1095: (near initialization for `anim_type_dlg[0].proc')
demo/demo.c:1096: initializer element is not constant
demo/demo.c:1096: (near initialization for `anim_type_dlg[1].proc')
demo/demo.c:1099: initializer element is not constant
demo/demo.c:1099: (near initialization for `anim_type_dlg[4].proc')
demo/demo.c:1100: initializer element is not constant
demo/demo.c:1100: (near initialization for `anim_type_dlg[5].proc')
demo/demo.c:1101: initializer element is not constant
demo/demo.c:1101: (near initialization for `anim_type_dlg[6].proc')
make: *** [obj/mingw32/alleg/demo.o] Error 1
... which makes sense to me since the demo tries to initialize a pointer to a dynamically loaded function compile-time. but why does the dll created with dllwrap and an export definition file just work??? does dllwrap automatically create wrapper functions for all exported functions or what? i didn't find anything in the mingw docs and i have tried to ask the same question on the mingw mailinglist but all i got was lame answers. i could of course rewrite the code to init the table run-time, but there are many programs out there which will be affected if i just apply my patch.
 
to check out the changes, apply the attached patch to a current cvs snapshot, set the environment variable OMIT_EXPDEF=1 and run make.
note: this requires that you have the latest 'ld' package from sourceforge installed.
 
-henrik
 

Attachment: noexpdef.diff
Description: Binary data



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/