简体   繁体   中英

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?

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

(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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM