[libGD] #165 [Comment added] Build failure on mingw - multiple versions of libgd including 2.0.36RC1

[email protected] Thu, 30 Jul 2009 14:50:14 +0200 (CEST)
Newsgroups php.gd.bugs
Message-ID <[email protected]>
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.

The following task has a new comment added:

FS#165 - Build failure on mingw - multiple versions of libgd including 2.0.36RC1
User who did this - Jayne (jayne)

----------

Forgive my ignorance about libgd; I'm just bumbling around trying to compile it as a dependency for something else. I was able to get libgd 2.0.36RC1 to compile under mingw by making a few modifications:

1) In gd_jpeg.c add #define HAVE_BOOLEAN just above #include "jpeglib.h"

This prevents a conflicting typedef in jmorecfg.h (from libjpeg) from being invoked.

2) (This is not libgd, but...) in jmorecfg.h from libjpeg, wrap "typedef long INT32" inside of #ifndef _BASETSD_H and a #endif, ala
<code>#ifndef XMD_H			/* X11/xmd.h correctly defines INT32 */
#ifndef _BASETSD_H_		/* Microsoft defines it in basetsd.h */
#ifndef _BASETSD_H		/* MinGW defines it in basetsd.h, too */
#ifndef QGLOBAL_H		/* Qt defines it in qglobal.h */
typedef long INT32;
#endif
#endif
#endif
#endif</code>

The "typedef long INT32" conflicts with another typedef provided in basetsd.h. The headers provided by Microsoft define _BASETSD_H_ but the header provided with mingw defines _BASETSD_H (note missing trailing _). A possible work-around for just libgd might be to...
<code>#ifdef _BASETSD_H
#define _BASETSD_H_
#endif</code>
.... perhaps? I'm not sure what the side effects would be, if any.

3) In gd.h, I had to force 
<code>#define BGD_DECLARE(rt) __declspec(dllexport) rt __stdcall</code>
and
<code>#define BGD_EXPORT_DATA_PROT __declspec(dllexport) extern
#define BGD_EXPORT_DATA_IMPL __declspec(dllexport)</code>

With those changes, make seems to have finished without errors.

----------

More information can be found at the following URL:
http://bugs.libgd.org/?do=details&task_id=165#comment620

You are receiving this message because you have requested it from the Flyspray bugtracking system.  If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.