unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* how to resolve namespace issues between imagemagick and gif libraries?
@ 2009-07-31 18:02 joakim
  2009-08-01  7:10 ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: joakim @ 2009-07-31 18:02 UTC (permalink / raw)
  To: Emacs Development

I've made a patch that makes it possible to load an image file using
the imagemagick library. However, I cant compile in imagemagick and gif
support at the same time due to namespace collisions.

When compiling image.c:

gcc -c -D_BSD_SOURCE   -Demacs -DHAVE_CONFIG_H  -I. -I/mnt/data/build/emacsnew/emacs/src -D_BSD_SOURCE -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/freetype2 -I/usr/include/alsa -I/usr/include/librsvg-2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/gtk-2.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -fopenmp -I/usr/include/ImageMagick -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -g -O2 -Wno-pointer-sign   image.c
In file included from /usr/include/ImageMagick/wand/deprecate.h:28,
                 from /usr/include/ImageMagick/wand/MagickWand.h:154,
                 from image.c:7865:
/usr/include/ImageMagick/wand/drawing-wand.h:172: error: conflicting types for ‘DrawRectangle’
/usr/include/gif_lib.h:324: note: previous declaration of ‘DrawRectangle’ was here
make[1]: *** [image.o] Error 1
make[1]: Leaving directory `/mnt/data/build/emacsnew/emacs/src'
make: *** [src] Error 2

If I leave out gif support it compiles and works well enough to load a
djvu file in emacs like this:

(insert-image (create-image "/tmp/tst.djvu" 'imagemagick) )

Any hints how to fix this in a manner acceptable for Emacs code?

-- 
Joakim Verona




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: how to resolve namespace issues between imagemagick and gif libraries?
  2009-07-31 18:02 how to resolve namespace issues between imagemagick and gif libraries? joakim
@ 2009-08-01  7:10 ` Eli Zaretskii
  2009-08-01 16:57   ` joakim
  0 siblings, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2009-08-01  7:10 UTC (permalink / raw)
  To: joakim; +Cc: emacs-devel

> From: joakim@verona.se
> Date: Fri, 31 Jul 2009 20:02:32 +0200
> 
> In file included from /usr/include/ImageMagick/wand/deprecate.h:28,
>                  from /usr/include/ImageMagick/wand/MagickWand.h:154,
>                  from image.c:7865:
> /usr/include/ImageMagick/wand/drawing-wand.h:172: error: conflicting types for ‘DrawRectangle’
> /usr/include/gif_lib.h:324: note: previous declaration of ‘DrawRectangle’ was here
> make[1]: *** [image.o] Error 1
> make[1]: Leaving directory `/mnt/data/build/emacsnew/emacs/src'
> make: *** [src] Error 2

Can you show here the prototype of DrawRectangle from Imagemagick?

Is that the only conflict?  If not, please show the others as well.

> Any hints how to fix this in a manner acceptable for Emacs code?

Does Emacs use DrawRectangle, from any or both these libraries?  I
guess at most one is used, or else you'd have problems in the Emacs
sources as well, not just in the headers.  If we don't need to use
both, you should be able to rename one of them with #define.

A better solution would be to lobby the maintainers of Imagemagick to
use names specific to the package.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: how to resolve namespace issues between imagemagick and gif libraries?
  2009-08-01  7:10 ` Eli Zaretskii
@ 2009-08-01 16:57   ` joakim
  2009-08-01 17:12     ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: joakim @ 2009-08-01 16:57 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

>> From: joakim@verona.se
>> Date: Fri, 31 Jul 2009 20:02:32 +0200
>> 
>> In file included from /usr/include/ImageMagick/wand/deprecate.h:28,
>>                  from /usr/include/ImageMagick/wand/MagickWand.h:154,
>>                  from image.c:7865:
>> /usr/include/ImageMagick/wand/drawing-wand.h:172: error: conflicting types for ‘DrawRectangle’
>> /usr/include/gif_lib.h:324: note: previous declaration of ‘DrawRectangle’ was here
>> make[1]: *** [image.o] Error 1
>> make[1]: Leaving directory `/mnt/data/build/emacsnew/emacs/src'
>> make: *** [src] Error 2
>
> Can you show here the prototype of DrawRectangle from Imagemagick?

DrawRectangle(DrawingWand *,const double,const double,const double,
    const double)
    
> Is that the only conflict?  If not, please show the others as well.
>
>> Any hints how to fix this in a manner acceptable for Emacs code?
>
> Does Emacs use DrawRectangle, from any or both these libraries?  I
> guess at most one is used, or else you'd have problems in the Emacs
> sources as well, not just in the headers.  If we don't need to use
> both, you should be able to rename one of them with #define.

Emacs doesnt use the gif DrawRectangle AFAICS, and I dont plan to use
the one in the imagemagick library either.

> A better solution would be to lobby the maintainers of Imagemagick to
> use names specific to the package.
-- 
Joakim Verona




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: how to resolve namespace issues between imagemagick and gif libraries?
  2009-08-01 16:57   ` joakim
@ 2009-08-01 17:12     ` Eli Zaretskii
  2009-08-02 14:18       ` Chong Yidong
  0 siblings, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2009-08-01 17:12 UTC (permalink / raw)
  To: joakim; +Cc: emacs-devel

> From: joakim@verona.se
> Cc: emacs-devel@gnu.org
> Date: Sat, 01 Aug 2009 18:57:31 +0200
> 
> > Does Emacs use DrawRectangle, from any or both these libraries?  I
> > guess at most one is used, or else you'd have problems in the Emacs
> > sources as well, not just in the headers.  If we don't need to use
> > both, you should be able to rename one of them with #define.
> 
> Emacs doesnt use the gif DrawRectangle AFAICS, and I dont plan to use
> the one in the imagemagick library either.

Then I guess #define is the way to go.  Unless there are objections
from Stefan or Yidong, that is.




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: how to resolve namespace issues between imagemagick and gif libraries?
  2009-08-01 17:12     ` Eli Zaretskii
@ 2009-08-02 14:18       ` Chong Yidong
  2009-08-04 16:54         ` Stefan Monnier
  0 siblings, 1 reply; 6+ messages in thread
From: Chong Yidong @ 2009-08-02 14:18 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: joakim, emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

>> Emacs doesnt use the gif DrawRectangle AFAICS, and I dont plan to use
>> the one in the imagemagick library either.
>
> Then I guess #define is the way to go.  Unless there are objections
> from Stefan or Yidong, that is.

Fine by me.




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: how to resolve namespace issues between imagemagick and gif libraries?
  2009-08-02 14:18       ` Chong Yidong
@ 2009-08-04 16:54         ` Stefan Monnier
  0 siblings, 0 replies; 6+ messages in thread
From: Stefan Monnier @ 2009-08-04 16:54 UTC (permalink / raw)
  To: Chong Yidong; +Cc: Eli Zaretskii, joakim, emacs-devel

>>> Emacs doesnt use the gif DrawRectangle AFAICS, and I dont plan to use
>>> the one in the imagemagick library either.
>> Then I guess #define is the way to go.  Unless there are objections
>> from Stefan or Yidong, that is.
> Fine by me.

Fine by me as well, but please please pretty please, report the
problem(s) to the library maintainers (I guess to both the Gif and the
ImageMagick library maintainers).


        Stefan




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-08-04 16:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-31 18:02 how to resolve namespace issues between imagemagick and gif libraries? joakim
2009-08-01  7:10 ` Eli Zaretskii
2009-08-01 16:57   ` joakim
2009-08-01 17:12     ` Eli Zaretskii
2009-08-02 14:18       ` Chong Yidong
2009-08-04 16:54         ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).