Re: compiling g_module plugin on (cygwin) win32



Olivier Sessink writes:
How can I fix the linking stage on cygwin/win32 ??

First, mark the functions in the sources for the main .exe that are to
be used by other modules with G_MODULE_EXPORT.

Then you must decide whether you want to 1) restrict your plugins to
work only with an executable with the *exact* name you specify, or
whether you want it to be 2) more flexible and work even if you happen
to rename the main executable.

In case 1), create an import library for the .exe using dlltool, and
link the plugin against that import library. 

In case 2), use g_module_open(NULL, 0) to get a GModule handle for the
main executable, and the g_module_find() the function from it, and
call it.

--tml




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]