Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to compile wxPython 4.2.2 on Cygwin #2714

Open
hamishmb opened this issue Mar 11, 2025 · 7 comments
Open

Unable to compile wxPython 4.2.2 on Cygwin #2714

hamishmb opened this issue Mar 11, 2025 · 7 comments

Comments

@hamishmb
Copy link

Hi there,

I've been trying to compile wxPython 4.2.2 on Cygwin, but I keep running into an error where it's looking for setup.h under /usr/local/lib instead of just /lib. Then a bit later on it fails with fatal error: wx/wx.h: No such file or directory. The full output is below, along with the build command.

Build command:

LDFLAGS="-L/usr/lib -lpython3.9 -lX11 -lgtk-3 -lgdk-3" python3.9 ../build.py build_py --use_syswx --gtk3

Output:

/cygdrive/c/Users/Hamis/Cygwin-packaging/python3-wx/python3-wx-4.2.2-1.x86_64/build/py39/../build.py:44: DeprecationWarning: dep_util is Deprecated. Use functions from setuptools instead. from distutils.dep_util import newer, newer_group Setting top to : /cygdrive/c/Users/Hamis/Cygwin-packaging/python3-wx/python3-wx-4.2.2-1.x86_64/src/wxPython-4.2.2 Setting out to : /cygdrive/c/Users/Hamis/Cygwin-packaging/python3-wx/python3-wx-4.2.2-1.x86_64/src/wxPython-4.2.2/build/waf/3.9/gtk3 Checking for 'gcc' (C compiler) : gcc Checking for 'g++' (C++ compiler) : g++ Checking for program 'python' : /usr/bin/python3.9.exe Checking for python version >= 3.7.0 : 3.9.16 python-config : /usr/bin/python3.9-config Asking python-config for pyext '--cflags --libs --ldflags' flags : yes Testing pyext configuration : yes Finding libs for WX : yes Finding libs for WXADV : yes Finding libs for WXSTC : yes Finding libs for WXHTML : yes WARNING: Unable to find setup.h in /usr/local/lib/wx/include/gtk3-unicode-3.2, assuming wxUSE_GLCANVAS is not available. Finding libs for WXGL : yes WARNING: Unable to find setup.h in /usr/local/lib/wx/include/gtk3-unicode-3.2, assuming wxUSE_WEBVIEW is not available. Finding libs for WXWEBVIEW : yes Finding libs for WXXML : yes Finding libs for WXXRC : yes Finding libs for WXRICHTEXT : yes WARNING: Unable to find setup.h in /usr/local/lib/wx/include/gtk3-unicode-3.2, assuming wxUSE_MEDIACTRL is not available. Finding libs for WXMEDIA : yes Finding libs for WXRIBBON : yes Finding libs for WXPROPGRID : yes Finding libs for WXAUI : yes 'configure' finished successfully (9.776s) Waf: Entering directory /cygdrive/c/Users/Hamis/Cygwin-packaging/python3-wx/python3-wx-4.2.2-1.x86_64/src/wxPython-4.2.2/build/waf/3.9/gtk3'
**** Compiler: gcc --version
gcc (GCC) 12.4.0
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
[ 11/939] Compiling sip/cpp/sip_corewxListView.cpp
[ 12/939] Compiling sip/cpp/sip_corewxEventLoopBase.cpp
[ 13/939] Compiling sip/cpp/sip_corewxBitmap.cpp
[ 14/939] Compiling sip/cpp/sip_corewxActivateEvent.cpp
[ 15/939] Compiling sip/cpp/sip_corewxZoomGestureEvent.cpp
[ 16/939] Compiling sip/cpp/sip_corewxListItem.cpp
[ 17/939] Compiling sip/cpp/sip_corewxXPMHandler.cpp
[ 18/939] Compiling sip/cpp/sip_corewxIdManager.cpp
[ 19/939] Compiling sip/cpp/sip_corewxWrapSizer.cpp
[ 20/939] Compiling sip/cpp/sip_corewxListEvent.cpp
[ 21/939] Compiling sip/cpp/sip_corewxEventLoopActivator.cpp
[ 22/939] Compiling sip/cpp/sip_corewxWithImages.cpp
In file included from ../../../../sip/cpp/sipAPI_core.h:22089,
from ../../../../sip/cpp/sip_corewxListView.cpp:10:
../../../../wx/include/wxPython/wxpy_api.h:41:10: fatal error: wx/wx.h: No such file or directory
41 | #include <wx/wx.h>
| ^~~~~~~~~
compilation terminated.

In file included from ../../../../sip/cpp/sipAPI_core.h:22089,
from ../../../../sip/cpp/sip_corewxEventLoopBase.cpp:10:
../../../../wx/include/wxPython/wxpy_api.h:41:10: fatal error: wx/wx.h: No such file or directory
41 | #include <wx/wx.h>
| ^~~~~~~~~
compilation terminated.

In file included from ../../../../sip/cpp/sipAPI_core.h:22089,
from ../../../../sip/cpp/sip_corewxBitmap.cpp:10:
../../../../wx/include/wxPython/wxpy_api.h:41:10: fatal error: wx/wx.h: No such file or directory
41 | #include <wx/wx.h>
| ^~~~~~~~~
compilation terminated.

In file included from ../../../../sip/cpp/sipAPI_core.h:22089,
from ../../../../sip/cpp/sip_corewxActivateEvent.cpp:10:
../../../../wx/include/wxPython/wxpy_api.h:41:10: fatal error: wx/wx.h: No such file or directory
41 | #include <wx/wx.h>
| ^~~~~~~~~
compilation terminated.

In file included from ../../../../sip/cpp/sipAPI_core.h:22089,
from ../../../../sip/cpp/sip_corewxZoomGestureEvent.cpp:10:
../../../../wx/include/wxPython/wxpy_api.h:41:10: fatal error: wx/wx.h: No such file or directory
41 | #include <wx/wx.h>
| ^~~~~~~~~
compilation terminated.

In file included from ../../../../sip/cpp/sipAPI_core.h:22089,
from ../../../../sip/cpp/sip_corewxListItem.cpp:10:
../../../../wx/include/wxPython/wxpy_api.h:41:10: fatal error: wx/wx.h: No such file or directory
41 | #include <wx/wx.h>
| ^~~~~~~~~
compilation terminated.

In file included from ../../../../sip/cpp/sipAPI_core.h:22089,
from ../../../../sip/cpp/sip_corewxXPMHandler.cpp:10:
../../../../wx/include/wxPython/wxpy_api.h:41:10: fatal error: wx/wx.h: No such file or directory
41 | #include <wx/wx.h>
| ^~~~~~~~~
compilation terminated.

In file included from ../../../../sip/cpp/sipAPI_core.h:22089,
from ../../../../sip/cpp/sip_corewxIdManager.cpp:10:
../../../../wx/include/wxPython/wxpy_api.h:41:10: fatal error: wx/wx.h: No such file or directory
41 | #include <wx/wx.h>
| ^~~~~~~~~
compilation terminated.

In file included from ../../../../sip/cpp/sipAPI_core.h:22089,
from ../../../../sip/cpp/sip_corewxWrapSizer.cpp:10:
../../../../wx/include/wxPython/wxpy_api.h:41:10: fatal error: wx/wx.h: No such file or directory
41 | #include <wx/wx.h>
| ^~~~~~~~~
compilation terminated.

In file included from ../../../../sip/cpp/sipAPI_core.h:22089,
from ../../../../sip/cpp/sip_corewxListEvent.cpp:10:
../../../../wx/include/wxPython/wxpy_api.h:41:10: fatal error: wx/wx.h: No such file or directory
41 | #include <wx/wx.h>
| ^~~~~~~~~
compilation terminated.

In file included from ../../../../sip/cpp/sipAPI_core.h:22089,
from ../../../../sip/cpp/sip_corewxWithImages.cpp:10:
../../../../wx/include/wxPython/wxpy_api.h:41:10: fatal error: wx/wx.h: No such file or directory
41 | #include <wx/wx.h>
| ^~~~~~~~~
compilation terminated.

In file included from ../../../../sip/cpp/sipAPI_core.h:22089,
from ../../../../sip/cpp/sip_corewxEventLoopActivator.cpp:10:
../../../../wx/include/wxPython/wxpy_api.h:41:10: fatal error: wx/wx.h: No such file or directory
41 | #include <wx/wx.h>
| ^~~~~~~~~
compilation terminated.

Waf: Leaving directory `/cygdrive/c/Users/Hamis/Cygwin-packaging/python3-wx/python3-wx-4.2.2-1.x86_64/src/wxPython-4.2.2/build/waf/3.9/gtk3'
Build failed
-> task in '_core' failed with exit status 1 (run with -v to display more information)
-> task in '_core' failed with exit status 1 (run with -v to display more information)
-> task in '_core' failed with exit status 1 (run with -v to display more information)
-> task in '_core' failed with exit status 1 (run with -v to display more information)
-> task in '_core' failed with exit status 1 (run with -v to display more information)
-> task in '_core' failed with exit status 1 (run with -v to display more information)
-> task in '_core' failed with exit status 1 (run with -v to display more information)
-> task in '_core' failed with exit status 1 (run with -v to display more information)
-> task in '_core' failed with exit status 1 (run with -v to display more information)
-> task in '_core' failed with exit status 1 (run with -v to display more information)
-> task in '_core' failed with exit status 1 (run with -v to display more information)
-> task in '_core' failed with exit status 1 (run with -v to display more information)
Will build using: "/usr/bin/python3.9.exe"
3.9.16 (main, Mar 8 2023, 22:47:22)
[GCC 11.3.0]
Python's architecture is 64bit
cfg.VERSION: 4.2.2

Running command: build_py
Checking for /cygdrive/c/Users/Hamis/Cygwin-packaging/python3-wx/python3-wx-4.2.2-1.x86_64/src/wxPython-4.2.2/bin/waf-2.1.2...
"/usr/bin/python3.9.exe" /cygdrive/c/Users/Hamis/Cygwin-packaging/python3-wx/python3-wx-4.2.2-1.x86_64/src/wxPython-4.2.2/bin/waf-2.1.2 --wx_config=/usr/lib/wx/config/gtk3-unicode-3.2 --gtk3 --python="/usr/bin/python3.9.exe" --out=build/waf/3.9/gtk3 configure build
Command '"/usr/bin/python3.9.exe" /cygdrive/c/Users/Hamis/Cygwin-packaging/python3-wx/python3-wx-4.2.2-1.x86_64/src/wxPython-4.2.2/bin/waf-2.1.2 --wx_config=/usr/lib/wx/config/gtk3-unicode-3.2 --gtk3 --python="/usr/bin/python3.9.exe" --out=build/waf/3.9/gtk3 configure build ' failed with exit code 1.
Finished command: build_py (0m14.878s)`

I'm not quite sure where to start with fixing this, so any help is greatly appreciated.

@echoix
Copy link
Contributor

echoix commented Mar 11, 2025

The wx.h not found is most probably because the steps to generate the files from the repo's sources (to create a Python sdist) wasn't done or didn't complete successfully. If you don't need to highly customize the configure part, just ask for pip, uv, or build, to create a wheel from the sdist. You might have more luck skipping lots of steps.

The sdist is the same for Windows, macOS, and Linux.

@hamishmb
Copy link
Author

Do you mean to say I need to use more commands than just build_py when running build.py? It works fine in wxPython 4.1 just running build_py, so I'd be surprised. I am using the system distribution of wxWidgets 3.2, note, rather than building wxWidgets along with wxPython - we like to keep those packages split apart.

I could try dropping the --use_syswx argument and see what happens though, might be interesting.

@hamishmb
Copy link
Author

Update: dropping that argument made no difference at all.

@swt2c
Copy link
Collaborator

swt2c commented Mar 11, 2025

Have you ever successfully built wxPython under Cygwin before? I'd be surprised if it worked. wxPython is not really set up for cross-compiling.

But specifically in this case, it seems strange to use the --use_syswx argument, as it is trying to use the Linux version of wxWidgets.

@hamishmb
Copy link
Author

Yeah, I've built 4.0.x and 4.1.x successfully. Bear in mind this is building the GTK3 version, not the "native" Windows version - I'm not cross-compiling.

@swt2c
Copy link
Collaborator

swt2c commented Mar 11, 2025

Well for starters, your system wx needs to be v3.2.6.

Aside from that, you can set the WX_CONFIG environment variable to the path of your wx-config.

@hamishmb
Copy link
Author

Yep, I've got wx v3.2.6.

Okay, thanks for the tip, I'll give that a go when I'm next working on this - I'm done for the day now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants