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
Super wx Problem Solver
Super wx Problem Solver
Posts: 262
Joined: Fri Nov 03, 2006 2:00 pm

Re: Compiling wxWidgets 3.0.4 on Cygwin

Post by stahta01 » Fri Jul 12, 2019 4:42 pm

What OpenGL libs did you install in Cygwin?

Edit: I am trying mesa library

hamishmb
Earned a small fee
Earned a small fee
Posts: 14
Joined: Mon Jul 08, 2019 8:48 pm

Re: Compiling wxWidgets 3.0.4 on Cygwin

Post by hamishmb » Fri Jul 12, 2019 6:13 pm

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
Super wx Problem Solver
Super wx Problem Solver
Posts: 262
Joined: Fri Nov 03, 2006 2:00 pm

Re: Compiling wxWidgets 3.0.4 on Cygwin

Post by stahta01 » Sat Jul 13, 2019 12:55 am

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
Super wx Problem Solver
Super wx Problem Solver
Posts: 262
Joined: Fri Nov 03, 2006 2:00 pm

Re: Compiling wxWidgets 3.0.4 on Cygwin

Post by stahta01 » Sat Jul 13, 2019 1:26 am

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
Super wx Problem Solver
Super wx Problem Solver
Posts: 262
Joined: Fri Nov 03, 2006 2:00 pm

Re: Compiling wxWidgets 3.0.4 on Cygwin

Post by stahta01 » Sat Jul 13, 2019 3:33 am

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
Super wx Problem Solver
Super wx Problem Solver
Posts: 262
Joined: Fri Nov 03, 2006 2:00 pm

Re: Compiling wxWidgets 3.0.4 on Cygwin

Post by stahta01 » Sat Jul 13, 2019 6:45 am

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
Earned a small fee
Earned a small fee
Posts: 14
Joined: Mon Jul 08, 2019 8:48 pm

Re: Compiling wxWidgets 3.0.4 on Cygwin

Post by hamishmb » Sat Jul 13, 2019 10:37 am

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
Super wx Problem Solver
Super wx Problem Solver
Posts: 262
Joined: Fri Nov 03, 2006 2:00 pm

Re: Compiling wxWidgets 3.0.4 on Cygwin

Post by stahta01 » Sat Jul 13, 2019 4:58 pm

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: 13879
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Compiling wxWidgets 3.0.4 on Cygwin

Post by doublemax » 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
Use the source, Luke!

stahta01
Super wx Problem Solver
Super wx Problem Solver
Posts: 262
Joined: Fri Nov 03, 2006 2:00 pm

Re: Compiling wxWidgets 3.0.4 on Cygwin

Post by stahta01 » Sat Jul 13, 2019 5:15 pm

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
Earned a small fee
Earned a small fee
Posts: 14
Joined: Mon Jul 08, 2019 8:48 pm

Re: Compiling wxWidgets 3.0.4 on Cygwin

Post by hamishmb » Sat Jul 13, 2019 9:28 pm

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
Super wx Problem Solver
Super wx Problem Solver
Posts: 262
Joined: Fri Nov 03, 2006 2:00 pm

Re: Compiling wxWidgets 3.0.4 on Cygwin

Post by stahta01 » Sun Jul 14, 2019 12:19 am

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
Super wx Problem Solver
Super wx Problem Solver
Posts: 262
Joined: Fri Nov 03, 2006 2:00 pm

Re: Compiling wxWidgets 3.0.4 on Cygwin

Post by stahta01 » Mon Jul 15, 2019 11:12 pm

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
Earned a small fee
Earned a small fee
Posts: 14
Joined: Mon Jul 08, 2019 8:48 pm

Re: Compiling wxWidgets 3.0.4 on Cygwin

Post by hamishmb » Tue Aug 06, 2019 8:30 pm

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 :)

Post Reply