Author Topic: Building C::B against wx 3.1.1 rc under Windows  (Read 515 times)

Online ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5048
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Building C::B against wx 3.1.1 rc under Windows
« on: February 09, 2018, 05:33:31 am »
I get a build error:

Code: [Select]
[ 90.0%] g++.exe -Wall -g -O0 -pipe -mthreads -fmessage-length=0 -fexceptions -Winvalid-pch -Wno-deprecated-declarations -std=gnu++11 -DHAVE_W32API_H -D__WXMSW__ -DWXUSINGDLL -DcbDEBUG -DCB_PRECOMP -DwxUSE_UNICODE -include "sdk_precomp.h" -DEXPORT_LIB -DEXPORT_EVENTS -DWXMAKINGDLL_SCI -iquote.objs31\include -I.objs31\include -I. -IE:\wxWidgets-3.1.1-rc\include -IE:\wxWidgets-3.1.1-rc\lib\gcc_dll\mswu -Isdk\wxscintilla\include -Iinclude\tinyxml -Iinclude -Iinclude\scripting\include -Iinclude\scripting\sqplus -Iinclude\mozilla_chardet -Iinclude\mozilla_chardet\mfbt -Iinclude\mozilla_chardet\nsprpub\pr\include -Iinclude\mozilla_chardet\xpcom -Iinclude\mozilla_chardet\xpcom\base -Iinclude\mozilla_chardet\xpcom\glue -Iexchndl\win32\include -c src\switcherdlg.cpp -o .objs31\src\switcherdlg.o
src\switcherdlg.cpp: In member function 'void wxSwitcherItems::Init()':
src\switcherdlg.cpp:121:9: error: 'wxUxThemeEngine' has not been declared
     if (wxUxThemeEngine::GetIfActive())
         ^~~~~~~~~~~~~~~
src\switcherdlg.cpp: In member function 'void wxSwitcherDialog::Init()':
src\switcherdlg.cpp:930:9: error: 'wxUxThemeEngine' has not been declared
     if (wxUxThemeEngine::GetIfActive())
         ^~~~~~~~~~~~~~~
Process terminated with status 1 (3 minute(s), 24 second(s))
2 error(s), 4 warning(s) (3 minute(s), 24 second(s))


Sounds like this support is removed, see this page:
Remove MSW wxUxThemeEngine class wxWidgets/wxWidgets@ddceaab
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Online ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5048
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Building C::B against wx 3.1.1 rc under Windows
« Reply #1 on: February 09, 2018, 05:42:17 am »
Code: [Select]
src/src/switcherdlg.cpp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/src/switcherdlg.cpp b/src/src/switcherdlg.cpp
index 51142827..a53b565a 100644
--- a/src/src/switcherdlg.cpp
+++ b/src/src/switcherdlg.cpp
@@ -115,7 +115,8 @@ void wxSwitcherItems::Init()
     m_rowCount = 10;
     m_columnCount = 0;
 
-#if defined(__WXMSW__) && wxUSE_UXTHEME
+// wxUxThemeEngine class is removed before wx release 3.1.1
+#if defined(__WXMSW__) && wxUSE_UXTHEME &&!wxCHECK_VERSION(3, 1, 1)
     // If on Windows XP/Vista, use more appropriate colours.
     // Alatar: What for??? Why should we use fixed colours?
     if (wxUxThemeEngine::GetIfActive())
@@ -926,7 +927,8 @@ void wxSwitcherDialog::Init()
     m_modifierKey = -1;
     m_extraNavigationKey = -1;
 
-#if defined(__WXMSW__) && wxUSE_UXTHEME
+// wxUxThemeEngine class is removed before wx release 3.1.1
+#if defined(__WXMSW__) && wxUSE_UXTHEME && !wxCHECK_VERSION(3, 1, 1)
     if (wxUxThemeEngine::GetIfActive())
         m_borderColour = wxColour(49, 106, 197);
     else

This patch could fix such build error.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 10954
    • Travis build status
Re: Building C::B against wx 3.1.1 rc under Windows
« Reply #2 on: February 11, 2018, 03:12:31 pm »
Yes, it fixes it tool.
The switcher windows still renders fine on windows 7, so I think it is safe to commit it.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]