MSVC Portability

Daniel Atallah daniel.atallah at
Wed Apr 3 10:30:41 EDT 2013

On Wed, Apr 3, 2013 at 8:56 AM, Zoltán Sólyom <z-ismeretlen at> wrote:
> After the first run with the DLLs compiled in Visual studio, there was an
> access violation. I found that the pointer to FILE structure returned by
> g_fopen is not compatible with file operations in MS libraries ( Does this
> state the same?
> ).

Yes that's pretty much the expected behavior because it's using a
different C Runtime.

> Forcefully defining fopen over g_fopen solved the issue, but I would like a
> different solution. (For example to change all g_fopen calls to some custom
> function call, eg. purple_fopen or anything else that can then be defined
> separately for MSVC.) I would then use MultiByteToWideChar to convert the
> name to wchar_t and the non-standard _wfopen to get the FILE pointer.
> If you know a better way to open files with Unicode filenames under Windows
> please let me know.

I think the correct solution is to compile glib against the same C
Runtime that you'll be using with pidgin. has some documentation about building the
whole stack - you'll only care about the things above glib, so it is
substantially simpler.



More information about the Devel mailing list