Compiling libpurple in Visual Studio

David Byron dbyron at dbyron.com
Mon May 28 17:16:46 EDT 2007


On Monday, May 28, 2007 @ 12:00a, Nick Hebner wrote:

> Inspired by David Byron's recent successful tackling of
> libpurple use from MSVC, I decided to give the entire
> compilation of libpurple in Visual Studio a try (in order to
> build with debuggable symbols).

> My method:
> 
> 1. Create an empty dll project
> 
> 2. Add version.h, and config.h from pidgin root

I don't see either of these files in the root of the pidgin-2.0.1 tarball.
I do see a version.h in the libpurple directory and config.h.mingw in the
root.  Are those the files you mean?

> 3. Add all .c and .h from libpurple directory (except
> purple-client* files)
> 
> 4. Add libpurple\win32 directory (only need .c, .h, and .rc
> files)
> 
> 5. Apply attached patches (1 for libpurple, and 1 for win32
> directory)

I didn't a patch for prpl.h so it doesn't unconditionally include unistd.h.
Do you have unistd.h on your machine?

> My Visual Studio Project Properties:
> 
> C/C++::General::Additional Include Directories:
> ------------------------------------------------ 
> $PIDGIN_DEV_ROOT\win32-dev\gtk_2_0\include\glib-2.0
> $PIDGIN_DEV_ROOT\win32-dev\gtk_2_0\lib\glib-2.0\include
> $PIDGIN_DEV_ROOT\win32-dev\gtk_2_0\include
> $PIDGIN_DEV_ROOT\win32-dev\libxml2\include

How did you get Visual Studio to find libpurple/win32/win32dep.h?  I had to
add libpurple/win32 as an include path as well.

> C/C++::Advanced::Force Includes: 
> ------------------------------------------------
> winsock2.h; config.h

Isn't it more "normal" to add HAVE_CONFIG_H to
C/C++::Preprocessor::Preprocessor Definitions than to use this force
includes mechanism?  Anyway, that's what I did and it seems to work.

> Linker::General::Additional Library Directories:
> ------------------------------------------------
> $PIDGIN_DEV_ROOT\win32-dev\gtk_2_0\lib 
> $PIDGIN_DEV_ROOT\win32-dev\libxml2\lib
> 
> Linker::Input::Additional Dependencies:
> ------------------------------------------------
> glib-2.0.lib
> gmodule-2.0.lib
> gobject-2.0.lib
> gthread-2.0.lib
> libxml2.lib 
> intl.lib
> iconv.lib
> ws2_32.lib

> Linker::Input::Module Definition File:
> ------------------------------------------------
> libpurple.def (generated by the mingw compile)

At what point in your recipe did you build with mingw?  It would be great to
not have to do this to minimize the build tool dependencies (i.e. keep
developers from having to deal with mingw tools at all).

Thanks for picking up the ball here.

-DB





More information about the Devel mailing list