Hi,
I am trying to build wxPython on MSYS2, from the source in the git repository. According to the README and a post that I found in this forum, there are some changes to make to the build scripts for this to work.
I have made some changes (see below) and got wxWidgets to compile, but wxPython does not yet compile. The configure step seems ok, and some of the modules are compiled and linked (235 of 958 are ok), but there is an error with sip_corecmodule.cpp
.
The errors are as follows (an extract, there are many missing symbols):
../../../../sip/cpp/sip_corecmodule.cpp: In function 'PyObject* func_HandleFatalExceptions(PyObject*, PyObject*, PyObject*)':
../../../../sip/cpp/sip_corecmodule.cpp:14127:22: error: 'wxHandleFatalExceptions' was not declared in this scope; did you mean 'doc_HandleFatalExceptions'?
14127 | sipRes = wxHandleFatalExceptions(doIt);
| ^~~~~~~~~~~~~~~~~~~~~~~
| doc_HandleFatalExceptions
../../../../sip/cpp/sip_corecmodule.cpp: At global scope:
../../../../sip/cpp/sip_corecmodule.cpp:19667:39: error: 'wxWEBKIT_NAV_LINK_CLICKED' was not declared in this scope; did you mean 'sipName_WEBKIT_NAV_LINK_CLICKED'?
19667 | {sipName_WEBKIT_NAV_LINK_CLICKED, wxWEBKIT_NAV_LINK_CLICKED},
| ^~~~~~~~~~~~~~~~~~~~~~~~~
| sipName_WEBKIT_NAV_LINK_CLICKED
../../../../sip/cpp/sip_corecmodule.cpp:19668:36: error: 'wxWEBKIT_NAV_BACK_NEXT' was not declared in this scope; did you mean 'sipName_WEBKIT_NAV_BACK_NEXT'?
19668 | {sipName_WEBKIT_NAV_BACK_NEXT, wxWEBKIT_NAV_BACK_NEXT},
| ^~~~~~~~~~~~~~~~~~~~~~
| sipName_WEBKIT_NAV_BACK_NEXT
../../../../sip/cpp/sip_corecmodule.cpp:19669:41: error: 'wxWEBKIT_NAV_FORM_SUBMITTED' was not declared in this scope; did you mean 'sipName_WEBKIT_NAV_FORM_SUBMITTED'?
19669 | {sipName_WEBKIT_NAV_FORM_SUBMITTED, wxWEBKIT_NAV_FORM_SUBMITTED},
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
| sipName_WEBKIT_NAV_FORM_SUBMITTED
(...)
['x86_64-w64-mingw32-g++', '-fpermissive', '-mwindows', '-UNDEBUG', '-DSIP_MODULE_NAME=wx.siplib', '-DSIP_MODULE_BASENAME=siplib', '-g', '-march=x86-64', '-mtune=generic', '-O2', '-fwrapv', '-march=x86-64', '-mtune=generic', '-O2', '-fwrapv', '-fno-strict-aliasing', '-I../../../../x86_64-w64-mingw32/lib/wx/include/msw-unicode-3.1', '-I../../../../ext/wxWidgets/include', '-Isip/siplib', '-I../../../../sip/siplib', '-Iwx/include', '-I../../../../wx/include', '-Isrc', '-I../../../../src', '-I/C:/msys64/mingw64/include/python3.8', '-DPYTHONDIR="/usr/local/lib/python3.8/site-packages"', '-DPYTHONARCHDIR="/usr/local/lib/python3.8/site-packages"', '-DHAVE_WX=1', '-DHAVE_WXADV=1', '-DHAVE_WXSTC=1', '-DHAVE_WXHTML=1', '-DHAVE_WXGL=1', '-DHAVE_WXWEBVIEW=1', '-DHAVE_WXXML=1', '-DHAVE_WXXRC=1', '-DHAVE_WXRICHTEXT=1', '-DHAVE_WXMEDIA=1', '-DHAVE_WXRIBBON=1', '-DHAVE_WXPROPGRID=1', '-DHAVE_WXAUI=1', '-D_FILE_OFFSET_BITS=64', '-DWXUSINGDLL', '-D__WXMSW__', '-D__USE_MINGW_ANSI_STDIO=1', '-D_WIN32_WINNT=0x0601', '-DNDEBUG', '-D__USE_MINGW_ANSI_STDIO=1', '-D_WIN32_WINNT=0x0601', '-DNDEBUG', '../../../../sip/cpp/sip_corecmodule.cpp', '-c', '-o/c/Users/EvanMonroig/Soft/external/Phoenix/build/waf/3.8/x64/sip/cpp/sip_corecmodule.cpp.4.o']
After different tries I have no clue about how to fix this. I don’t know etg or sip, but it seems that the file assembles many enums, some of which are not always defined depending on compilation flags.
Below are the detailed steps to reproduce the build error, from a MSYS shell:
pacman -Sy python-pip patch make mingw-w64-x86_64-libpng mingw-w64-x86_64-libjpeg-turbo mingw-w64-x86_64-libtiff mingw-w64-x86_64-gcc mingw-w64-x86_64-gcc-libs mingw-w64-x86_64-expat mingw-w64-x86_64-xz mingw-w64-x86_64-zlib
export MINGW_PREFIX=/mingw64
export PYTHON=${MINGW_PREFIX}/bin/python.exe
export PYTHON_CONFIG="c:/msys64/usr/bin/sh.exe ${MINGW_PREFIX}/bin/python-config"
export CYGWIN_BASE=${MINGW_PREFIX}
export MINGW_CHOST=x86_64-w64-mingw32 # just for local test
export DOXYGEN=/mingw64/bin/doxygen.exe
export SIP=/mingw64/bin/sip.exe
export CC=x86_64-w64-mingw32-gcc
export CXX=x86_64-w64-mingw32-g++
export CCOMPILER=mingw32
export PATH="$PATH:/mingw64/bin"
python -m pip install virtualenv
virtualenv ./venv-msys
. ./venv-msys/bin/activate
python -m pip install requests
# python build.py clean
python build.py build_wx \
--nodoc \
--prefix $MINGW_PREFIX \
--build_dir $MINGW_CHOST \
--no_magic \
--cairo \
--x64 \
--verbose \
> test2_build_wx.log 2>&1
python build.py dox etg sip \
--nodoc \
--prefix $MINGW_PREFIX \
--build_dir $MINGW_CHOST \
> test2_dox_etg_sip.log 2>&1
python build.py build_py \
--nodoc \
--prefix $MINGW_PREFIX \
--build_dir $MINGW_CHOST \
--no_magic \
--cairo \
--x64 \
--verbose \
--python=/mingw64/bin/python3.8 \
> test2_build_py.log 2>&1
The modified wscript, build.py and part of buildtools/ are in GitHub - emgstabilis/Phoenix at 1-build-on-msys2 (I started this branch from the tag wxPython-4.1.1
). It is a work-in-progress but I do plan to clean this up after the compilation problems are resolved. Also, the steps above are organized so that they can later be transformed to a recipe for automatic build with MSYS2.
Best regards,
Evan