[OTR-dev] Help with Windows dll?

Ian Goldberg ian at cypherpunks.ca
Thu Jul 26 18:55:07 EDT 2007


On Sun, Feb 11, 2007 at 06:17:01PM +0100, Thomas B. wrote:
> I also wanted to test it under Windows, which was a bit trickier. I
> don't know if this can be done in a better way (it's long ago that I
> compiled something for Windows), but it worked for me. First, I
> followed Ian's instructions to set up a cross-compiling environment
> with MinGW under Linux:
> http://lists.cypherpunks.ca/pipermail/otr-users/2006-November/000792.html
> That worked quite well and enabled me to cross-compile the current CVS
> version of gaim-otr. Then, after applying my patch, I needed two extra
> steps:
> 
> 1.) The MinGW environment was lacking a libintl.h. The libintl.h from
> my system was not suitable, as it belongs to glibc (and the code of
> libintl is built into glibc). So I downloaded the gettext package,
> cross-compiled it and installed it into /usr/i586-mingw32msvc/, so
> that I had a libintl.h and a libintl.a in my MinGW environment.
> 
> 2.) Inside gaim-otr, LOCALEDIR needs to be correctly defined so that
> the language files can be found. The tricky thing is that in Win32
> Gaim, the directory containing the locale files is generally only
> known at runtime (it depends on where the user has installed Gaim). So
> in Gaim's win32dep.h, LOCALEDIR is defined as a function call to
> wgaim_locale_dir(). Therefore I included that file in otr-plugin.c,
> and placed win32dep.h and the other headers in libgaim/win32 (from the
> Gaim source tarball) into /usr/i586-mingw32msvc/include/gaim.
> 
> Then, after making some adjustments to Makefile.mingw, I was able to
> cross-compile the patched gaim-otr for Windows with a "make -f
> Makefile.mingw".

I did all that, and I successfully built a pidgin-otr.dll file, but
pidgin (on Windows) won't load it.  pidgin -d complains:

plugins: C:\Program Files\Pidgin\plugins\pidgin-otr.dll is not
loadable: The specified module could not be found.

This error message is the output of g_module_error() when
g_module_open() fails, but I have no idea why that might be happening.

Here's my build line:

i586-mingw32msvc-gcc -g -shared -Wl,--enable-auto-image-base
otr-plugin.o ui.o dialogs.o gtk-ui.o gtk-dialog.o -o pidgin-otr.dll
/usr/i586-mingw32msvc/lib/libotr.a -lgtk-win32-2.0 -lglib-2.0
-lgdk_pixbuf-2.0 -lgobject-2.0 -lpidgin -llibpurple -lgcrypt -lgpg-error
-L/usr/i586-mingw32msvc/lib -lintl

If you'd like to see the dll itself, you can find it at

http://otr.cypherpunks.ca/binaries/windows/pidgin-otr-3.1-preview2.zip

The source is what's currently checked into CVS, which is negligibly
different from the 3.1.0-preview2 I posted this morning.

Any hints would be appreciated.  I know approximately nothing about
Windows.  ;-)

Thanks,

   - Ian



More information about the OTR-dev mailing list