Code::Blocks Forums

User forums => Help => Topic started by: gd_on on March 17, 2014, 09:19:06 am

Title: r9741 compile error with wx3.0 on Windows
Post by: gd_on on March 17, 2014, 09:19:06 am
When trying to compile C::B svn 9741 with wxwidgets 3.0, using CodeBlocks_wx30.workspace (full rebuild), I obtain a compile error in cbplugin.cpp, more precisely in ccmanager.h line 94 (no problems with wxwidgets 2.8.12 in 32 or 64 bits) :
Code
-------------- Générer : sdk dans Code::Blocks wx3.0.x (compilateur : GNU GCC Compiler)---------------

mingw32-g++.exe -Wall -O -pipe -mthreads -fmessage-length=0 -fexceptions -DHAVE_W32API_H -D__WXMSW__ -DWXUSINGDLL -DcbDEBUG -DNOPCH -DwxUSE_UNICODE -Woverloaded-virtual -DEXPORT_LIB -DEXPORT_EVENTS -DWXMAKINGDLL_SCI -IC:\wxWidgets-3.0.0\include -IC:\wxWidgets-3.0.0\lib\gcc_dll\mswu -Isdk\wxscintilla\include -Iinclude\tinyxml -Iinclude -Iinclude\tinyxml -Iinclude\scripting\bindings -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 -c D:\gdurand.ONL\Documents\00_svn_CodeBlocks\CodeBlocks_src\trunk\src\sdk\configmanager-revision.cpp -o .objs30\sdk\configmanager-revision.o
...

mingw32-g++.exe -Wall -O -pipe -mthreads -fmessage-length=0 -fexceptions -DHAVE_W32API_H -D__WXMSW__ -DWXUSINGDLL -DcbDEBUG -DNOPCH -DwxUSE_UNICODE -Woverloaded-virtual -DEXPORT_LIB -DEXPORT_EVENTS -DWXMAKINGDLL_SCI -IC:\wxWidgets-3.0.0\include -IC:\wxWidgets-3.0.0\lib\gcc_dll\mswu -Isdk\wxscintilla\include -Iinclude\tinyxml -Iinclude -Iinclude\tinyxml -Iinclude\scripting\bindings -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 -c D:\gdurand.ONL\Documents\00_svn_CodeBlocks\CodeBlocks_src\trunk\src\sdk\cbstatusbar.cpp -o .objs30\sdk\cbstatusbar.o
In file included from D:\gdurand.ONL\Documents\00_svn_CodeBlocks\CodeBlocks_src\trunk\src\sdk\cbplugin.cpp:39:0:
include/ccmanager.h:94:9: error: 'wxListView' does not name a type
         wxListView* m_pAutocompPopup;
         ^
Le processus s'est terminé avec le code d'état 1 (0 minute(s), 47 seconde(s))
 
Le processus s'est terminé avec le code d'état 0 (0 minute(s), 51 seconde(s))
1 erreur(s), 8 avertissement(s) (0 minute(s), 51 seconde(s))


Here are the lines in ccmanager.h:
Code
92         wxPoint m_DocPos;
93 #ifdef __WXMSW__
94         wxListView* m_pAutocompPopup;
95 #endif // __WXMSW__
96         cbEditor* m_pLastEditor;

as far as I know, I have generated wxWidgets 3.0 as indicated in the wiki, with tdm 4.8.1 mingw 32 version.

gd_on
Title: Re: r9741 compile error with wx3.0 on Windows
Post by: joinAero on March 17, 2014, 02:22:04 pm
Not forward declaration for class wxListView.

ccmanager.h:

Code
16 class UnfocusablePopupWindow;
17 class wxHtmlLinkEvent;
18 class wxHtmlWindow;
19 class wxListEvent;
20 class wxListView;  // Added
21 class wxScintillaEvent;
Title: Re: r9741 compile error with wx3.0 on Windows
Post by: gd_on on March 17, 2014, 07:10:27 pm
adding this line n° 20, solve this specific problem apparently, but there is an other one when linking codeblocks.dll some time after in the compilation process.
So, this patch is not sufficient (at least for me !). sorry.

gd_on
Title: Re: r9741 compile error with wx3.0 on Windows
Post by: stahta01 on March 17, 2014, 08:01:34 pm
Not forward declaration for class wxListView.

A patch doing your fix; still compiling CB core project using wxWidgets 3.0 on windows 32 bit (CodeBlocks_wx30.cbp).

Code
Index: src/include/ccmanager.h
===================================================================
--- src/include/ccmanager.h (revision 9741)
+++ src/include/ccmanager.h (working copy)
@@ -17,6 +17,7 @@
 class wxHtmlLinkEvent;
 class wxHtmlWindow;
 class wxListEvent;
+class wxListView;
 class wxScintillaEvent;
 
 class DLLIMPORT CCManager : public Mgr<CCManager>, wxEvtHandler

Edit: The CB SDK compiled without error.
Edit2: Finished building CodeBlocks_wx30.cbp without error.

Tim S.
Title: Re: r9741 compile error with wx3.0 on Windows
Post by: Alpha on March 17, 2014, 09:02:50 pm
adding this line n° 20, solve this specific problem apparently, but there is an other one when linking codeblocks.dll some time after in the compilation process.
So, this patch is not sufficient (at least for me !). sorry.
Could you post the error message please?

Edit2: Finished building CodeBlocks_wx30.cbp without error.
Adding this forward declare, CodeBlocks_wx30_64.cbp builds for me.
Title: Re: r9741 compile error with wx3.0 on Windows
Post by: gd_on on March 17, 2014, 10:04:59 pm
Here is the error I have (I have deleted some lines that I suppose have no problems):
Quote
-------------- Générer : sdk dans Code::Blocks wx3.0.x (compilateur : GNU GCC Compiler)---------------

Compilation : sdk\configmanager-revision.cpp
Compilation : sdk\cbplugin.cpp
...
Compilation : sdk\editormanager.cpp
In file included from include/cbauibook.h:10:0,
                 from C:\Users\Gerard_2\Documents\CodeBlocks_SVN\CodeBlocks_src\src\sdk\editorbase.cpp:26:
C:\wxWidgets-3.0.0\include/wx/aui/auibook.h:349:18: warning: 'virtual bool wxAuiNotebook::AddPage(wxWindow*, const wxString&, bool, int)' was hidden [-Woverloaded-virtual]
     virtual bool AddPage(wxWindow *page, const wxString &text, bool select,
                  ^
...

Compilation : sdk\projecttemplateloader.cpp
In file included from include/cbauibook.h:10:0,
                 from C:\Users\Gerard_2\Documents\CodeBlocks_SVN\CodeBlocks_src\src\sdk\projectmanager.cpp:35:
C:\wxWidgets-3.0.0\include/wx/aui/auibook.h:349:18: warning: 'virtual bool wxAuiNotebook::AddPage(wxWindow*, const wxString&, bool, int)' was hidden [-Woverloaded-virtual]
     virtual bool AddPage(wxWindow *page, const wxString &text, bool select,
                  ^
In file included from C:\Users\Gerard_2\Documents\CodeBlocks_SVN\CodeBlocks_src\src\sdk\projectmanager.cpp:35:0:
include/cbauibook.h:132:14: warning:   by 'bool cbAuiNotebook::AddPage(wxWindow*, const wxString&, bool, const wxBitmap&)' [-Woverloaded-virtual]
         bool AddPage(wxWindow* page,
              ^
In file included from include/cbauibook.h:10:0,
                 from C:\Users\Gerard_2\Documents\CodeBlocks_SVN\CodeBlocks_src\src\sdk\projectmanager.cpp:35:
C:\wxWidgets-3.0.0\include/wx/aui/auibook.h:352:18: warning: 'virtual bool wxAuiNotebook::InsertPage(size_t, wxWindow*, const wxString&, bool, int)' was hidden [-Woverloaded-virtual]
     virtual bool InsertPage(size_t index, wxWindow *page, const wxString &text,
                  ^
In file included from C:\Users\Gerard_2\Documents\CodeBlocks_SVN\CodeBlocks_src\src\sdk\projectmanager.cpp:35:0:
include/cbauibook.h:147:14: warning:   by 'bool cbAuiNotebook::InsertPage(size_t, wxWindow*, const wxString&, bool, const wxBitmap&)' [-Woverloaded-virtual]
         bool InsertPage(size_t page_idx,
              ^
Compilation : sdk\scripting\bindings\sc_consts.cpp
Compilation : sdk\scripting\bindings\sc_dialog.cpp
Compilation : sdk\scripting\bindings\sc_globals.cpp
Compilation : sdk\scripting\bindings\sc_io.cpp
In file included from include\scripting\bindings/sc_base_types.h:27:0,
                 from C:\Users\Gerard_2\Documents\CodeBlocks_SVN\CodeBlocks_src\src\sdk\scripting\bindings\sc_consts.cpp:18:
include\scripting\sqplus/sqplus.h: In instantiation of 'void SqPlus::BindConstant(SquirrelObject&, T, const SQChar*) [with T = int; SQChar = char]':
include\scripting\sqplus/sqplus.h:433:41:   required from 'void SqPlus::BindConstant(T, const SQChar*) [with T = int; SQChar = char]'
C:\Users\Gerard_2\Documents\CodeBlocks_SVN\CodeBlocks_src\src\sdk\scripting\bindings\sc_consts.cpp:32:9:   required from here
include\scripting\sqplus/sqplus.h:420:8: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   *pvr = VarRef(*(void **)&cv,TypeInfo<T>(),0,0,sizeof(constant),VAR_ACCESS_CONSTANT,TypeInfo<T>().typeName);
        ^
Compilation : sdk\scripting\bindings\sc_plugin.cpp
Compilation : sdk\scripting\bindings\sc_progress.cpp
In file included from include\scripting\bindings/sc_base_types.h:27:0,
                 from C:\Users\Gerard_2\Documents\CodeBlocks_SVN\CodeBlocks_src\src\sdk\scripting\bindings\sc_io.cpp:26:
include\scripting\sqplus/sqplus.h: In instantiation of 'void SqPlus::BindConstant(SquirrelObject&, T, const SQChar*) [with T = bool; SQChar = char]':
include\scripting\sqplus/sqplus.h:433:41:   required from 'void SqPlus::BindConstant(T, const SQChar*) [with T = bool; SQChar = char]'
C:\Users\Gerard_2\Documents\CodeBlocks_SVN\CodeBlocks_src\src\sdk\scripting\bindings\sc_io.cpp:259:59:   required from here
include\scripting\sqplus/sqplus.h:420:8: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   *pvr = VarRef(*(void **)&cv,TypeInfo<T>(),0,0,sizeof(constant),VAR_ACCESS_CONSTANT,TypeInfo<T>().typeName);
        ^
Compilation : sdk\scripting\bindings\sc_util_dialogs.cpp
Compilation : sdk\scripting\bindings\sc_wxtypes.cpp
Compilation : sdk\scripting\bindings\scriptbindings.cpp
In file included from include\scripting\bindings/sc_base_types.h:27:0,
                 from C:\Users\Gerard_2\Documents\CodeBlocks_SVN\CodeBlocks_src\src\sdk\scripting\bindings\sc_util_dialogs.cpp:18:
include\scripting\sqplus/sqplus.h: In instantiation of 'void SqPlus::BindConstant(SquirrelObject&, T, const SQChar*) [with T = int; SQChar = char]':
include\scripting\sqplus/sqplus.h:433:41:   required from 'void SqPlus::BindConstant(T, const SQChar*) [with T = int; SQChar = char]'
C:\Users\Gerard_2\Documents\CodeBlocks_SVN\CodeBlocks_src\src\sdk\scripting\bindings\sc_util_dialogs.cpp:275:98:   required from here
include\scripting\sqplus/sqplus.h:420:8: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   *pvr = VarRef(*(void **)&cv,TypeInfo<T>(),0,0,sizeof(constant),VAR_ACCESS_CONSTANT,TypeInfo<T>().typeName);
        ^
Compilation : sdk\scriptingmanager.cpp
In file included from include\scripting\bindings/sc_base_types.h:27:0,
                 from C:\Users\Gerard_2\Documents\CodeBlocks_SVN\CodeBlocks_src\src\sdk\scripting\bindings\sc_wxtypes.cpp:18:
include\scripting\sqplus/sqplus.h: In instantiation of 'SqPlus::SQClassDef<TClassType>& SqPlus::SQClassDef<TClassType>::var(VarType TClassType::*, const SQChar*, SqPlus::VarAccessType) [with VarType = int; TClassType = wxPoint; SQChar = char]':
C:\Users\Gerard_2\Documents\CodeBlocks_SVN\CodeBlocks_src\src\sdk\scripting\bindings\sc_wxtypes.cpp:340:37:   required from here
include\scripting\sqplus/sqplus.h:1801:98: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
     RegisterInstanceVariable(newClass,ClassType<TClassType>::type(),*(VarType **)&cv,name_,access);
                                                                                                  ^
Compilation : sdk\scriptsecuritywarningdlg.cpp
In file included from include\scripting\bindings/sc_base_types.h:27:0,
                 from C:\Users\Gerard_2\Documents\CodeBlocks_SVN\CodeBlocks_src\src\sdk\scripting\bindings\scriptbindings.cpp:28:
include\scripting\sqplus/sqplus.h: In instantiation of 'SqPlus::SQClassDef<TClassType>& SqPlus::SQClassDef<TClassType>::var(VarType TClassType::*, const SQChar*, SqPlus::VarAccessType) [with VarType = wxFileName; TClassType = ProjectFile; SQChar = char]':
C:\Users\Gerard_2\Documents\CodeBlocks_SVN\CodeBlocks_src\src\sdk\scripting\bindings\scriptbindings.cpp:408:47:   required from here
include\scripting\sqplus/sqplus.h:1801:98: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
     RegisterInstanceVariable(newClass,ClassType<TClassType>::type(),*(VarType **)&cv,name_,access);
                                                                                                  ^
include\scripting\sqplus/sqplus.h: In instantiation of 'SqPlus::SQClassDef<TClassType>& SqPlus::SQClassDef<TClassType>::var(VarType TClassType::*, const SQChar*, SqPlus::VarAccessType) [with VarType = wxString; TClassType = ProjectFile; SQChar = char]':
C:\Users\Gerard_2\Documents\CodeBlocks_SVN\CodeBlocks_src\src\sdk\scripting\bindings\scriptbindings.cpp:409:71:   required from here
include\scripting\sqplus/sqplus.h:1801:98: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
include\scripting\sqplus/sqplus.h: In instantiation of 'SqPlus::SQClassDef<TClassType>& SqPlus::SQClassDef<TClassType>::var(VarType TClassType::*, const SQChar*, SqPlus::VarAccessType) [with VarType = bool; TClassType = ProjectFile; SQChar = char]':
C:\Users\Gerard_2\Documents\CodeBlocks_SVN\CodeBlocks_src\src\sdk\scripting\bindings\scriptbindings.cpp:411:53:   required from here
include\scripting\sqplus/sqplus.h:1801:98: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
include\scripting\sqplus/sqplus.h: In instantiation of 'SqPlus::SQClassDef<TClassType>& SqPlus::SQClassDef<TClassType>::var(VarType TClassType::*, const SQChar*, SqPlus::VarAccessType) [with VarType = short unsigned int; TClassType = ProjectFile; SQChar = char]':
C:\Users\Gerard_2\Documents\CodeBlocks_SVN\CodeBlocks_src\src\sdk\scripting\bindings\scriptbindings.cpp:413:51:   required from here
include\scripting\sqplus/sqplus.h:1801:98: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
include\scripting\sqplus/sqplus.h: In instantiation of 'SqPlus::SQClassDef<TClassType>& SqPlus::SQClassDef<TClassType>::var(VarType TClassType::*, const SQChar*, SqPlus::VarAccessType) [with VarType = wxArrayString; TClassType = ProjectFile; SQChar = char]':
C:\Users\Gerard_2\Documents\CodeBlocks_SVN\CodeBlocks_src\src\sdk\scripting\bindings\scriptbindings.cpp:415:63:   required from here
include\scripting\sqplus/sqplus.h:1801:98: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
include\scripting\sqplus/sqplus.h: In instantiation of 'SqPlus::SQClassDef<TClassType>& SqPlus::SQClassDef<TClassType>::var(VarType TClassType::*, const SQChar*, SqPlus::VarAccessType) [with VarType = wxString; TClassType = PluginInfo; SQChar = char]':
C:\Users\Gerard_2\Documents\CodeBlocks_SVN\CodeBlocks_src\src\sdk\scripting\bindings\scriptbindings.cpp:701:42:   required from here
include\scripting\sqplus/sqplus.h:1801:98: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
Compilation : sdk\scrollingdialog.cpp
...
Compilation : sdk\xtra_res.cpp
Édition de liens librairie dynamique: devel30\codeblocks.dll
.objs30\sdk\configmanager-revision.o:configmanager-revision.cpp:(.text$_ZN20wxThreadHelperThread5EntryEv[__ZN20wxThreadHelperThread5EntryEv]+0x18): undefined reference to `wxCriticalSection::Enter()'
.objs30\sdk\configmanager-revision.o:configmanager-revision.cpp:(.text$_ZN20wxThreadHelperThread5EntryEv[__ZN20wxThreadHelperThread5EntryEv]+0x30): undefined reference to `wxCriticalSection::Leave()'
c:/mingw32/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: .objs30\sdk\configmanager-revision.o: bad reloc address 0x30 in section `.text$_ZN20wxThreadHelperThread5EntryEv[__ZN20wxThreadHelperThread5EntryEv]'
collect2.exe: error: ld returned 1 exit status
Le processus s'est terminé avec le code d'état 1 (1 minute(s), 11 seconde(s))
3 erreur(s), 47 avertissement(s) (1 minute(s), 11 seconde(s))
 

Could it be an interaction with a msys file, which for me is mixed in MinGW32 for a easy use? If yes, which file(s) ?

gd_on
Title: Re: r9741 compile error with wx3.0 on Windows
Post by: stahta01 on March 17, 2014, 10:53:53 pm
Re-building the main CB Project; realized I was building with non standard option "--std=gnu++11".

Edit: After removing option it still built without error.

To gd_on: I suggest deleting autorevision.h and see if that fixes the error.

Tim S.
Title: Re: r9741 compile error with wx3.0 on Windows
Post by: gd_on on March 18, 2014, 09:18:40 am
SVN 9742 corrects the first problem.
For the second one, it was my mistake. :(
In my build process with wx 3.0, there was a mix between 32 bits and 64 bits versions for the includes and the libs  ??? : a bad path configuration.
Of course, it could not work as I expected.
Now it's corrected, and it's better.
It compiles and runs. Still stability problems with some plugins (at least FortranProject), but it's not new !

gd_on