From: Henrik S. <hst...@pr...> - 2001-04-19 16:48:06
|
"Lloyd Dupont" <Llo...@wa...> wrote: > maybe it's a stupid question but do you have tagged your function > with tag such as (i don't have my resource here, so lot of syntax > error) _declspec(dllimport) ? > > personally in my top level headr i have something like > > #ifdef WIN32 > #ifdef BUILD_DLL > #define DLL_OBJECT _declspec(dllexport) > #else > #define DLL_OBJECT _declspec(dllimport) > #endif > #else > #define DLL_OBJECT > #endif > and i tag all my function like this > > DLL_OBJECT void aUselessDLLFunction(); > > or > class DLL_OBJECT DLLCPPClass > { > }; > > ....... > i hope the problem is here..... i'm not sure if you understood my problem. the problem is that using dllwrap and an export definition file you can put a pointer to an exported function in a struct table, but when i drop the export definition file, that is no longer allowed. gcc is telling me the function's addess is not constant. sure, i can fix this by initializing the table run-time, but i would very much like to know why using an export definition file just works... currently the mingw specific header contains this. _AL_DLL beeing the export 'tag'. --- #if (defined ALLEGRO_STATICLINK) #define _AL_DLL #else #if (defined ALLEGRO_SRC) #define _AL_DLL __declspec(dllexport) #else #define _AL_DLL __declspec(dllimport) #endif #endif #define AL_VAR(type, name) extern _AL_DLL type name #define AL_ARRAY(type, name) extern _AL_DLL type name[] #define AL_FUNC(type, name, args) type __cdecl name args #define AL_METHOD(type, name, args) type (*name) args #define AL_FUNCPTR(type, name, args) extern _AL_DLL type (*name) args --- -henrik |