Author Topic: Build C::B against wx3.02 with gcc 5.2 under Windows  (Read 88147 times)

Offline mageia

  • Multiple posting newcomer
  • *
  • Posts: 16
Re: Build C::B against wx3.02 with gcc 5.2 under Windows
« Reply #120 on: November 26, 2015, 10:30:51 am »
thanks again for ollydbg's time and patience,it works
iin my case i think the key is the first link and i modify wxwidgets 3.02's config.gcc,the second link sound like set gnu++11 on and i already done
//
# Standard flags for C++
CXXFLAGS=-std=gnu++11 -fpermissive -Wno-unused-local-typedefs -fno-keep-inline-dllexport
# Standard preprocessor flags (common for CC and CXX)
CPPFLAGS ?= -DHAVE_TR1_TYPE_TRAITS
//
and build wxwidgets and codeblocks,and it works

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5931
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Build C::B against wx3.02 with gcc 5.2 under Windows
« Reply #121 on: December 06, 2015, 08:20:01 am »
...
Any one know how to remove such warning?
...
You have to add a using directive for the function in the parent class. If our function does something special and using the original function is not a good idea you can put the using directive in the private/protected section.
This patch can fix the warning:
Code
diff --git a/src/include/cbauibook.h b/src/include/cbauibook.h
index a32ad7a..52aabd5 100644
--- a/src/include/cbauibook.h
+++ b/src/include/cbauibook.h
@@ -393,6 +393,11 @@ class DLLIMPORT cbAuiNotebook : public wxAuiNotebook
          */
         static int s_advanceDirection;
 
+    private:
+        // the following two using directives remove the "-Woverloaded-virtual" warnings
+        using wxAuiNotebook::AddPage;
+        using wxAuiNotebook::InsertPage;
+
         DECLARE_EVENT_TABLE()
 };
OK to commit?
Question: do I need to add a "#if wxCHECK_VERSION(3,0,0)" check?
I just checked the wx-2.8.12's include\wx\aui\auibook.h, I don't see the virtual function named AddPage there. Instead, I see two overload functions:
Code
    bool AddPage(wxWindow* page, const wxAuiNotebookPage& info);
....
    bool AddPage(wxWindow* page,
                 const wxString& caption,
                 bool select = false,
                 const wxBitmap& bitmap = wxNullBitmap);
...
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: 13413
    • Travis build status
Re: Build C::B against wx3.02 with gcc 5.2 under Windows
« Reply #122 on: December 06, 2015, 06:49:46 pm »
Should be safe to commit I think, it doesn't even change the ABI.

Also I think you don't have to add checks for wx3.0, because I think that I've seen this warning with wx2.8.
(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!]

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5931
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Build C::B against wx3.02 with gcc 5.2 under Windows
« Reply #123 on: July 03, 2016, 03:19:54 am »
Some news about the crash issue: sounds like an optimizer issue of GCC, see Re: SVN build crashes when trying to editing/adding new compiler flags
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.