FYI:
The only thing that seems to need WXWIN_COMPATIBILITY_2_4 set to 1 is the use of wxHIDE_READONLY. I have submitted a patch to guard all the locations that it is used in.
Isn't it easier to just #define it to 0 for newer wxWidgets, instead of guarding it everywhere ?
#if !WXWIN_COMPATIBILITY_2_4
#define wxHIDE_READONLY 0
#endif
You were right, it seems that the crashes with wxWidgets 2.8.0 are in fact general crashes when compat24 is turned off... I'm seeing the same ones in wxWidgets 2.6.3p2 now, that I did with wxWidgets 2.8.0rc1 earlier:
Settings > Environments *crash*
../src/generic/listctrl.cpp(3699): assert "wxAssertFailure" failed: invalid item index in SetItem
Settings > Editor *crash*
../src/generic/listctrl.cpp(3699): assert "wxAssertFailure" failed: invalid item index in SetItem
Settings > Compiler and Debugger *crash*
../src/common/list.cpp(326): assert "wxAssertFailure" failed: invalid index in wxListBase::Item
Settings > Global variables *crash*
../src/mac/carbon/choice.cpp(217): assert "wxAssertFailure" failed: wxChoice::GetString(): invalid index
So it seems that debugging/fixing Code::Blocks with this compat setting turned off in wxWidgets 2.6 is a good idea to start with, as it is both good now and will also help running with wxWidgets 2.8 later ?
Can anyone suggest a windows program to convert *.h *.cpp files like:
"unix2dos *.h" ?
As seen below, I can't seem to find a program that works.
thanks
C:\Usr\Proj\cbKeyBinder\RC3>unix2dos -h
unix2dos 2.2 Copyright (c) 1994-1995 Benjamin Lin. (1995.03.31)
Usage: unix2dos [-hkqV] [-o file ...] [-c convmode] [-n infile outfile ..
-h --help give this help
-k --keepdate keep output file date
-q --quiet quiet mode, suppress all warnings
always on in stdin->stdout mode
-V --version display version number
-c --convmode conversion mode
convmode ASCII, 7bit, ISO, default to ASCII
-o --oldfile write to old file
file ... files to convert in old file mode
-n --newfile write to new file
infile original file in new file mode
outfile output file in new file mode
C:\Usr\Proj\cbKeyBinder\RC3>unix2dos -o cbkeybinder.h
unix2dos: converting file cbkeybinder.h to DOS format ...
unix2dos: can not write to output file
unix2dos: problems converting file cbkeybinder.h
C:\Usr\Proj\cbKeyBinder\RC3>unix2dos cbkeybinder.h
unix2dos: converting file cbkeybinder.h to DOS format ...
unix2dos: can not write to output file
unix2dos: problems converting file cbkeybinder.h
C:\Usr\Proj\cbKeyBinder\RC3>unix2dos cbkeybinder.h cbkeybinder.h2
unix2dos: converting file cbkeybinder.h to DOS format ...
unix2dos: can not write to output file
unix2dos: problems converting file cbkeybinder.h
C:\Usr\Proj\cbKeyBinder\RC3>unix2dos -n cbkeybinder.h cbkeybinder.h2
unix2dos: converting file cbkeybinder.h to file cbkeybinder.h2 in DOS for
unix2dos: can not write to output file
unix2dos: problems converting file cbkeybinder.h to file cbkeybinder.h2
I seem to be having lots of luck with this
http://www.gammon.com.au/downloads/dlutilities.htm
Download utilities
(http://www.gammon.com.au/downloads/dlutilities.htm
Download utilities)
It allows use of wildcards, like: *.h and *.cpp
unix2dos Version 1.01 (Gammon Software Solutions) 13-Mar-98
Processing wildcard "*.h"
cbkeybinder.h
debugging.h
keybinder.h
keybinderdef.h
menuutils.h
5 files converted.
2542 total lines converted.
0 errors.
0 warnings.
C:\Usr\Proj\cbKeyBinder\RC3>E:\User\Downloads\_Pending\Unix2Dos\unix2dos.exe *.c
pp
unix2dos Version 1.01 (Gammon Software Solutions) 13-Mar-98
Processing wildcard "*.cpp"
cbkeybinder.cpp
keybinder.cpp
menuutils.cpp
3 files converted.
4251 total lines converted.
0 errors.
0 warnings.
It also contains the a source code link.
Converting text files to/from Unix/Dos/Mac
* http://www.gammon.com.au/files/pennmush/unix2dos.zip - 19K - program to convert unix text files to DOS format
* http://www.gammon.com.au/files/pennmush/dos2unix.zip - 19K - program to convert DOS text files to Unix format
* http://www.gammon.com.au/files/pennmush/mac2unix.zip - 19K - program to convert Macintosh text files to Unix format
* http://www.gammon.com.au/files/pennmush/unix2mac.zip - 19K - program to convert Unix text files to Macintosh format
* http://www.gammon.com.au/files/pennmush/unix2dos.c - 7K - source code used to compile above 4 conversion programs
I edited the source you liked to in order to make an dos2mac command
I then ran the below commands and it looks to fix the problem.
dos2mac *.cpp
mac2unix *.cpp
unix2dos *.cpp
svn propset eol-style native *.cpp
Tim S
Uploaded the changed source to http://www.savefile.com/projects/1039215
pick DOS2UNIX.zip
where do you put svn propset eol-style native *.cpp
I am trying to compile C::B on Fedora Development with wxGTK 2.8.0 (all patches from the first post in this thread are applied) and I am getting an error when compiling PropertyGrid. Any idea?
/bin/sh ../../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I../../../src/sdk -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread -I../../../src/sdk/propgrid/include -O2 -ffast-math -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -DCB_PRECOMP -Winvalid-pch -fPIC -DPIC -MT propgrid.lo -MD -MP -MF .deps/propgrid.Tpo -c -o propgrid.lo `test -f './src/propgrid/propgrid.cpp' || echo './'`./src/propgrid/propgrid.cpp
g++ -DHAVE_CONFIG_H -I. -I../../../src/sdk -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread -I../../../src/sdk/propgrid/include -O2 -ffast-math -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -DCB_PRECOMP -Winvalid-pch -fPIC -DPIC -MT propgrid.lo -MD -MP -MF .deps/propgrid.Tpo -c ./src/propgrid/propgrid.cpp -fPIC -DPIC -o .libs/propgrid.o
/usr/include/wx-2.8/wx/hashmap.h: In member function 'wxLongToLongHashMap_wxImplementation_HashTable::Node** wxLongToLongHashMap_wxImplementation_HashTable::GetNodePtr(const long int&) const':
/usr/include/wx-2.8/wx/hashmap.h:714: warning: dereferencing type-punned pointer will break strict-aliasing rules
/usr/include/wx-2.8/wx/clntdata.h: In member function 'wxShadowObjectMethods_wxImplementation_HashTable::Node** wxShadowObjectMethods_wxImplementation_HashTable::GetNodePtr(const wxString&) const':
/usr/include/wx-2.8/wx/clntdata.h:20: warning: dereferencing type-punned pointer will break strict-aliasing rules
/usr/include/wx-2.8/wx/clntdata.h: In member function 'wxShadowObjectFields_wxImplementation_HashTable::Node** wxShadowObjectFields_wxImplementation_HashTable::GetNodePtr(const wxString&) const':
/usr/include/wx-2.8/wx/clntdata.h:25: warning: dereferencing type-punned pointer will break strict-aliasing rules
/usr/include/wx-2.8/wx/gdicmn.h: In member function 'wxStringToColourHashMap_wxImplementation_HashTable::Node** wxStringToColourHashMap_wxImplementation_HashTable::GetNodePtr(const wxString&) const':
/usr/include/wx-2.8/wx/gdicmn.h:540: warning: dereferencing type-punned pointer will break strict-aliasing rules
../../../src/sdk/propgrid/include/wx/propgrid/propgrid.h: In member function 'wxPGHashMapS2P_wxImplementation_HashTable::Node** wxPGHashMapS2P_wxImplementation_HashTable::GetNodePtr(const wxString&) const':
../../../src/sdk/propgrid/include/wx/propgrid/propgrid.h:1644: warning: dereferencing type-punned pointer will break strict-aliasing rules
../../../src/sdk/propgrid/include/wx/propgrid/propgrid.h: In member function 'wxPGHashMapI2I_wxImplementation_HashTable::Node** wxPGHashMapI2I_wxImplementation_HashTable::GetNodePtr(const size_t&) const':
../../../src/sdk/propgrid/include/wx/propgrid/propgrid.h:1668: warning: dereferencing type-punned pointer will break strict-aliasing rules
./src/propgrid/propgrid.cpp: In member function 'wxPGHashMapConstants_wxImplementation_HashTable::Node** wxPGHashMapConstants_wxImplementation_HashTable::GetNodePtr(const size_t&) const':
./src/propgrid/propgrid.cpp:988: warning: dereferencing type-punned pointer will break strict-aliasing rules
./src/propgrid/propgrid.cpp: In member function 'void wxArrayEditorDialog::OnDownClick(wxCommandEvent&)':
./src/propgrid/propgrid.cpp:2414: warning: comparison between signed and unsigned integer expressions
./src/propgrid/propgrid.cpp: In member function 'void wxPGProperty::ShowError(const wxString&)':
./src/propgrid/propgrid.cpp:2942: error: invalid static_cast from type 'wxWindow*' to type 'const wxFrame*'
./src/propgrid/propgrid.cpp:2942: error: incomplete type 'wxFrame' used in nested name specifier
./src/propgrid/propgrid.cpp:2945: error: invalid use of undefined type 'struct wxFrame'
/usr/include/wx-2.8/wx/log.h:74: error: forward declaration of 'struct wxFrame'
./src/propgrid/propgrid.cpp: In member function 'void wxPropertyGrid::DrawItems(wxDC&, unsigned int, unsigned int, const wxRect*)':
./src/propgrid/propgrid.cpp:7568: warning: 'BeginDrawing' is deprecated (declared at /usr/include/wx-2.8/wx/dc.h:392)
./src/propgrid/propgrid.cpp:7576: warning: 'EndDrawing' is deprecated (declared at /usr/include/wx-2.8/wx/dc.h:393)
./src/propgrid/propgrid.cpp: In member function 'void wxPropertyGrid::DoDrawItems(wxDC&, wxPGProperty*, wxPGProperty*, const wxRect*)':
./src/propgrid/propgrid.cpp:7781: warning: 'BeginDrawing' is deprecated (declared at /usr/include/wx-2.8/wx/dc.h:392)
./src/propgrid/propgrid.cpp:8518: warning: 'EndDrawing' is deprecated (declared at /usr/include/wx-2.8/wx/dc.h:393)
./src/propgrid/propgrid.cpp:8522: warning: 'BeginDrawing' is deprecated (declared at /usr/include/wx-2.8/wx/dc.h:392)
./src/propgrid/propgrid.cpp:8528: warning: 'EndDrawing' is deprecated (declared at /usr/include/wx-2.8/wx/dc.h:393)
./src/propgrid/propgrid.cpp: In member function 'void wxPropertyGrid::DrawItems(wxPGProperty*, wxPGProperty*)':
./src/propgrid/propgrid.cpp:8570: warning: 'BeginDrawing' is deprecated (declared at /usr/include/wx-2.8/wx/dc.h:392)
./src/propgrid/propgrid.cpp:8575: warning: 'EndDrawing' is deprecated (declared at /usr/include/wx-2.8/wx/dc.h:393)
./src/propgrid/propgrid.cpp: In member function 'void wxPropertyGrid::SelectProperty(wxPGProperty*, bool, bool, bool)':
./src/propgrid/propgrid.cpp:9900: error: invalid static_cast from type 'wxWindow*' to type 'const wxFrame*'
./src/propgrid/propgrid.cpp:9900: error: incomplete type 'wxFrame' used in nested name specifier
./src/propgrid/propgrid.cpp:9902: error: invalid use of undefined type 'struct wxFrame'
/usr/include/wx-2.8/wx/log.h:74: error: forward declaration of 'struct wxFrame'
make[4]: *** [propgrid.lo] Error 1
make[4]: Leaving directory `/builddir/build/BUILD/codeblocks/src/sdk/propgrid'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/builddir/build/BUILD/codeblocks/src/sdk'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/builddir/build/BUILD/codeblocks/src/sdk'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/builddir/build/BUILD/codeblocks/src'
make: *** [all-recursive] Error 1
error: Bad exit status from /var/tmp/rpm-tmp.59823 (%build)
The wxPropertyGrid need this one-liner :-)
--- src/sdk/propgrid/src/propgrid/propgrid.cpp.orig 2006-12-25 17:41:15.000000000 +0100
+++ src/sdk/propgrid/src/propgrid/propgrid.cpp 2006-12-25 17:41:26.000000000 +0100
@@ -50,6 +50,7 @@
#include "wx/filedlg.h"
#include "wx/statusbr.h"
#include "wx/intl.h"
+ #include "wx/frame.h"
#endif
#include <wx/filename.h>
Another problem is in sdk/globals.cpp (it is platform dependent) - CentreOnScreen() doesn't exist for wxWindow, patch is here:
--- src/sdk/globals.cpp.orig 2006-12-25 17:54:36.000000000 +0100
+++ src/sdk/globals.cpp 2006-12-25 17:55:41.000000000 +0100
@@ -759,12 +759,16 @@
if(the_mode == pdlCentre || the_mode == pdlHead)
{
+#if wxCHECK_VERSION(2, 8, 0)
+ w->CentreOnParent();
+#else
if(w->GetParent())
w->CentreOnParent(); // poo!
else
w->CentreOnScreen();
return;
+#endif
}
else
{
And now I am stuck on wxSmith
g++ -DHAVE_CONFIG_H -I. -I../../../../../src/sdk -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread -I../../../../../src/sdk -I../../../../../src/sdk/wxscintilla/include -I../../../../../src/sdk/propgrid/include -O2 -ffast-math -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -DCB_PRECOMP -Winvalid-pch -fPIC -DPIC -MT wxsstdmanager.lo -MD -MP -MF .deps/wxsstdmanager.Tpo -c wxsstdmanager.cpp -fPIC -DPIC -o .libs/wxsstdmanager.o
../properties/wxsstringlistcheckproperty.h: In member function 'void wxsArrayBool::resize(size_t, _wxArraywxsArrayBool)':
../properties/wxsstringlistcheckproperty.h:13: error: no matching function for call to 'wxsArrayBool::resize(size_t&, _wxArraywxsArrayBool&)'
/usr/include/wx-2.8/wx/dynarray.h:809: note: candidates are: void wxBaseArrayPtrVoid::resize(size_t, const void*)
RE: patch1732 to keybinder.
Looking at defs.h for 2.8.0,
WXK_PAGEUP,
WXK_PAGEDOWN,
#if WXWIN_COMPATIBILITY_2_6
WXK_PRIOR = WXK_PAGEUP,
WXK_NEXT = WXK_PAGEDOWN,
#endif
I don't get the purpose of the patch unless the intent is to run without 2.6 compatibilty.
Even if that were true, the patch hacks the problem and causes others (since new code will have to be written to avoid current dependency on wxk_prior/next).
Any explanation?
Number of Warnings is from Windows XP Unicode wxW2.8 CVS Label WX_2_8_MICROFIX_BRANCH;
compiled with minGW GCC 3.4.2 API 3.8
Terms:
Main: the code compiled by project file CodeBlocks.cbp
Contrib: the code compiled by workspace file ContribPlugins.workspace
SDK: the code under folder src/sdk
Main Plugins:the code under src/plugins, but NOT under src/plugins/contrib
Contrib Plugins:the code under src/plugins/contrib
Core: the code under src/src
Number Area
87 Main
22 Contrib
109 Total
Number Section
7 SDK/wxscintilla
13 SDK/wxPropertyGrid
6 SDK/wxFlatNotebook
24 SDK other
8 Core
14 MainPlugins/Compiler
4 MainPlugins/Debugger
3 MainPlugins/Code-completion
2 MainPlugins/Class wizard
4 MainPlugins/Scripted wizard
2 MainPlugins/To-do
3 ContribPlugins/EnvVars Plug-In
5 ContribPlugins/C::B KeyBinder
8 ContribPlugins/Exporter/wxPdfDocument
6 ContribPlugins/wxSmith
Sections NOT worth patching because section is maintained by external group
SDK/wxscintilla
SDK/wxPropertyGrid
SDK/wxFlatNotebook
ContribPlugins/Exporter/wxPdfDocument
Note: I am working on a patch to upgrade wxPropertyGrid to a newer version 1.2.x
Deprecated methods NOT worth patching as long as C::B uses wxWidgets 2.6.x
wxWindow::SetBestFittingSize
wxWindow::GetBestFittingSize
wxPathList::Member
wxRect::Inside
::wxGetAccelFromString
Note: I plan to patch the MainPlugin/Compiler use of deprecated methods wxStartTimer & wxGetElapsedTime in a separate patch.
Totals after warning reduction patches and module upgrade patches applied
[Totals being ran at current time, will update totals after run is done.]
Number Area
29 Main
22 Contrib
51 Total
Number Section
7 SDK/wxscintilla
0 SDK/wxPropertyGrid
6 SDK/wxFlatNotebook
1 SDK other
4 Core
7 MainPlugins/Compiler
3 MainPlugins/Debugger
1 MainPlugins/Code-completion
0 MainPlugins/Class wizard
0 MainPlugins/Scripted wizard
0 MainPlugins/To-do
3 ContribPlugins/EnvVars Plug-In
5 ContribPlugins/C::B KeyBinder
8 ContribPlugins/Exporter/wxPdfDocument
6 ContribPlugins/wxSmith
Tim S
g++ -DHAVE_CONFIG_H -I. -I../../../../../src/sdk -I/usr/lib/wx/include/gtk2-unicode-release-2.8
-I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__
-pthread -I../../../../../src/sdk -I../../../../../src/sdk/wxscintilla/include -I../../../../../src/sdk/propgrid/include -O2
-ffast-math -g -O2 -DCB_PRECOMP -Winvalid-pch -fPIC -DPIC -MT wxsarraystringeditordlg.lo
-MD -MP -MF .deps/wxsarraystringeditordlg.Tpo -c
./wxsarraystringeditordlg.cpp -fPIC -DPIC -o .libs/wxsarraystringeditordlg.o
./wxsarraystringeditordlg.h:31: error: extra qualification 'wxsArrayStringEditorDlg::' on member 'OnCancel'
That's the problem =/.. almost working.. =D
However, it's already working with wx2.8 :D, just need to compile the last plugins when this problem get solved.
EDIT: Strange.. I recompiled everything and I didn't get this error anymore o.O
nottin:
Did you apply the patch #1766
[ Patch #1766 ] NEW (experimental) wxSmith patch for wxWidgets 2.8 Submitted By: stahta01
https://developer.berlios.de/patch/?func=detailpatch&patch_id=1766&group_id=5358
How to get the new wxSmith is here
http://forums.codeblocks.org/index.php?topic=3765.msg33855#msg33855
Tim S
Edit: From the errors you got I suggest trying this patch; I have updated my patch with the code show below.
Index: wxwidgets/defitems/wxsnotebook.cpp
===================================================================
--- wxwidgets/defitems/wxsnotebook.cpp (revision 3483)
+++ wxwidgets/defitems/wxsnotebook.cpp (working copy)
@@ -21,6 +21,10 @@
* $HeadURL$
*/
+#ifndef CB_PRECOMP
+ #include <wx/notebook.h>
+#endif
+
#include "wxsnotebook.h"
#include "../../wxsadvqppchild.h"
Index: wxwidgets/wxsevents.h
===================================================================
--- wxwidgets/wxsevents.h (revision 3483)
+++ wxwidgets/wxsevents.h (working copy)
@@ -1,6 +1,10 @@
#ifndef WXSEVENTS_H
#define WXSEVENTS_H
+#ifndef WX_PRECOMP
+ #include <wx/arrstr.h>
+#endif
+
#include <tinyxml/tinyxml.h>
#include "../wxscodinglang.h"
Index: wxwidgets/wxsstyle.h
===================================================================
--- wxwidgets/wxsstyle.h (revision 3483)
+++ wxwidgets/wxsstyle.h (working copy)
@@ -1,6 +1,10 @@
#ifndef __WXSSTYLE_H
#define __WXSSTYLE_H
+#ifndef WX_PRECOMP
+ #include <wx/arrstr.h>
+#endif
+
#include "../wxscodinglang.h"
#include <wx/dynarray.h>
I am working on a patch for C::B to fix the following issues for disable compat26 under wxWidgets 2.8.
From wx/toplevel.h (wxWidgets 2.6.1)
// deprecated versions defined for compatibility reasons
#define wxRESIZE_BOX wxMAXIMIZE_BOX
#define wxTHICK_FRAME wxRESIZE_BORDER
// obsolete styles, unused any more
#define wxDIALOG_MODAL 0
#define wxDIALOG_MODELESS 0
#define wxNO_3D 0
#define wxUSER_COLOURS 0
From wx/toplevel.h (wxWidgets cvs head)
#if WXWIN_COMPATIBILITY_2_6
// deprecated versions defined for compatibility reasons
#define wxRESIZE_BOX wxMAXIMIZE_BOX
#define wxTHICK_FRAME wxRESIZE_BORDER
// obsolete styles, unused any more
#define wxDIALOG_MODAL 0
#define wxDIALOG_MODELESS 0
#define wxNO_3D 0
#define wxUSER_COLOURS 0
#endif // WXWIN_COMPATIBILITY_2_6