Error while buiding wxPython classic on Ubuntu 16.04

Hi everyone,

I cloned both wxWidgets and wxWidgets/wxPython from github and built them. The build of wxWidgets passed but the wxPython failed below:

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 -DSWIG_TYPE_TABLE=wxPython_table -DSWIG_PYTHON_OUTPUT_TUPLE -DSWIG_PYTHON_SILENT_MEMLEAK -DWXP_USE_THREAD=1 -UNDEBUG -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK_ -Iinclude -Isrc -I/usr/local/lib/wx/include/gtk3-unicode-3.0 -I/usr/local/include/wx-3.0 -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/mirclient -I/usr/include/mircore -I/usr/include/mircookie -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng12 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/python2.7 -c src/gtk/_core_wrap.cpp -o build/temp.linux-x86_64-2.7/src/gtk/_core_wrap.o -pthread -O3 -pthread
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
src/gtk/_core_wrap.cpp: In function ‘void SWIG_Python_AddErrorMsg(const char*)’:
src/gtk/_core_wrap.cpp:864:42: error: format not a string literal and no format arguments [-Werror=format-security]
PyErr_Format(PyExc_RuntimeError, mesg);
.
.
.
cc1plus: some warnings being treated as errors
error: command ‘x86_64-linux-gnu-gcc’ failed with exit status 1

Do someone have a solution for this issue?
Note that build passed on Ubuntu 14.04.

Thanks.

Why not just use the official Ubuntu packages?

But yes, you need this patch to fix that error:
https://sources.debian.org/src/wxpython3.0/3.0.2.0+dfsg-6/debian/patches/wxpython-missing-format-strings.patch/

Scott

···

On Fri, 26 Jan 2018, Hung Ta wrote:

Hi everyone,

I cloned both wxWidgets and wxWidgets/wxPython from github and built them.
The build of wxWidgets passed but the wxPython failed below:

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
-DSWIG_TYPE_TABLE=_wxPython_table -DSWIG_PYTHON_OUTPUT_TUPLE
-DSWIG_PYTHON_SILENT_MEMLEAK -DWXP_USE_THREAD=1 -UNDEBUG
-D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -Iinclude -Isrc
-I/usr/local/lib/wx/include/gtk3-unicode-3.0 -I/usr/local/include/wx-3.0
-I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0
-I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0
-I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/gtk-3.0
-I/usr/include/gio-unix-2.0/ -I/usr/include/mirclient -I/usr/include/mircore
-I/usr/include/mircookie -I/usr/include/cairo -I/usr/include/pango-1.0
-I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/atk-1.0
-I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2
-I/usr/include/libpng12 -I/usr/include/gdk-pixbuf-2.0
-I/usr/include/libpng12 -I/usr/include/glib-2.0
-I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/python2.7 -c
src/gtk/_core_wrap.cpp -o build/temp.linux-x86_64-2.7/src/gtk/_core_wrap.o
-pthread -O3 -pthread
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for
C/ObjC but not for C++
src/gtk/_core_wrap.cpp: In function ‘void SWIG_Python_AddErrorMsg(const
char*)’:
src/gtk/_core_wrap.cpp:864:42: error: format not a string literal and no
format arguments [-Werror=format-security]
PyErr_Format(PyExc_RuntimeError, mesg);
.
cc1plus: some warnings being treated as errors
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

Do someone have a solution for this issue?
Note that build passed on Ubuntu 14.04.

Thanks. But why don’t you commit the fix to GitHub - wxWidgets/wxPython-Classic: This is the repository for "Classic" wxPython. All new development is happening in the Phoenix project at https://github.com/wxWidgets/Phoenix also?

···

On Saturday, January 27, 2018 at 1:04:04 AM UTC+7, Scott Talbert wrote:

On Fri, 26 Jan 2018, Hung Ta wrote:

Hi everyone,

I cloned both wxWidgets and wxWidgets/wxPython from github and built them.

The build of wxWidgets passed but the wxPython failed below:

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

-DSWIG_TYPE_TABLE=_wxPython_table -DSWIG_PYTHON_OUTPUT_TUPLE

-DSWIG_PYTHON_SILENT_MEMLEAK -DWXP_USE_THREAD=1 -UNDEBUG

-D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -Iinclude -Isrc

-I/usr/local/lib/wx/include/gtk3-unicode-3.0 -I/usr/local/include/wx-3.0

-I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0

-I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0

-I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/gtk-3.0

-I/usr/include/gio-unix-2.0/ -I/usr/include/mirclient -I/usr/include/mircore

-I/usr/include/mircookie -I/usr/include/cairo -I/usr/include/pango-1.0

-I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/atk-1.0

-I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2

-I/usr/include/libpng12 -I/usr/include/gdk-pixbuf-2.0

-I/usr/include/libpng12 -I/usr/include/glib-2.0

-I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/python2.7 -c

src/gtk/_core_wrap.cpp -o build/temp.linux-x86_64-2.7/src/gtk/_core_wrap.o

-pthread -O3 -pthread

cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for

C/ObjC but not for C++

src/gtk/_core_wrap.cpp: In function ‘void SWIG_Python_AddErrorMsg(const

char*)’:

src/gtk/_core_wrap.cpp:864:42: error: format not a string literal and no

format arguments [-Werror=format-security]

 PyErr_Format(PyExc_RuntimeError, mesg);

.

.

.

cc1plus: some warnings being treated as errors

error: command ‘x86_64-linux-gnu-gcc’ failed with exit status 1

Do someone have a solution for this issue?

Note that build passed on Ubuntu 14.04.

Why not just use the official Ubuntu packages?

But yes, you need this patch to fix that error:

https://sources.debian.org/src/wxpython3.0/3.0.2.0+dfsg-6/debian/patches/wxpython-missing-format-strings.patch/

Scott

Unfortunately, wxPython Classic is pretty much unmaintained at this point, given that wxPython Phoenix will be released soon. The patch is to the SWIG-generated files. Robin might apply the patch, but if he ever re-SWIGs again, the fixes will get wiped out. The real problem is that the version of SWIG used is too old, and I think there are custom patches to SWIG.

···

On Sun, 28 Jan 2018, Hung Ta wrote:

Thanks. But why don't you commit the fix to
GitHub - wxWidgets/wxPython-Classic: This is the repository for "Classic" wxPython. All new development is happening in the Phoenix project at https://github.com/wxWidgets/Phoenix also?

On Saturday, January 27, 2018 at 1:04:04 AM UTC+7, Scott Talbert wrote:
      On Fri, 26 Jan 2018, Hung Ta wrote:

      > Hi everyone,
      >
      > I cloned both wxWidgets and wxWidgets/wxPython from github and
      built them.
      > The build of wxWidgets passed but the wxPython failed below:
      >
      > 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
      > -DSWIG_TYPE_TABLE=_wxPython_table -DSWIG_PYTHON_OUTPUT_TUPLE
      > -DSWIG_PYTHON_SILENT_MEMLEAK -DWXP_USE_THREAD=1 -UNDEBUG
      > -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -Iinclude
      -Isrc
      > -I/usr/local/lib/wx/include/gtk3-unicode-3.0
      -I/usr/local/include/wx-3.0
      > -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0
      > -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0
      > -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include
      -I/usr/include/gtk-3.0
      > -I/usr/include/gio-unix-2.0/ -I/usr/include/mirclient
      -I/usr/include/mircore
      > -I/usr/include/mircookie -I/usr/include/cairo
      -I/usr/include/pango-1.0
      > -I/usr/include/harfbuzz -I/usr/include/pango-1.0
      -I/usr/include/atk-1.0
      > -I/usr/include/cairo -I/usr/include/pixman-1
      -I/usr/include/freetype2
      > -I/usr/include/libpng12 -I/usr/include/gdk-pixbuf-2.0
      > -I/usr/include/libpng12 -I/usr/include/glib-2.0
      > -I/usr/lib/x86_64-linux-gnu/glib-2.0/include
      -I/usr/include/python2.7 -c
      > src/gtk/_core_wrap.cpp -o
      build/temp.linux-x86_64-2.7/src/gtk/_core_wrap.o
      > -pthread -O3 -pthread
      > cc1plus: warning: command line option ‘-Wstrict-prototypes’ is
      valid for
      > C/ObjC but not for C++
      > src/gtk/_core_wrap.cpp: In function ‘void
      SWIG_Python_AddErrorMsg(const
      > char*)’:
      > src/gtk/_core_wrap.cpp:864:42: error: format not a string
      literal and no
      > format arguments [-Werror=format-security]
      > PyErr_Format(PyExc_RuntimeError, mesg);
      > .
      > cc1plus: some warnings being treated as errors
      > error: command 'x86_64-linux-gnu-gcc' failed with exit status
      1
      >
      > Do someone have a solution for this issue?
      > Note that build passed on Ubuntu 14.04.

      Why not just use the official Ubuntu packages?

      But yes, you need this patch to fix that error:
https://sources.debian.org/src/wxpython3.0/3.0.2.0+dfsg-6/debian/patches/wx
      python-missing-format-strings.patch/

      Scott

--
You received this message because you are subscribed to the Google Groups
"wxPython-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to wxPython-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.