MinGW build



Hi,

I've been building things on MinGW. I saw earlier posts on compiling Gtk2 on MinGW, two problems were mentioned: too long lines and DynaLoader failing to load Gtk2.dll. I solved the too long lines problem simply by using xs/*.o instead of the long list. For the 2nd problem I don't have a complete solution but I at least manage to get Gtk2.dll loaded ok with a tool called "dependency walker", which is a tool for debugging DLLs. First I gave the export table of the Glib.dll a better name (Glib.dll) than dll.exp.dll using the -D switch of dlltool. The I copied the Glib.dll to a directory in a path, so windows finds it. After these dependence walker loads Gtk2.dll nicely.

But the DynaLoader still can't load Gtk2.dll. I made a simple test program:

#include <stdio.h>
#include <windows.h>
int main()
{
   int err;
LoadLibraryEx("d:\\mingw\\bin\\Gtk2.dll", NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
   err = GetLastError();
   fprintf(stderr,"%i\n",err);
}

this gives a strange error 487 (Attempt to access invalid address), of which there is not much to be found. Using LOAD_LIBRARY_AS_DATAFILE works.

DLLs which are part of Perl modules usually have the name dll.exp.dll in their export table. They are also loaded in the run-time. A wild guess: maybe having to specify Glib.dll when Gtk2.dll is linked, leads to having to put Glib.dll in the path and maybe it is loaded somehow differently than usual Perl module dlls??

Ari

--
Prof. Ari Jolma
Kartografia ja Geoinformatiikka / Cartography and Geoinformatics
Teknillinen Korkeakoulu / Helsinki University of Technology
POBox 1200, 02015 TKK, Finland
Email: ari.jolma at tkk.fi URL: http://www.tkk.fi/~jolma




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