[OTR-dev] Help with Windows dll?

Martin Gentry mgentry at ieee.org
Thu Jul 26 19:33:48 EDT 2007


----- Original Message ----- 
From: "Ian Goldberg" <ian at cypherpunks.ca>
To: "Thomas B." <Tommy.B at gmx.net>
Cc: <otr-dev at lists.cypherpunks.ca>
Sent: Thursday, July 26, 2007 6:55 PM
Subject: [OTR-dev] Help with Windows dll?


> 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.  ;-)

I know this might not really help much since I don't offhand know how to 
remedy the problem, but the dll you built wants a libintl-8.dll to be 
available whereas the GTK+ runtime that got installed when I just installed 
pidgin on a Windows box includes intl.dll, not libintl-8.dll.

-martin




More information about the OTR-dev mailing list