Compiling wxWidgets 3.0.4 on Cygwin Topic is solved

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
stahta01
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 548
Joined: Fri Nov 03, 2006 2:00 pm

Re: Compiling wxWidgets 3.0.4 on Cygwin

Post by stahta01 »

What OpenGL libs did you install in Cygwin?

Edit: I am trying mesa library
hamishmb
Knows some wx things
Knows some wx things
Posts: 29
Joined: Mon Jul 08, 2019 8:48 pm
Location: /usr/lib/python3/

Re: Compiling wxWidgets 3.0.4 on Cygwin

Post by hamishmb »

Are you sure you need X11? Are you sure this worked with wx 3.0.3? If yes, you may want to open a ticket at http://trac.wxwidgets.org

This is probably a configuration that hardly anyone ever tests, so it's possible that it becomes broken unnoticed.
Yeah, there is an official Cygwin package for 3.0.3 that was built with --with-x11, and I built it too to make sure I'd (at least sort of) set things up right. I'll have a look at doing that, but I'm thinking it's probably something with my configuration to be honest. The cygwin-provided package used a bunch of patches to build, but they don't seem to help me with wxwidgets-3.0.4.

I can live with bugs, I just want to get it built to be honest. I've been trying on and off for a while now.

My output is:

Code: Select all

Configured wxWidgets 3.0.4 for `i686-pc-cygwin'

  Which GUI toolkit should wxWidgets use?                 x11
  Should wxWidgets be compiled into single library?       no
  Should wxWidgets be linked as a shared library?         yes
  Should wxWidgets support Unicode?                       yes (using wchar_t)
  What level of wxWidgets compatibility should be enabled?
                                       wxWidgets 2.6      no
                                       wxWidgets 2.8      yes
  Which libraries should wxWidgets use?
                                       STL                no
                                       jpeg               sys
                                       png                sys
                                       regex              builtin
                                       tiff               sys
                                       xpm                yes
                                       zlib               sys
                                       expat              sys
                                       libmspack          no
                                       sdl                no
As you can see, I'm doing 32-bit, which might not be helping. I am also using mesa. Are you having more luck with the 64-bit version of Cygwin?
stahta01
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 548
Joined: Fri Nov 03, 2006 2:00 pm

Re: Compiling wxWidgets 3.0.4 on Cygwin

Post by stahta01 »

official Cygwin package for 3.0.3 that was built with --with-x11
False, there is a official Cygwin package for 3.0.3 that was built with GTK that uses x11.

Tim S.
stahta01
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 548
Joined: Fri Nov 03, 2006 2:00 pm

Re: Compiling wxWidgets 3.0.4 on Cygwin

Post by stahta01 »

Cygwin 64 bit had build issues for wxX11; I suggest you try wxGTK instead.
No idea whether 64 bit or 32 bit would be better.

Edit: Added example build command.
Edit2: Add --disable-precomp-headers

Code: Select all

../configure --with-gtk --enable-debug --enable-unicode --with-opengl  --disable-precomp-headers
Edit: Add packages that I think are likely needed

Code: Select all

libGLU-devel
mesa
make
gcc-g++
libgtk2.0-devel
Tim S.
stahta01
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 548
Joined: Fri Nov 03, 2006 2:00 pm

Re: Compiling wxWidgets 3.0.4 on Cygwin

Post by stahta01 »

Looking at Cygwin headers "sys/features.h" and "pthread.h" I think that _XOPEN_SOURCE=500 is needed.

Edit: Add old wiki page that needs updated; if, I can find out how to build wxWidgets under Cygwin.
https://wiki.wxwidgets.org/Cygwin

Tim S.
stahta01
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 548
Joined: Fri Nov 03, 2006 2:00 pm

Re: Compiling wxWidgets 3.0.4 on Cygwin

Post by stahta01 »

Code: Select all

CPPFLAGS='-D_XOPEN_SOURCE=500 -D_DEFAULT_SOURCE'  ../configure --with-gtk --enable-debug --enable-unicode --with-opengl
I think I have gotten your problem fixed; too tired to test it to be sure.

The above should work with "--with-gtk" replaced with "--with-x11"

Tim S.
hamishmb
Knows some wx things
Knows some wx things
Posts: 29
Joined: Mon Jul 08, 2019 8:48 pm
Location: /usr/lib/python3/

Re: Compiling wxWidgets 3.0.4 on Cygwin

Post by hamishmb »

Hmm, I checked the arguments in the cygport file, but yes I want to build against GTK anyway, so that's cool. I sort of assumed that --with-gtk implies --with-x11, but maybe not.

I can't check this right now, but it sounds promising! Thank you so much, I will check when I get home :)
stahta01
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 548
Joined: Fri Nov 03, 2006 2:00 pm

Re: Compiling wxWidgets 3.0.4 on Cygwin

Post by stahta01 »

wxWidgets git master needed the below command to build wx base library; still building core and the other libs.
Edit: Just error-ed out with new error building wx core lib. The error looks to be 64 bit only issue.

Code: Select all

CPPFLAGS='-D_GNU_SOURCE' \
../configure --with-gtk --enable-debug --enable-unicode --with-opengl
Last edited by stahta01 on Sat Jul 13, 2019 5:13 pm, edited 1 time in total.
User avatar
doublemax
Moderator
Moderator
Posts: 19114
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Compiling wxWidgets 3.0.4 on Cygwin

Post by doublemax »

Maybe it's time to ask on the mailing list / Google group where you can reach the core developers:
https://groups.google.com/forum/#!forum/wx-users
Use the source, Luke!
stahta01
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 548
Joined: Fri Nov 03, 2006 2:00 pm

Re: Compiling wxWidgets 3.0.4 on Cygwin

Post by stahta01 »

doublemax wrote: Sat Jul 13, 2019 5:12 pm Maybe it's time to ask on the mailing list / Google group where you can reach the core developers:
https://groups.google.com/forum/#!forum/wx-users
Noop, I would not ask there; till I fail to make progress.

Already got the OP fix and the same fix works on wx 3.0 git branch.

Edit: I am one of the few that does msys2 pull requests to wx git master; so, I might be the best person to fix this issue on building Cygwin. Unless, an Cygwin user steps up.

Edit2: And so far all issues have been Cygwin instead of wxWidgets caused.

Tim S.
hamishmb
Knows some wx things
Knows some wx things
Posts: 29
Joined: Mon Jul 08, 2019 8:48 pm
Location: /usr/lib/python3/

Re: Compiling wxWidgets 3.0.4 on Cygwin

Post by hamishmb »

Looks like it worked - successfully compiled. I will try the demos when I have some more time :). I'll probably stick to 32-bit builds, because they'll work on 64-bit Windows, but not vice-versa.

Thank you so much, I've been messing with this for a really long time and you figured it out really quickly :lol:
stahta01
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 548
Joined: Fri Nov 03, 2006 2:00 pm

Re: Compiling wxWidgets 3.0.4 on Cygwin

Post by stahta01 »

According to wxWidgets docs that I have read in the past 24 hour.

Cygwin (Native GCC) should be able to build three wx toolkits
wxGTK
wxX11
wxMotif

Once, I get all three of them to build using Cygwin 32 bit.
I will create the updated documentation and do a Pull Request.
By then, I will likely know if it is a real wxWidgets 3.1.x 64 bit build issue and will likely report that problem as part of the PR for Cygwin documentation.

Tim S.
stahta01
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 548
Joined: Fri Nov 03, 2006 2:00 pm

Re: Compiling wxWidgets 3.0.4 on Cygwin

Post by stahta01 »

If you are still trying to build wxX11 see https://trac.wxwidgets.org/ticket/16813

Edit adding configure option --enable-monolithic should avoid this build error.

Tim S.
hamishmb
Knows some wx things
Knows some wx things
Posts: 29
Joined: Mon Jul 08, 2019 8:48 pm
Location: /usr/lib/python3/

Re: Compiling wxWidgets 3.0.4 on Cygwin

Post by hamishmb »

Excellent, thanks again for all the help. This has been on the backburner for a while, but hopefully I'll have some time to work on this again soon.

It did build for GTK2 and GTK3 though, so I think you've resolved my problem :)
hamishmb
Knows some wx things
Knows some wx things
Posts: 29
Joined: Mon Jul 08, 2019 8:48 pm
Location: /usr/lib/python3/

Re: Compiling wxWidgets 3.0.4 on Cygwin

Post by hamishmb »

So, I've now had some time to mess about with this again. I was just getting to make a cygport file, but after the upgrade I just did to cygwin, the openGL libraries aren't being found any more. I have no idea why, because they're all still there, but the build options that were working before have now stopped working.

It seems okay if I disable openGL. Are there any repercussions for doing that?

Hamish
Post Reply