building 32bits library always fails

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.
El_isra
Knows some wx things
Knows some wx things
Posts: 40
Joined: Tue Apr 13, 2021 1:10 am
Location: Buenos Aires, Argentina
Contact:

building 32bits library always fails

Post by El_isra » Sun Jul 18, 2021 12:09 am

it fails on this line: without error output, if I re-execute the command it eventually fails with an error mesage

Code: Select all

..\..\include/wx/geometry.h:634:21: note: because 'wxRect2DDouble' has user-provided 'wxRect2DDouble& wxRect2DDouble::op
erator=(const wxRect2DDouble&)'
  634 |     wxRect2DDouble& operator = (const wxRect2DDouble& rect);
      |                     ^~~~~~~~
I'm testing again to post error message here...
the command i'm testing this time is:

Code: Select all

%min32%\mingw32-make -j4 -f makefile.gcc CXXFLAGS="-std=gnu++11" BUILD=debug UNICODE=1 SHARED=0 MONOLITHIC=1
obviously i used setup_h before...

Currently testing on TDM-GCC 32 bits because codeblocks default compiler can't build any 32bit program, even small projects like this: https://github.com/israpps/DiagBox

El_isra
Knows some wx things
Knows some wx things
Posts: 40
Joined: Tue Apr 13, 2021 1:10 am
Location: Buenos Aires, Argentina
Contact:

Re: building 32bits library always fails

Post by El_isra » Sun Jul 18, 2021 12:13 am

finally got that shitty error message:

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
      |          ^~~~~~~~~~
makefile.gcc:9607: recipe for target 'gcc_mswud\monolib_mediactrl_am.o' failed
mingw32-make: *** [gcc_mswud\monolib_mediactrl_am.o] Error 1
mingw32-make: *** Waiting for unfinished jobs....

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

Re: building 32bits library always fails

Post by stahta01 » Sun Jul 18, 2021 9:58 pm

What wxWidgets version are you building?
Which GCC version are you using?
Is it an MinGW64 or an mingw.org based GCC compiler?
You do know that using Monolithic build is normally more likely to be broken, right?

Tim S.

El_isra
Knows some wx things
Knows some wx things
Posts: 40
Joined: Tue Apr 13, 2021 1:10 am
Location: Buenos Aires, Argentina
Contact:

Re: building 32bits library always fails

Post by El_isra » Sun Jul 18, 2021 10:08 pm

stahta01 wrote:
Sun Jul 18, 2021 9:58 pm
What wxWidgets version are you building?
Which GCC version are you using?
Is it an MinGW64 or an mingw.org based GCC compiler?
You do know that using Monolithic build is normally more likely to be broken, right?

Tim S.
1) latest stable release

2) gcc versión 10.3.0 (tdm-1)

3) how do i check that?

4) i know, irrelevant however, since both of them fail on the same error

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

Re: building 32bits library always fails

Post by stahta01 » Sun Jul 18, 2021 10:27 pm

So, you are using a very old stable version of unknown number!

Apply the patch and see it it fixes the problem.

Code: Select all

From 8a479f9dd82ba86a7122661fb10e5f3cf8ffa747 Mon Sep 17 00:00:00 2001
From: Maarten Bent <MaartenBent@users.noreply.github.com>
Date: Thu, 16 Aug 2018 20:08:56 +0200
Subject: [PATCH] Fix c++11-narrowing error when using clang on Windows

Case value 0xfffffd9f results in the following error:
error: case value evaluates to 4294966687, which cannot be narrowed to type
'DISPID' (aka 'long') [-Wc++11-narrowing]

(cherry picked from commit fd81223a2f878757158b5266c362da71d43abee5)
---
 src/msw/mediactrl_am.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/msw/mediactrl_am.cpp b/src/msw/mediactrl_am.cpp
index f5b9ed4a61..674da36e46 100644
--- a/src/msw/mediactrl_am.cpp
+++ b/src/msw/mediactrl_am.cpp
@@ -2179,7 +2179,9 @@ void wxAMMediaBackend::Move(int WXUNUSED(x), int WXUNUSED(y),
 //---------------------------------------------------------------------------
 void wxAMMediaEvtHandler::OnActiveX(wxActiveXEvent& event)
 {
-    switch(event.GetDispatchId())
+    // cast to unsigned long to fix narrowing error with case 0xfffffd9f
+    // when using clang
+    switch (static_cast<unsigned long>(event.GetDispatchId()))
     {
 #ifndef __WXWINCE__
     case 0x00000001: // statechange in IActiveMovie
-- 
2.32.0.windows.2
Tim S.

El_isra
Knows some wx things
Knows some wx things
Posts: 40
Joined: Tue Apr 13, 2021 1:10 am
Location: Buenos Aires, Argentina
Contact:

Re: building 32bits library always fails

Post by El_isra » Sun Jul 18, 2021 10:30 pm

stahta01 wrote:
Sun Jul 18, 2021 10:27 pm
So, you are using a very old stable version of unknown number!

Apply the patch and see it it fixes the problem.

Code: Select all

From 8a479f9dd82ba86a7122661fb10e5f3cf8ffa747 Mon Sep 17 00:00:00 2001
From: Maarten Bent <MaartenBent@users.noreply.github.com>
Date: Thu, 16 Aug 2018 20:08:56 +0200
Subject: [PATCH] Fix c++11-narrowing error when using clang on Windows

Case value 0xfffffd9f results in the following error:
error: case value evaluates to 4294966687, which cannot be narrowed to type
'DISPID' (aka 'long') [-Wc++11-narrowing]

(cherry picked from commit fd81223a2f878757158b5266c362da71d43abee5)
---
 src/msw/mediactrl_am.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/msw/mediactrl_am.cpp b/src/msw/mediactrl_am.cpp
index f5b9ed4a61..674da36e46 100644
--- a/src/msw/mediactrl_am.cpp
+++ b/src/msw/mediactrl_am.cpp
@@ -2179,7 +2179,9 @@ void wxAMMediaBackend::Move(int WXUNUSED(x), int WXUNUSED(y),
 //---------------------------------------------------------------------------
 void wxAMMediaEvtHandler::OnActiveX(wxActiveXEvent& event)
 {
-    switch(event.GetDispatchId())
+    // cast to unsigned long to fix narrowing error with case 0xfffffd9f
+    // when using clang
+    switch (static_cast<unsigned long>(event.GetDispatchId()))
     {
 #ifndef __WXWINCE__
     case 0x00000001: // statechange in IActiveMovie
-- 
2.32.0.windows.2
Tim S.
wxWidgets-3.0.5

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

Re: building 32bits library always fails

Post by stahta01 » Sun Jul 18, 2021 10:32 pm

Which compiler did you install?
Was it from here?
https://jmeubank.github.io/tdm-gcc/download/

Tim S.

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

Re: building 32bits library always fails

Post by stahta01 » Sun Jul 18, 2021 10:35 pm

El_isra wrote:
Sun Jul 18, 2021 10:30 pm
stahta01 wrote:
Sun Jul 18, 2021 10:27 pm
So, you are using a very old stable version of unknown number!

Apply the patch and see it it fixes the problem.

Code: Select all

From 8a479f9dd82ba86a7122661fb10e5f3cf8ffa747 Mon Sep 17 00:00:00 2001
From: Maarten Bent <MaartenBent@users.noreply.github.com>
Date: Thu, 16 Aug 2018 20:08:56 +0200
Subject: [PATCH] Fix c++11-narrowing error when using clang on Windows

Case value 0xfffffd9f results in the following error:
error: case value evaluates to 4294966687, which cannot be narrowed to type
'DISPID' (aka 'long') [-Wc++11-narrowing]

(cherry picked from commit fd81223a2f878757158b5266c362da71d43abee5)
---
 src/msw/mediactrl_am.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/msw/mediactrl_am.cpp b/src/msw/mediactrl_am.cpp
index f5b9ed4a61..674da36e46 100644
--- a/src/msw/mediactrl_am.cpp
+++ b/src/msw/mediactrl_am.cpp
@@ -2179,7 +2179,9 @@ void wxAMMediaBackend::Move(int WXUNUSED(x), int WXUNUSED(y),
 //---------------------------------------------------------------------------
 void wxAMMediaEvtHandler::OnActiveX(wxActiveXEvent& event)
 {
-    switch(event.GetDispatchId())
+    // cast to unsigned long to fix narrowing error with case 0xfffffd9f
+    // when using clang
+    switch (static_cast<unsigned long>(event.GetDispatchId()))
     {
 #ifndef __WXWINCE__
     case 0x00000001: // statechange in IActiveMovie
-- 
2.32.0.windows.2
Tim S.
wxWidgets-3.0.5
You might wish to try 3.0.5-1; but, I have no idea what was fixed in the dash 1; so, you need to apply the patch I have already posted.
for 3.0.5 .

El_isra
Knows some wx things
Knows some wx things
Posts: 40
Joined: Tue Apr 13, 2021 1:10 am
Location: Buenos Aires, Argentina
Contact:

Re: building 32bits library always fails

Post by El_isra » Sun Jul 18, 2021 10:37 pm

Can't remember atm.
i got the link from a code::blocks tutorial...
i'll see if i can find more....

the folder has some markdown files, inside one i found:

Code: Select all

distributed by the MinGW.org project.

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

Re: building 32bits library always fails

Post by stahta01 » Sun Jul 18, 2021 11:28 pm

El_isra wrote:
Sun Jul 18, 2021 10:08 pm
You do know that using Monolithic build is normally more likely to be broken, right?

Tim S.
4) i know, irrelevant however, since both of them fail on the same error
[/quote]

Changing from Monolithic to non Monolithic build requires the build folder to be deleted because cleaning is not enough to get rid of all the problems.
So, if you have changed Monolithic value, you need to delete the wxWidgets files and start with a new wxWidgets extraction folder.

Tim S.

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

Re: building 32bits library always fails

Post by ONEEYEMAN » Mon Jul 19, 2021 3:34 pm

Hi,
Also, keep in mind that unless you plan to work on the CodeBlocks itself, you better not use MONOLITHIC build.

Thank you.

El_isra
Knows some wx things
Knows some wx things
Posts: 40
Joined: Tue Apr 13, 2021 1:10 am
Location: Buenos Aires, Argentina
Contact:

Re: building 32bits library always fails

Post by El_isra » Mon Jul 19, 2021 8:27 pm

I always erase and decompress again the src after a failure

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

Re: building 32bits library always fails

Post by ONEEYEMAN » Mon Jul 19, 2021 9:42 pm

Hi,
So you are doing a rebuild on a CLEAN sources when you change the configuration?

Did you try to apply Tim's patch and rebuild?

Also, it would be nice to know what version of GCC/MinGW you are using and where did you get it from.

Thank you.

El_isra
Knows some wx things
Knows some wx things
Posts: 40
Joined: Tue Apr 13, 2021 1:10 am
Location: Buenos Aires, Argentina
Contact:

Re: building 32bits library always fails

Post by El_isra » Mon Jul 19, 2021 10:34 pm

the issue also happens on latest wxwidgets...
so i'm guessing it's compilers faul..
if any of you can recommend any toolchain capable of building 32bits wxwidgets programs i wil be very gratefull!

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

Re: building 32bits library always fails

Post by ONEEYEMAN » Mon Jul 19, 2021 11:51 pm

Hi,
What is your version of GCC and where did you get it?
What was you build command for the "master"?

Thank you.

Post Reply