Error building wxWidgets 3.0.x

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.
Post Reply
maunix
In need of some credit
In need of some credit
Posts: 3
Joined: Tue Jan 21, 2020 12:45 pm

Error building wxWidgets 3.0.x

Post by maunix » Mon Jun 08, 2020 7:20 pm

Hi, I am testing wxWidgets and I was able to compile and use it until I had the, not so good idea, to update my msys2 platform (using pacman) , and then having the error that libraries and source don't share the same compiler. And now I can't get the wxwidgets built.

With the upgrade, I have gcc version 10.1.0 and I get this error when trying to build it for Windows, under wxWidgets-3.0.5/build/msw

I use this command to make the build. first I use clean and then without it

Code: Select all

mingw32-make -f makefile.gcc BUILD=release SHARED=0 MONOLITHIC=1 UNICODE=1 clean

Code: Select all

mingw32-make -f makefile.gcc BUILD=release SHARED=0 MONOLITHIC=1 UNICODE=1
The error is this one and it is always on the same file

Code: Select all

../../src/msw/mediactrl_am.cpp: In member function 'void wxAMMediaEvtHandler::OnActiveX(wxActiveXEvent&)':
../../src/msw/mediactrl_am.cpp:2234:10: error: narrowing conversion of '4294966687' from 'unsigned int' to 'long int' [-Wnarrowing]
 2234 |     case 0xfffffd9f: // readystatechange in IActiveMovie2 and IMediaPlayer
      |          ^~~~~~~~~~
mingw32-make: *** [makefile.gcc:9607: gcc_mswu\monolib_mediactrl_am.o] Error 1

I do have a copy of the previous version of the compiler and tools, based on gcc v7.2.0 but it also fails to build.
I am using sources from wxWidgets-3.0.4 and wxWidgets-3.0.5 but both throw the same error.
Is there anything I can send as parameter in order to solve that error without having to edit the make file?

Any hint will be appreciated, may be the solution is right fron my eyes and I can't see it.

BTW in linux I don't have any issue is with Windows the problem.

User avatar
doublemax
Moderator
Moderator
Posts: 14976
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Error building wxWidgets 3.0.x

Post by doublemax » Mon Jun 08, 2020 9:00 pm

Do you have to use the old 3.0.x versions? In the latest version from GIT, the respective code has a comment that mentions this very error message:

Code: Select all

void wxAMMediaEvtHandler::OnActiveX(wxActiveXEvent& event)
{
    // cast to unsigned long to fix narrowing error with case 0xfffffd9f
    // when using clang
    switch (static_cast<unsigned long>(event.GetDispatchId()))
    { 
If possible, use a newer wxWidgets version. Alternatively you could try to apply this change to your local wxWidgets code base.
Use the source, Luke!

maunix
In need of some credit
In need of some credit
Posts: 3
Joined: Tue Jan 21, 2020 12:45 pm

Re: Error building wxWidgets 3.0.x

Post by maunix » Tue Jun 09, 2020 6:39 pm

Hi doublemax, I came back to thank you.

With 3.1.3 I was able to build it perfectly using msys2 environment using gcc 10.1.0 64bit.

I wasn't forced to use 3.0.x but it was the one I was using in my tests so it was weird to change it.

Thanks!

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 4245
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Error building wxWidgets 3.0.x

Post by ONEEYEMAN » Tue Jun 09, 2020 6:50 pm

Hi,
Shouldn't be weird.
People do upgrades all the time. ;-)

Thank you.

maunix
In need of some credit
In need of some credit
Posts: 3
Joined: Tue Jan 21, 2020 12:45 pm

Re: Error building wxWidgets 3.0.x

Post by maunix » Tue Jun 09, 2020 6:55 pm

ONEEYEMAN wrote:
Tue Jun 09, 2020 6:50 pm
Hi,
Shouldn't be weird.
People do upgrades all the time. ;-)
Yes, of course. But as it those sources built ok with gcc 7.2 and using back the same compiler didn't work either but it seems to be that some other library was updated.

New sources did the job :) :D

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 4245
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Error building wxWidgets 3.0.x

Post by ONEEYEMAN » Tue Jun 09, 2020 7:07 pm

Hi,
wxWidgets is known not to build with the new MinGW compilers. ;-)
So every time you update the compiler be ready to update wxWidgets.

Thank you.

Post Reply