2016-11-14 59 views
0

我在ubuntu上安装4suite.xml期间遇到此错误。试图在我的Ubuntu上安装harpia,但是我的系统中缺少一些软件包,所以在获取这些缺失的依赖项时,我坚持这一点。错误:格式不是字符串文字,也没有格式参数[-Werror = format-security]

[email protected]:~/4Suite-XML-1.0.2$ sudo python setup.py install 
running install 
running build 
running config 
running build_py 
running build_ext 
building 'Ft.Xml.Lib.cStreamWriter' extension 
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c Ft/Xml/src/StreamWriter.c -o build/temp.linux- x86_64-2.7/Ft/Xml/src/StreamWriter.o 
In file included from /usr/include/python2.7/Python.h:94:0, 
      from Ft/Xml/src/StreamWriter.c:14: 
Ft/Xml/src/StreamWriter.c: In function ‘writer_print’: 
/usr/include/python2.7/stringobject.h:91:32: error: format not a string literal and no format arguments [-Werror=format-security] 
#define PyString_AS_STRING(op) (((PyStringObject *)(op))->ob_sval) 
          ^
Ft/Xml/src/StreamWriter.c:605:15: note: in expansion of macro ‘PyString_AS_STRING’ 
fprintf(fp, PyString_AS_STRING(repr)); 
     ^


Ft/Xml/src/StreamWriter.c: In function ‘entitymap_print’: 
/usr/include/python2.7/stringobject.h:91:32: error: format not a string literal and no format arguments [-Werror=format-security] 
#define PyString_AS_STRING(op) (((PyStringObject *)(op))->ob_sval) 
          ^
Ft/Xml/src/StreamWriter.c:815:15: note: in expansion of macro ‘PyString_AS_STRING’ 
fprintf(fp, PyString_AS_STRING(repr)); 
     ^

cc1: some warnings being treated as errors 

你能帮我明白这一点?

回答

0
+1

当我安装[wxPython的2.8.12.1(https://sourceforge.net /projects/wxpython/files/wxPython/2.8.12.1/)在Fedora 23 x86_64中,我遇到了类似的问题。我改变了'PyErr_Format(PyExc_RuntimeError,mesg);'在源代码中出现了PyErr_Format(PyExc_RuntimeError,“%s”,mesg);'。它适用于我。 –

相关问题