wallyqs
wallyqs

Reputation: 7826

How can I install aggdraw after this error?

I am trying to install the aggdraw python library to create high quality graphics but I keep getting this error:

agg22/include/agg_array.h: In member function `agg::int8u*

What is the workaround for this? How can I install it?

Upvotes: 3

Views: 1806

Answers (2)

natevw
natevw

Reputation: 17932

You should follow the instructions in http://www.pocketuniverse.ca/archive/2008/december/11/pil-and-aggdraw/ to patch AGG rather than just have the compiler allow the 64-bit incompatible code to compile.

Here's one way you could do it in the shell:

cd /tmp
svn co http://svn.effbot.org/public/tags/aggdraw-1.2a3-20060212
cd aggdraw-1.2a3-20060212
patch -p0 <<EOF
Index: agg2/include/agg_array.h
===================================================================
--- agg2/include/agg_array.h    (revision 532)
+++ agg2/include/agg_array.h    (working copy)
@@ -520,7 +520,7 @@
                 int8u* ptr = m_buf_ptr;
                 if(alignment > 1)
                 {
-                    unsigned align = (alignment - unsigned(ptr) % alignment) % alignment;
+                    unsigned align = (alignment - (unsigned long)(ptr) % alignment) % alignment;
                     size += align;
                     ptr += align;
                     if(size <= m_rest)
EOF

python setup.py build_ext -i
python selftest.py
sudo python setup.py install

Upvotes: 10

wallyqs
wallyqs

Reputation: 7826

(Yes I am answering my own question)

After searching a lot through the web I found that doing

export CFLAGS="-fpermissive"   

before building the extension with python setup.py build_ext -i seemed to do the trick.

Upvotes: 3

Related Questions