Author Topic: Building with wxWidgets 2.9  (Read 36562 times)

Offline Cryogen

  • Regular
  • ***
  • Posts: 260
Building with wxWidgets 2.9
« on: September 28, 2010, 01:41:27 am »

 Has anyone managed to do this, lately? I've read everything I can find here and elsewhere but can't get it to work.

Firstly, wx2.9.1 release refused to build with both mingw and TDM. I eventually managed to get the latest SVN (2.9.2) to build with TDM but nothing I've tried will get C::B to build.

I've tried every combination of wxUSE_PROPGRID and wxUSE_STC, with and without the removal of the propgrid and scintilla requirements from the build file. I saw some propgrid errors but they seemed to stop when using wxUSE_PROPGRID=1 and removing propgrid from the build settings but I can't get past a bunch of scintilla errors whatever I try. I've rebuilt wx so many times I've lost count. If anyone has managed it I'd love to know how you did it.

Cheers,

  Cryo.


Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Building with wxWidgets 2.9
« Reply #1 on: September 28, 2010, 03:31:05 am »
I am trying to do it; but, it will take about 24 hours to finish since I have other things to do.
It worked with 2.9.0; I do not remember if it worked with 2.9.1.

I used wxWidgets version of PropertyGrid and Code::Blocks version of STC the last time it worked for me.

But, Code::Blocks STC has changed since then. And, wxWidgets has had major changes.

Will post my results, when I succeed or fail.

For my first try
 Using wxWidgets trunk SVN 65660.
 And, the TDM's GCC Compiler shipped with Code::Blocks 10.05
 Under MS Windows 6.1 AKA 7 32bit (64bit was broken in C::B the last time I tried.)

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Building with wxWidgets 2.9
« Reply #2 on: September 28, 2010, 06:05:22 am »
On the Building of Code::Blocks against wxWidgets are you having:
Compiler errors?
Linking errors?
or Run-time errors?

It compiled and linked OK for me then I get run-time errors.

patch for CodeBlocks.cbp; that I am using on second re-build of Code::Blocks trunk; it has not finished yet. I will check on it in morning. CB Loaded OK

Code
Index: src/CodeBlocks.cbp
===================================================================
--- src/CodeBlocks.cbp    (revision 6647)
+++ src/CodeBlocks.cbp    (working copy)
@@ -128,27 +128,6 @@
                     <Add library="gdi32" />
                 </Linker>
             </Target>
-            <Target title="wxpropgrid">
-                <Option output="devel\wxpropgrid" prefix_auto="1" extension_auto="1" />
-                <Option working_dir="devel" />
-                <Option type="3" />
-                <Option compiler="gcc" />
-                <Option createStaticLib="1" />
-                <Compiler>
-                    <Add option="-DWXMAKINGDLL_PROPGRID" />
-                    <Add option="-DwxPG_USE_WXMODULE=0" />
-                    <Add directory="sdk\wxpropgrid\include" />
-                    <Add directory="include" />
-                </Compiler>
-                <ResourceCompiler>
-                    <Add directory="sdk\wxpropgrid\include" />
-                </ResourceCompiler>
-                <Linker>
-                    <Add option="-Wl,--enable-auto-image-base" />
-                    <Add option="-Wl,--add-stdcall-alias" />
-                    <Add option="-Wl,--enable-auto-import" />
-                </Linker>
-            </Target>
             <Target title="sdk">
                 <Option output="devel\codeblocks" prefix_auto="1" extension_auto="1" />
                 <Option working_dir="devel" />
@@ -169,7 +148,6 @@
                     <Add directory="include\scripting\include" />
                     <Add directory="include\scripting\sqplus" />
                     <Add directory="include\mozilla_chardet" />
-                    <Add directory="sdk\wxpropgrid\include" />
                 </Compiler>
                 <Linker>
                     <Add option="-Wl,--enable-auto-image-base" />
@@ -179,13 +157,11 @@
                     <Add library="shfolder" />
                     <Add library="txml" />
                     <Add library="wxscintilla" />
-                    <Add library="wxpropgrid" />
                     <Add library="sqplus" />
                     <Add library="sqstdlib" />
                     <Add library="squirrel" />
                     <Add directory="devel" />
                     <Add directory="sdk\scripting\lib" />
-                    <Add directory="sdk\propgrid" />
                 </Linker>
                 <ExtraCommands>
                     <Add before="build_tools/autorevision/autorevision +wx +int +t . include/autorevision.h" />
@@ -212,7 +188,6 @@
                     <Add option="-Wl,--enable-auto-import" />
                     <Add library="codeblocks" />
                     <Add library="wxscintilla" />
-                    <Add library="wxpropgrid" />
                     <Add library="shfolder" />
                     <Add library="kernel32" />
                     <Add library="user32" />
@@ -532,14 +507,14 @@
             </Target>
             <Environment>
                 <Variable name="WX_SUFFIX" value="u" />
-                <Variable name="WX_VERSION" value="28" />
+                <Variable name="WX_VERSION" value="29" />
                 <Variable name="WX_CFG" value="" />
             </Environment>
         </Build>
         <VirtualTargets>
-            <Add alias="All" targets="tinyXML;AutoRevision;ConsoleRunner;Squirrel;Squirrel std lib;SqPlus;scintilla;wxpropgrid;sdk;src;AStyle;Compiler depslib;Compiler;Debugger;Code-completion;Class wizard;Default MIME handler;Open files list;Scripted wizard;To-do;Autosave;XP look &amp; feel;Projects-workspaces importer;" />
+            <Add alias="All" targets="tinyXML;AutoRevision;ConsoleRunner;Squirrel;Squirrel std lib;SqPlus;scintilla;sdk;src;AStyle;Compiler depslib;Compiler;Debugger;Code-completion;Class wizard;Default MIME handler;Open files list;Scripted wizard;To-do;Autosave;XP look &amp; feel;Projects-workspaces importer;" />
             <Add alias="Core app &amp; plugins" targets="sdk;src;AStyle;Autosave;Compiler depslib;Compiler;Debugger;Code-completion;Class wizard;Default MIME handler;Projects-workspaces importer;Scripted wizard;Open files list;To-do;XP look &amp; feel;" />
-            <Add alias="Third-party libs" targets="tinyXML;AutoRevision;ConsoleRunner;Squirrel;Squirrel std lib;SqPlus;scintilla;wxpropgrid;Compiler depslib;" />
+            <Add alias="Third-party libs" targets="tinyXML;AutoRevision;ConsoleRunner;Squirrel;Squirrel std lib;SqPlus;scintilla;Compiler depslib;" />
         </VirtualTargets>
         <Compiler>
             <Add option="-Wall" />
@@ -560,7 +535,6 @@
             <Add directory="$(#wx)\contrib\include" />
             <Add directory="$(#WX.lib)\gcc_dll$(WX_CFG)\msw$(WX_SUFFIX)" />
             <Add directory="sdk\wxscintilla\include" />
-            <Add directory="sdk\wxpropgrid\include" />
             <Add directory="include\tinyxml" />
         </Compiler>
         <ResourceCompiler>
@@ -2715,57 +2689,6 @@
         <Unit filename="sdk\workspaceloader.cpp">
             <Option target="sdk" />
         </Unit>
-        <Unit filename="sdk\wxpropgrid\include\wx\propgrid\advprops.h">
-            <Option target="wxpropgrid" />
-        </Unit>
-        <Unit filename="sdk\wxpropgrid\include\wx\propgrid\editors.h">
-            <Option target="wxpropgrid" />
-        </Unit>
-        <Unit filename="sdk\wxpropgrid\include\wx\propgrid\extras.h">
-            <Option target="wxpropgrid" />
-        </Unit>
-        <Unit filename="sdk\wxpropgrid\include\wx\propgrid\manager.h">
-            <Option target="wxpropgrid" />
-        </Unit>
-        <Unit filename="sdk\wxpropgrid\include\wx\propgrid\odcombo.h">
-            <Option target="wxpropgrid" />
-        </Unit>
-        <Unit filename="sdk\wxpropgrid\include\wx\propgrid\propdev.h">
-            <Option target="wxpropgrid" />
-        </Unit>
-        <Unit filename="sdk\wxpropgrid\include\wx\propgrid\propgrid.h">
-            <Option target="wxpropgrid" />
-        </Unit>
-        <Unit filename="sdk\wxpropgrid\include\wx\propgrid\props.h">
-            <Option target="wxpropgrid" />
-        </Unit>
-        <Unit filename="sdk\wxpropgrid\include\wx\propgrid\xh_propgrid.h">
-            <Option target="wxpropgrid" />
-        </Unit>
-        <Unit filename="sdk\wxpropgrid\src\advprops.cpp">
-            <Option target="wxpropgrid" />
-        </Unit>
-        <Unit filename="sdk\wxpropgrid\src\editors.cpp">
-            <Option target="wxpropgrid" />
-        </Unit>
-        <Unit filename="sdk\wxpropgrid\src\extras.cpp">
-            <Option target="wxpropgrid" />
-        </Unit>
-        <Unit filename="sdk\wxpropgrid\src\manager.cpp">
-            <Option target="wxpropgrid" />
-        </Unit>
-        <Unit filename="sdk\wxpropgrid\src\odcombo.cpp">
-            <Option target="wxpropgrid" />
-        </Unit>
-        <Unit filename="sdk\wxpropgrid\src\propgrid.cpp">
-            <Option target="wxpropgrid" />
-        </Unit>
-        <Unit filename="sdk\wxpropgrid\src\props.cpp">
-            <Option target="wxpropgrid" />
-        </Unit>
-        <Unit filename="sdk\wxpropgrid\src\xh_propgrid.cpp">
-            <Option target="wxpropgrid" />
-        </Unit>
         <Unit filename="sdk\wxscintilla\include\wx\wxscintilla.h">
             <Option target="scintilla" />
         </Unit>

Tim S.
« Last Edit: September 28, 2010, 06:36:12 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Building with wxWidgets 2.9
« Reply #3 on: September 28, 2010, 07:28:17 am »
Using wxWidgets propgrid should work (after some changes), but you have to use "our" scintilla, because there are some C::B specific patches we use.
Nevertheless there are other errors with wx2.9 that have not been fixed until now.
There is a thread about C::B and wx2.9, but you have to search for it.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Building with wxWidgets 2.9
« Reply #4 on: September 28, 2010, 03:54:14 pm »
I used the new Build of Code::Blocks linked against wxWidgets trunk to build Code::Blocks. It still has an issue on shutdown.

Did not try the contrib plugins; took me several hours and still two or three contrib plugins failed last time I tried 3 or so months ago.

Note: I was the person who started the first two threads on building C::B with wxWidgets 2.9.x.

Note: I have never gotten C::B to build and run using 64Bit TDM/other MinGW GCC under Windows.

In setup.h make sure "wxUSE_STC" is defined as "0". Note, use "USE_OPENGL=1" is not required.
Code
mingw32-make -f makefile.gcc USE_QA=1 USE_STC=0 USE_OPENGL=1 BUILD=release UNICODE=1 MONOLITHIC=1 SHARED=1

Tim S.
« Last Edit: September 28, 2010, 07:10:13 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Cryogen

  • Regular
  • ***
  • Posts: 260
Re: Building with wxWidgets 2.9
« Reply #5 on: September 29, 2010, 03:49:25 am »

 Hi Guys,

Thanks for the assistance. Yes I read all of the threads. I was getting compiler errors, as I remember. Thanks for the patch. I'll probably have to wait for the weekend to try again but I will give it a go.

Cheers.

Offline Cryogen

  • Regular
  • ***
  • Posts: 260
Re: Building with wxWidgets 2.9
« Reply #6 on: October 16, 2010, 10:51:45 pm »

 I finally got around to trying this. I can now build the latest wx 2.9.2 SVN but CB refuses to co-operate. I get errors relating to scintilla. I applied the patch to a fress project file, although i had dome much the same myself. No go.

Code
||=== Code::Blocks, sdk ===|
C:\Utilities\Programming\CBfor2.9\src\sdk\encodingdetector.cpp||In member function 'bool EncodingDetector::ConvertToWxStr(const wxByte*, size_t)':|
C:\Utilities\Programming\CBfor2.9\src\sdk\encodingdetector.cpp|138|warning: value computed is not used|
.objs\sdk\cbeditor.o:C:\Utilities\Programming\CBfor2.9\src\sdk\cbeditor.cpp|811|undefined reference to `_imp___ZN11wxScintilla7SetZoomEi'|
.objs\sdk\cbeditor.o:C:\Utilities\Programming\CBfor2.9\src\sdk\cbeditor.cpp|816|undefined reference to `_imp___ZN11wxScintilla13SetMarginMaskEii'|
.objs\sdk\cbeditor.o:C:\Utilities\Programming\CBfor2.9\src\sdk\cbeditor.cpp|817|undefined reference to `_imp___ZN11wxScintilla13SetMarginMaskEii'|
.objs\sdk\cbeditor.o:C:\Utilities\Programming\CBfor2.9\src\sdk\cbeditor.cpp|818|undefined reference to `_imp___ZN11wxScintilla13SetMarginMaskEii'|
.objs\sdk\cbeditor.o:C:\Utilities\Programming\CBfor2.9\src\sdk\cbeditor.cpp|819|undefined reference to `_imp___ZN11wxScintilla13SetMarginMaskEii'|
.objs\sdk\cbeditor.o:C:\Utilities\Programming\CBfor2.9\src\sdk\cbeditor.cpp|879|undefined reference to `_imp___ZNK11wxScintilla9GetModifyEv'|
.objs\sdk\cbeditor.o:C:\Utilities\Programming\CBfor2.9\src\sdk\cbeditor.cpp|889|undefined reference to `_imp___ZN11wxScintilla12SetSavePointEv'|
.objs\sdk\cbeditor.o:C:\Utilities\Programming\CBfor2.9\src\sdk\cbeditor.cpp|895|undefined reference to `_imp___ZNK11wxScintilla11GetReadOnlyEv'|
.objs\sdk\cbeditor.o:C:\Utilities\Programming\CBfor2.9\src\sdk\cbeditor.cpp|926|undefined reference to `_imp___ZN11wxScintilla7GotoPosEi'|
.objs\sdk\cbeditor.o:C:\Utilities\Programming\CBfor2.9\src\sdk\cbeditor.cpp|927|undefined reference to `_imp___ZN11wxScintilla12ScrollToLineEi'|
.objs\sdk\cbeditor.o:C:\Utilities\Programming\CBfor2.9\src\sdk\cbeditor.cpp|928|undefined reference to `_imp___ZN11wxScintilla14ScrollToColumnEi'|
.objs\sdk\cbeditor.o:C:\Utilities\Programming\CBfor2.9\src\sdk\cbeditor.cpp|961|undefined reference to `_imp___ZNK11wxScintilla13GetCurrentPosEv'|
.objs\sdk\cbeditor.o:C:\Utilities\Programming\CBfor2.9\src\sdk\cbeditor.cpp|962|undefined reference to `_imp___ZNK11wxScintilla19GetFirstVisibleLineEv'|
.objs\sdk\cbeditor.o:C:\Utilities\Programming\CBfor2.9\src\sdk\cbeditor.cpp|969|undefined reference to `_imp___ZN11wxScintilla12MarkerDefineEiiRK8wxColourS2_'|
.objs\sdk\cbeditor.o:C:\Utilities\Programming\CBfor2.9\src\sdk\cbeditor.cpp|970|undefined reference to `_imp___ZN11wxScintilla19MarkerSetForegroundEiRK8wxColour'|
.objs\sdk\cbeditor.o:C:\Utilities\Programming\CBfor2.9\src\sdk\cbeditor.cpp|971|undefined reference to `_imp___ZN11wxScintilla19MarkerSetBackgroundEiRK8wxColour'|
.objs\sdk\cbeditor.o:C:\Utilities\Programming\CBfor2.9\src\sdk\cbeditor.cpp|975|undefined reference to `_imp___ZN11wxScintilla12MarkerDefineEiiRK8wxColourS2_'|
.objs\sdk\cbeditor.o:C:\Utilities\Programming\CBfor2.9\src\sdk\cbeditor.cpp|976|undefined reference to `_imp___ZN11wxScintilla19MarkerSetForegroundEiRK8wxColour'|
.objs\sdk\cbeditor.o:C:\Utilities\Programming\CBfor2.9\src\sdk\cbeditor.cpp|977|undefined reference to `_imp___ZN11wxScintilla19MarkerSetBackgroundEiRK8wxColour'|
.objs\sdk\cbeditor.o:C:\Utilities\Programming\CBfor2.9\src\sdk\cbeditor.cpp|983|undefined reference to `_imp___ZN11wxScintilla12SetFoldFlagsEi'|
.objs\sdk\cbeditor.o:C:\Utilities\Programming\CBfor2.9\src\sdk\cbeditor.cpp|985|undefined reference to `_imp___ZN11wxScintilla12SetFoldFlagsEi'|
.objs\sdk\cbeditor.o:C:\Utilities\Programming\CBfor2.9\src\sdk\cbeditor.cpp|998|undefined reference to `_imp___ZN11wxScintilla8UsePopUpEb'|
.objs\sdk\cbeditor.o:C:\Utilities\Programming\CBfor2.9\src\sdk\cbeditor.cpp|1006|undefined reference to `_imp__wxEVT_SCI_MARGINCLICK'|
.objs\sdk\cbeditor.o:C:\Utilities\Programming\CBfor2.9\src\sdk\cbeditor.cpp|1009|undefined reference to `_imp__wxEVT_SCI_UPDATEUI'|
.objs\sdk\cbeditor.o:C:\Utilities\Programming\CBfor2.9\src\sdk\cbeditor.cpp|1012|undefined reference to `_imp__wxEVT_SCI_CHANGE'|
.objs\sdk\cbeditor.o:C:\Utilities\Programming\CBfor2.9\src\sdk\cbeditor.cpp|1015|undefined reference to `_imp__wxEVT_SCI_CHARADDED'|
.objs\sdk\cbeditor.o:C:\Utilities\Programming\CBfor2.9\src\sdk\cbeditor.cpp|1018|undefined reference to `_imp__wxEVT_SCI_DWELLSTART'|
.objs\sdk\cbeditor.o:C:\Utilities\Programming\CBfor2.9\src\sdk\cbeditor.cpp|1021|undefined reference to `_imp__wxEVT_SCI_DWELLEND'|
.objs\sdk\cbeditor.o:C:\Utilities\Programming\CBfor2.9\src\sdk\cbeditor.cpp|1024|undefined reference to `_imp__wxEVT_SCI_USERLISTSELECTION'|
.objs\sdk\cbeditor.o:C:\Utilities\Programming\CBfor2.9\src\sdk\cbeditor.cpp|1027|undefined reference to `_imp__wxEVT_SCI_MODIFIED'|
.objs\sdk\cbeditor.o:C:\Utilities\Programming\CBfor2.9\src\sdk\cbeditor.cpp|1068|undefined reference to `_imp__wxEVT_SCI_STYLENEEDED'|
.objs\sdk\cbeditor.o:C:\Utilities\Programming\CBfor2.9\src\sdk\cbeditor.cpp|1068|undefined reference to `_imp__wxEVT_SCI_SAVEPOINTREACHED'|
.objs\sdk\cbeditor.o:C:\Utilities\Programming\CBfor2.9\src\sdk\cbeditor.cpp|1068|undefined reference to `_imp__wxEVT_SCI_SAVEPOINTLEFT'|
.objs\sdk\cbeditor.o:C:\Utilities\Programming\CBfor2.9\src\sdk\cbeditor.cpp|1068|undefined reference to `_imp__wxEVT_SCI_ROMODIFYATTEMPT'|
.objs\sdk\cbeditor.o:C:\Utilities\Programming\CBfor2.9\src\sdk\cbeditor.cpp|1068|undefined reference to `_imp__wxEVT_SCI_KEY'|
.objs\sdk\cbeditor.o:C:\Utilities\Programming\CBfor2.9\src\sdk\cbeditor.cpp|1068|undefined reference to `_imp__wxEVT_SCI_DOUBLECLICK'|
.objs\sdk\cbeditor.o:C:\Utilities\Programming\CBfor2.9\src\sdk\cbeditor.cpp|1068|undefined reference to `_imp__wxEVT_SCI_MACRORECORD'|
.objs\sdk\cbeditor.o:C:\Utilities\Programming\CBfor2.9\src\sdk\cbeditor.cpp|1068|undefined reference to `_imp__wxEVT_SCI_NEEDSHOWN'|
.objs\sdk\cbeditor.o:C:\Utilities\Programming\CBfor2.9\src\sdk\cbeditor.cpp|1068|undefined reference to `_imp__wxEVT_SCI_PAINTED'|
.objs\sdk\cbeditor.o:C:\Utilities\Programming\CBfor2.9\src\sdk\cbeditor.cpp|1068|undefined reference to `_imp__wxEVT_SCI_URIDROPPED'|
.objs\sdk\cbeditor.o:C:\Utilities\Programming\CBfor2.9\src\sdk\cbeditor.cpp|1068|undefined reference to `_imp__wxEVT_SCI_START_DRAG'|
.objs\sdk\cbeditor.o:C:\Utilities\Programming\CBfor2.9\src\sdk\cbeditor.cpp|1068|undefined reference to `_imp__wxEVT_SCI_DRAG_OVER'|
.objs\sdk\cbeditor.o:C:\Utilities\Programming\CBfor2.9\src\sdk\cbeditor.cpp|1068|undefined reference to `_imp__wxEVT_SCI_DO_DROP'|
.objs\sdk\cbeditor.o:C:\Utilities\Programming\CBfor2.9\src\sdk\cbeditor.cpp|1068|undefined reference to `_imp__wxEVT_SCI_ZOOM'|
.objs\sdk\cbeditor.o:C:\Utilities\Programming\CBfor2.9\src\sdk\cbeditor.cpp|1068|undefined reference to `_imp__wxEVT_SCI_HOTSPOT_CLICK'|
.objs\sdk\cbeditor.o:C:\Utilities\Programming\CBfor2.9\src\sdk\cbeditor.cpp|1068|undefined reference to `_imp__wxEVT_SCI_HOTSPOT_DCLICK'|
.objs\sdk\cbeditor.o:C:\Utilities\Programming\CBfor2.9\src\sdk\cbeditor.cpp|1068|undefined reference to `_imp__wxEVT_SCI_CALLTIP_CLICK'|
.objs\sdk\cbeditor.o:C:\Utilities\Programming\CBfor2.9\src\sdk\cbeditor.cpp|1068|undefined reference to `_imp__wxEVT_SCI_AUTOCOMP_SELECTION'|
.objs\sdk\cbeditor.o:C:\Utilities\Programming\CBfor2.9\src\sdk\cbeditor.cpp|1122|undefined reference to `_imp___ZN11wxScintilla13GetDocPointerEv'|
.objs\sdk\cbeditor.o:C:\Utilities\Programming\CBfor2.9\src\sdk\cbeditor.cpp|1122|undefined reference to `_imp___ZN11wxScintilla13SetDocPointerEPv'|
||More errors follow but not being shown.|
||Edit the max errors limit in compiler options...|
||=== Build finished: 50 errors, 8 warnings (4 minutes, 12 seconds) ===|


I tried adding it in several places. No change. It shouldn't be necessary to change that, anyway. I can't see why that would be any different.

Any ideas?


Offline Loaden

  • Lives here!
  • ****
  • Posts: 1014
Re: Building with wxWidgets 2.9
« Reply #7 on: October 17, 2010, 05:46:49 am »
I think we need create a new project named "CodeBlocks-29.cbp".
Any comments?

Offline Loaden

  • Lives here!
  • ****
  • Posts: 1014
Re: Building with wxWidgets 2.9
« Reply #8 on: October 17, 2010, 09:15:20 am »
In setup.h make sure "wxUSE_STC" is defined as "0". Note, use "USE_OPENGL=1" is not required.
Code
mingw32-make -f makefile.gcc USE_QA=1 USE_STC=0 USE_OPENGL=1 BUILD=release UNICODE=1 MONOLITHIC=1 SHARED=1
When start build wxWidgets, you need change "include\wx\msw\setup0.h".
Code
// Use wxStyledTextCtrl, a wxWidgets implementation of Scintilla.
//
// Default is 1
//
// Recommended setting: 1
#define wxUSE_STC 1

The default value is 1, so we need set the value to 0.

Offline Loaden

  • Lives here!
  • ****
  • Posts: 1014
Re: Building with wxWidgets 2.9
« Reply #9 on: October 17, 2010, 11:05:40 am »
Works well for me. :lol:

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Building with wxWidgets 2.9
« Reply #10 on: October 17, 2010, 09:20:18 pm »
The default value is 1, so we need to set the value to 0.
No you don't, if should be possible to build C::B with STC enabled because cb is using the default build on all linux distros and if there STC is enabled C::B will be unbuildable!
(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 Cryogen

  • Regular
  • ***
  • Posts: 260
Re: Building with wxWidgets 2.9
« Reply #11 on: October 17, 2010, 10:34:25 pm »

 Hi Guys,

Yeeees. I'm building on Windows, for the record, but I will be wanting to get it going on Linux once it's working.  My understanding is that wxUSE_STC on the command line overrides what's in setup.h. Either way it's set to 0 in both places. Besides, I've tried building with every combination of wxUSE_STC and wxUSE_PROPGRID and nothing works. I've tried my existing code base, and a new SVN copy. I've tried tweaking the project setting all over the place. It does seem related to STC, to me AND there were plenty of build references to wxscintilla when building wx, which I thought strange, since it's set to 0 everywhere AND it generated libwxscintalla.a. I fail to see why it would do that unless it's a dependency of something else and, even then, it shouldn't.

Yes, Loaden, I definitely think we should have a separate project in the system for this. 2.9 has been out for ages in one form or another and more and more folks will want to use it. Once we sort this out I'll send you the result. What exactly worked well for you? Can you summarise your approach for me, please?

Thanks everyone.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Building with wxWidgets 2.9
« Reply #12 on: October 18, 2010, 12:29:50 am »
2.9 has been out for ages in one form or another and more and more folks will want to use it. Once we sort this out I'll send you the result. What exactly worked well for you?
I don't see any problem for wx2.9 users? Why would they care what C::B is using?
C::B can't be ported to 2.9-only, because none of the distros provide packages for 2.9 (except gentoo:) ).
(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 stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Building with wxWidgets 2.9
« Reply #13 on: October 18, 2010, 01:27:49 am »

My understanding is that wxUSE_STC on the command line overrides what's in setup.h.

You understanding IS NOT correct.

You NEED to fix your build of wxWidgets, so it does NOT build wxscintilla/STC!!!!

I suggest reading; how to build with OpenGL it works just about the same to build without STC.
http://wiki.codeblocks.org/index.php?title=Compiling_wxWidgets_2.8.9_Monolithic_Build_with_openGL_for_Windows

I think that adding an wxWidgets 2.9 project is not really a good thing to do at this time; it would just result in more people who do not know how to build wxWidgets right posting questions on why it does not work. Unless someone is willing to write some detailed directions on how to build wxWidgets right for Code::Blocks. I have given what I think are good directions for  wxWidgets building experts; but they are not good enough for non experts.  

Anyone feel free to update my old 2.9.0 directions
http://wiki.codeblocks.org/index.php?title=Compiling_wxWidgets_2.9.0_to_develop_Code::Blocks_%28MSW%29

Tim S.
« Last Edit: October 18, 2010, 01:41:11 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Loaden

  • Lives here!
  • ****
  • Posts: 1014
Re: Building with wxWidgets 2.9
« Reply #14 on: October 18, 2010, 03:33:04 am »

Offline Cryogen

  • Regular
  • ***
  • Posts: 260
Re: Building with wxWidgets 2.9
« Reply #15 on: October 18, 2010, 03:39:22 am »
2.9 has been out for ages in one form or another and more and more folks will want to use it. Once we sort this out I'll send you the result. What exactly worked well for you?
I don't see any problem for wx2.9 users? Why would they care what C::B is using?
C::B can't be ported to 2.9-only, because none of the distros provide packages for 2.9 (except gentoo:) ).


...because they're going to want to use 2.9 for the new features and not want to have to build 2 versions. Your point is probably quite valid if they're using a pre-built version of CB, though. ;-)


Offline Loaden

  • Lives here!
  • ****
  • Posts: 1014
Re: Building with wxWidgets 2.9
« Reply #16 on: October 18, 2010, 03:47:02 am »
but you have to use "our" scintilla, because there are some C::B specific patches we use.
Maybe we can move the specific patches from wxScintilla to cbEditor or cbStyledTextCtrl?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Building with wxWidgets 2.9
« Reply #17 on: October 18, 2010, 05:01:10 am »
Too All:

There is three setup.h files directly involved.
<WXWIN>\include\wx\msw\setup0.h
<WXWIN>\include\wx\msw\setup.h
<WXWIN>\lib\gcc_dll\mswu\wx\setup.h

You should verify the last two have wxUSE_STC set correctly in both or at least correctly in the last one.
The last one use used by Code::Blocks and would cause an compile or link error if it is wrong. The next to the last might cause an link or run error.
I almost never edit setup0.h; unless I have an wxWidgets patch I need to test. Or the wxWidgets team appears to have made an error.

Note: I am always using wxWidgets trunk for my test builds unless I stated otherwise in the post.

Tim S.
« Last Edit: October 18, 2010, 05:15:04 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Loaden

  • Lives here!
  • ****
  • Posts: 1014
Re: Building with wxWidgets 2.9
« Reply #18 on: October 18, 2010, 05:34:41 am »
There is a possible way: using MONOLITHIC = 0
I am trying, and feedback the result.

Quote
make -f makefile.gcc LDFLAGS=-s SHARED=1 BUILD=release UNICODE=1 MONOLITHIC=0 OFFICIAL_BUILD=1 RUNTIME_LIBS=static >nul

In wx2.9.2svn, the MONOLITHIC default to 0
Code
# Multiple libraries or single huge monolithic one? [0,1]
MONOLITHIC ?= 0

Offline Cryogen

  • Regular
  • ***
  • Posts: 260
Re: Building with wxWidgets 2.9
« Reply #19 on: October 18, 2010, 05:36:21 am »

My understanding is that wxUSE_STC on the command line overrides what's in setup.h.

You understanding IS NOT correct.

You NEED to fix your build of wxWidgets, so it does NOT build wxscintilla/STC!!!!

You may be right but, as explained, it's turned off everywhere. wxscintilla is always built. Looking at the makefile, which I don't claim to understand, it appears to be linked into the monolithic build all over the place, so maybe it's intended to be that way. What I don't understand is why it won't work for me if it works for you guys. I'm using the standard configuration and your project file. I'm now thinking that CB might be finding the libwxscintilla built with wx and not finding the mods as a result. Does scintilla build for you guys with wxUSE_STC turned off? If not, how the hell do I prevent it? All switches are off. The build is cleaned before buidling. I've gone through and manually deleted all files, including the copied setup.h. I even tried deleting the entire build and lib directories and checking them out again but nothing will prevent scintilla from building.


Offline Cryogen

  • Regular
  • ***
  • Posts: 260
Re: Building with wxWidgets 2.9
« Reply #20 on: October 18, 2010, 05:38:48 am »
Too All:

There is three setup.h files directly involved.
<WXWIN>\include\wx\msw\setup0.h
<WXWIN>\include\wx\msw\setup.h
<WXWIN>\lib\gcc_dll\mswu\wx\setup.h

You should verify the last two have wxUSE_STC set correctly in both or at least correctly in the last one.

Yes and yes. Verified for the umpteenth time today, just to be sure.

Offline Loaden

  • Lives here!
  • ****
  • Posts: 1014
Re: Building with wxWidgets 2.9
« Reply #21 on: October 18, 2010, 05:40:45 am »
but you have to use "our" scintilla, because there are some C::B specific patches we use.
Maybe we can move the specific patches from wxScintilla to cbEditor or cbStyledTextCtrl?
I am trying, but I found it is impossible.
Code
/*
 * This file is part of the Code::Blocks IDE and licensed under the GNU Lesser General Public License, version 3
 * http://www.gnu.org/licenses/lgpl-3.0.html
 */

#ifndef CBSCINTILLA_H
#define CBSCINTILLA_H

#if wxCHECK_VERSION(2, 9, 2)

#include <wx/stc/stc.h>

#define cbSCI_KEYWORDSET_MAX                wxSTC_KEYWORDSET_MAX
#define cbSCI_EOL_LF                        wxSTC_EOL_LF
#define cbSCI_EOL_CR                        wxSTC_EOL_CR

#define cbSCI_C_COMMENT                     wxSTC_C_COMMENT
#define cbSCI_C_COMMENTDOC                  wxSTC_C_COMMENTDOC
#define cbSCI_C_COMMENTDOCKEYWORD           wxSTC_C_COMMENTDOCKEYWORD
#define cbSCI_C_COMMENTDOCKEYWORDERROR      wxSTC_C_COMMENTDOCKEYWORDERROR
#define cbSCI_C_COMMENTLINE                 wxSTC_C_COMMENTLINE
#define cbSCI_C_COMMENTLINEDOC              wxSTC_C_COMMENTLINEDOC

#define cbSCI_D_COMMENT                     wxSTC_D_COMMENT
#define cbSCI_D_COMMENTDOC                  wxSTC_D_COMMENTDOC
#define cbSCI_D_COMMENTDOCKEYWORD           wxSTC_D_COMMENTDOCKEYWORD
#define cbSCI_D_COMMENTDOCKEYWORDERROR      wxSTC_D_COMMENTDOCKEYWORDERROR
#define cbSCI_D_COMMENTLINE                 wxSTC_D_COMMENTLINE
#define cbSCI_D_COMMENTLINEDOC              wxSTC_D_COMMENTLINEDOC

#define cbSCI_LEX_CPP                       wxSTC_LEX_CPP
#define cbSCI_LEX_D                         wxSTC_LEX_D

#define cbSCI_C_PREPROCESSOR                wxSTC_C_PREPROCESSOR
#define cbSCI_C_STRING                      wxSTC_C_STRING
#define cbSCI_C_CHARACTER                   wxSTC_C_CHARACTER
#define cbSCI_C_CHARACTER                   wxSTC_C_CHARACTER

#define cbSCI_D_PREPROCESSOR                wxSTC_D_PREPROCESSOR
#define cbSCI_D_STRING                      wxSTC_D_STRING
#define cbSCI_D_CHARACTER                   wxSTC_D_CHARACTER
#define cbSCI_D_CHARACTER                   wxSTC_D_CHARACTER

#define cbSCI_STYLE_LINENUMBER              wxSTC_STYLE_LINENUMBER

#define cbSCI_INDIC_HIGHLIGHT               wxSTC_INDIC_HIGHLIGHT

#define cbSCI_FIND_MATCHCASE                wxSTC_FIND_MATCHCASE
#define cbSCI_FIND_WHOLEWORD                wxSTC_FIND_WHOLEWORD

#define cbSCI_KEY_HOME                      wxSTC_KEY_HOME
#define cbSCI_KEY_END                       wxSTC_KEY_END

#define cbSCI_SCMOD_NORM                    wxSTC_SCMOD_NORM
#define cbSCI_SCMOD_SHIFT                   wxSTC_SCMOD_SHIFT
#define cbSCI_SCMOD_ALT                     wxSTC_SCMOD_ALT

#define cbSCI_CMD_HOME                      wxSTC_CMD_HOME
#define cbSCI_CMD_HOMEEXTEND                wxSTC_CMD_HOMEEXTEND
#define cbSCI_CMD_HOMERECTEXTEND            wxSTC_CMD_HOMERECTEXTEND
#define cbSCI_CMD_VCHOME                    wxSTC_CMD_VCHOME
#define cbSCI_CMD_VCHOMEEXTEND              wxSTC_CMD_VCHOMEEXTEND
#define cbSCI_CMD_VCHOMERECTEXTEND          wxSTC_CMD_VCHOMERECTEXTEND

#define cbSCI_CMD_LINEENDWRAP               wxSTC_CMD_LINEENDWRAP

#define cbSCI_IV_LOOKBOTH                   wxSTC_IV_LOOKBOTH
#define cbSCI_IV_NONE                       wxSTC_IV_NONE

class cbScintilla : public wxStyledTextCtrl
{
public:
    cbScintilla(wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition,
                const wxSize& size = wxDefaultSize, long style = 0)
        : wxStyledTextCtrl(parent, id, pos, size, style)
    {
    }
};

#else // !wxCHECK_VERSION(2, 9, 2)

#define cbSCI_INVALID_POSITION              wxSCI_INVALID_POSITION

#define cbSCI_KEYWORDSET_MAX                wxSCI_KEYWORDSET_MAX
#define cbSCI_EOL_LF                        wxSCI_EOL_LF
#define cbSCI_EOL_CR                        wxSCI_EOL_CR

#define cbSCI_C_COMMENT                     wxSCI_C_COMMENT
#define cbSCI_C_COMMENTDOC                  wxSCI_C_COMMENTDOC
#define cbSCI_C_COMMENTDOCKEYWORD           wxSCI_C_COMMENTDOCKEYWORD
#define cbSCI_C_COMMENTDOCKEYWORDERROR      wxSCI_C_COMMENTDOCKEYWORDERROR
#define cbSCI_C_COMMENTLINE                 wxSCI_C_COMMENTLINE
#define cbSCI_C_COMMENTLINEDOC              wxSCI_C_COMMENTLINEDOC

#define cbSCI_D_COMMENT                     wxSCI_D_COMMENT
#define cbSCI_D_COMMENTDOC                  wxSCI_D_COMMENTDOC
#define cbSCI_D_COMMENTDOCKEYWORD           wxSCI_D_COMMENTDOCKEYWORD
#define cbSCI_D_COMMENTDOCKEYWORDERROR      wxSCI_D_COMMENTDOCKEYWORDERROR
#define cbSCI_D_COMMENTLINE                 wxSCI_D_COMMENTLINE
#define cbSCI_D_COMMENTLINEDOC              wxSCI_D_COMMENTLINEDOC

#define cbSCI_LEX_CPP                       wxSCI_LEX_CPP
#define cbSCI_LEX_D                         wxSCI_LEX_D

#define cbSCI_C_PREPROCESSOR                wxSCI_C_PREPROCESSOR
#define cbSCI_C_STRING                      wxSCI_C_STRING
#define cbSCI_C_CHARACTER                   wxSCI_C_CHARACTER
#define cbSCI_C_CHARACTER                   wxSCI_C_CHARACTER

#define cbSCI_D_PREPROCESSOR                wxSCI_D_PREPROCESSOR
#define cbSCI_D_STRING                      wxSCI_D_STRING
#define cbSCI_D_CHARACTER                   wxSCI_D_CHARACTER
#define cbSCI_D_CHARACTER                   wxSCI_D_CHARACTER

#define cbSCI_STYLE_LINENUMBER              wxSCI_STYLE_LINENUMBER

#define cbSCI_INDIC_HIGHLIGHT               wxSCI_INDIC_HIGHLIGHT

#define cbSCI_FIND_MATCHCASE                wxSCI_FIND_MATCHCASE
#define cbSCI_FIND_WHOLEWORD                wxSCI_FIND_WHOLEWORD

#define cbSCI_KEY_HOME                      wxSCI_KEY_HOME
#define cbSCI_KEY_END                       wxSCI_KEY_END

#define cbSCI_SCMOD_NORM                    wxSCI_SCMOD_NORM
#define cbSCI_SCMOD_SHIFT                   wxSCI_SCMOD_SHIFT
#define cbSCI_SCMOD_ALT                     wxSCI_SCMOD_ALT

#define cbSCI_CMD_HOME                      wxSCI_CMD_HOME
#define cbSCI_CMD_HOMEEXTEND                wxSCI_CMD_HOMEEXTEND
#define cbSCI_CMD_HOMERECTEXTEND            wxSCI_CMD_HOMERECTEXTEND
#define cbSCI_CMD_VCHOME                    wxSCI_CMD_VCHOME
#define cbSCI_CMD_VCHOMEEXTEND              wxSCI_CMD_VCHOMEEXTEND
#define cbSCI_CMD_VCHOMERECTEXTEND          wxSCI_CMD_VCHOMERECTEXTEND

#define cbSCI_CMD_LINEENDWRAP               wxSCI_CMD_LINEENDWRAP

#define cbSCI_IV_LOOKBOTH                   wxSCI_IV_LOOKBOTH
#define cbSCI_IV_NONE                       wxSCI_IV_NONE

class cbScintilla : public wxScintilla
{
public:
    cbScintilla(wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition,
                const wxSize& size = wxDefaultSize, long style = 0)
        : wxScintilla(parent, id, pos, size, style)
    {
    }
};

#endif // wxCHECK_VERSION(2, 9, 2)

#endif // CBSCINTILLA_H

And I have some questions:
Code
void Editor::NotifyStyleToNeeded(int endStyleNeeded) {
/* C::B begin */
    SCNotification scn; memset((void*)&scn, 0, sizeof(scn));
/* C::B end */
    scn.nmhdr.code = SCN_STYLENEEDED;
    scn.position = endStyleNeeded;
    NotifyParent(scn);
}

void Editor::NotifyStyleNeeded(Document *, void *, int endStyleNeeded) {
    NotifyStyleToNeeded(endStyleNeeded);
}

void Editor::NotifyLexerChanged(Document *, void *) {
}

void Editor::NotifyErrorOccurred(Document *, void *, int status) {
    errorStatus = status;
}

void Editor::NotifyChar(int ch) {
/* C::B begin */
    SCNotification scn; memset((void*)&scn, 0, sizeof(scn));
/* C::B end */
    scn.nmhdr.code = SCN_CHARADDED;
    scn.ch = ch;
    NotifyParent(scn);
}

void Editor::NotifySavePoint(bool isSavePoint) {
/* C::B begin */
    SCNotification scn; memset((void*)&scn, 0, sizeof(scn));
/* C::B end */
    if (isSavePoint) {
        scn.nmhdr.code = SCN_SAVEPOINTREACHED;
    } else {
        scn.nmhdr.code = SCN_SAVEPOINTLEFT;
    }
    NotifyParent(scn);
}

void Editor::NotifyModifyAttempt() {
/* C::B begin */
    SCNotification scn; memset((void*)&scn, 0, sizeof(scn));
/* C::B end */
    scn.nmhdr.code = SCN_MODIFYATTEMPTRO;
    NotifyParent(scn);
}

void Editor::NotifyDoubleClick(Point pt, bool shift, bool ctrl, bool alt) {
/* C::B begin */
    SCNotification scn; memset((void*)&scn, 0, sizeof(scn));
/* C::B end */
    scn.nmhdr.code = SCN_DOUBLECLICK;
    scn.line = LineFromLocation(pt);
    scn.position = PositionFromLocation(pt, true);
    scn.modifiers = (shift ? SCI_SHIFT : 0) | (ctrl ? SCI_CTRL : 0) |
            (alt ? SCI_ALT : 0);
    NotifyParent(scn);
}

void Editor::NotifyHotSpotDoubleClicked(int position, bool shift, bool ctrl, bool alt) {
/* C::B begin */
    SCNotification scn; memset((void*)&scn, 0, sizeof(scn));
/* C::B end */
    scn.nmhdr.code = SCN_HOTSPOTDOUBLECLICK;
    scn.position = position;
    scn.modifiers = (shift ? SCI_SHIFT : 0) | (ctrl ? SCI_CTRL : 0) |
            (alt ? SCI_ALT : 0);
    NotifyParent(scn);
}

void Editor::NotifyHotSpotClicked(int position, bool shift, bool ctrl, bool alt) {
/* C::B begin */
    SCNotification scn; memset((void*)&scn, 0, sizeof(scn));
/* C::B end */
    scn.nmhdr.code = SCN_HOTSPOTCLICK;
    scn.position = position;
    scn.modifiers = (shift ? SCI_SHIFT : 0) | (ctrl ? SCI_CTRL : 0) |
            (alt ? SCI_ALT : 0);
    NotifyParent(scn);
}

void Editor::NotifyUpdateUI() {
/* C::B begin */
    SCNotification scn; memset((void*)&scn, 0, sizeof(scn));
/* C::B end */
    scn.nmhdr.code = SCN_UPDATEUI;
    NotifyParent(scn);
}

void Editor::NotifyPainted() {
/* C::B begin */
    SCNotification scn; memset((void*)&scn, 0, sizeof(scn));
/* C::B end */
    scn.nmhdr.code = SCN_PAINTED;
    NotifyParent(scn);
}
................

It seems the "C::B begin" and "C::B end" flag is error position?
« Last Edit: October 18, 2010, 05:48:07 am by Loaden »

Offline Loaden

  • Lives here!
  • ****
  • Posts: 1014
Re: Building with wxWidgets 2.9
« Reply #22 on: October 18, 2010, 06:57:11 am »
There is a possible way: using MONOLITHIC = 0
I am trying, and feedback the result.

Quote
make -f makefile.gcc LDFLAGS=-s SHARED=1 BUILD=release UNICODE=1 MONOLITHIC=0 OFFICIAL_BUILD=1 RUNTIME_LIBS=static >nul

In wx2.9.2svn, the MONOLITHIC default to 0
Code
# Multiple libraries or single huge monolithic one? [0,1]
MONOLITHIC ?= 0
Successed!
I think this should be a viable option.
« Last Edit: October 19, 2010, 03:34:02 am by Loaden »

Offline Cryogen

  • Regular
  • ***
  • Posts: 260
Re: Building with wxWidgets 2.9
« Reply #23 on: October 19, 2010, 01:53:53 am »
There is a possible way: using MONOLITHIC = 0
I am trying, and feedback the result.

Quote
make -f makefile.gcc LDFLAGS=-s SHARED=1 BUILD=release UNICODE=1 MONOLITHIC=0 OFFICIAL_BUILD=1 RUNTIME_LIBS=static >nul

In wx2.9.2svn, the MONOLITHIC default to 0
Code
# Multiple libraries or single huge monolithic one? [0,1]
MONOLITHIC ?= 0
Successed!
I think this should be a viable option.

Loaden, you are my hero. The only negative is that there are some nasty, hard-coded paths in your .cbp which need to be replaced with the (#wx) versions. I built wx as you suggested and CB using your project file and it finally worked. Many, many thanks.

Gary.

Offline Loaden

  • Lives here!
  • ****
  • Posts: 1014
Re: Building with wxWidgets 2.9
« Reply #24 on: October 19, 2010, 03:32:57 am »
The only negative is that there are some nasty, hard-coded paths in your .cbp which need to be replaced with the (#wx) versions.
This is very strange, I did not specifically set it.
Fixed and update the patch in here: http://forums.codeblocks.org/index.php/topic,13388.msg90930.html#msg90930
« Last Edit: October 19, 2010, 03:35:21 am by Loaden »

Offline Loaden

  • Lives here!
  • ****
  • Posts: 1014
Re: Building with wxWidgets 2.9
« Reply #25 on: October 19, 2010, 03:11:58 pm »
New configure:
Code
make -f makefile.gcc LDFLAGS=-s SHARED=1 BUILD=debug UNICODE=1 DEBUG_INFO=0 DEBUG_FLAG=1 MONOLITHIC=0 OFFICIAL_BUILD=1 RUNTIME_LIBS=static >nul
make -f makefile.gcc LDFLAGS=-s SHARED=1 BUILD=release UNICODE=1 DEBUG_INFO=0 DEBUG_FLAG=0 MONOLITHIC=0 OFFICIAL_BUILD=1 RUNTIME_LIBS=static >nul
see: http://trac.wxwidgets.org/ticket/12574

Offline Cryogen

  • Regular
  • ***
  • Posts: 260
Re: Building with wxWidgets 2.9
« Reply #26 on: October 28, 2010, 02:31:57 am »

 OK, progress so far...

Part 1 - Overcome stoopidity.
No-one picked up that I was using e.g. wxUSE_STC on the command line, rather than USE_STC, least of all me!!. Deary me. Discovering that has allowed me to build wx as a monolithic lib, as well.

Part 2 - Experiments
I've now tried building monolithic and shared lib versions, using all combinations of STC and PropGrid on and off. I've found that CB will build with the wx version of propgrid. It will build using the shared libs even with USE_STC on. The problem is that wxSmith won't build with the wx version of propgrid. The version in CB is quite different to that one. I think it's because we've got the latest and the wx version has been modified for wx but that causes issues, too. There are various other problems depending on how wx is built, too. Whatever I do I can't get both CB and wxSmith to build with the same build of wx. That's a real bummer. Has anyone achieved it?

Maybe we need to create a wx29 branch at some stage and work on getting it running. It's important for wxSmith because users (and we) are going to want to use the funky new controls that it brings and to do that we need to build wxSmith with 2.9. I've made a start on getting it to work with the 2.9 version but there's more to do, yet.
Some things in CB's code need to change due to deprecated or missing functions, etc. I'll keep chipping away at that and I'm happy to contribute whatever comes out if it to the greater good. I know Tim's made some progress, too, so we should make sure that the work isn't lost. A new branch would seem to be a good way to do it.

Cheers.


Offline Loaden

  • Lives here!
  • ****
  • Posts: 1014
Re: Building with wxWidgets 2.9
« Reply #27 on: October 28, 2010, 02:39:24 am »
A new branch would seem to be a good way to do it.
Agree. :)

Offline daniloz

  • Regular
  • ***
  • Posts: 268
Re: Building with wxWidgets 2.9
« Reply #28 on: March 03, 2011, 11:08:14 am »
Sorry to bump an old thread, but I cannot build C::B using wxWidgets 2.9.1... I have an error while compiling the SDK:
Code
-------------- Build: sdk in Code::Blocks ---------------

mingw32-g++.exe -Wall -g -pipe -mthreads -fmessage-length=0 -fexceptions -Winvalid-pch -DHAVE_W32API_H -D__WXMSW__ -DWXUSINGDLL -DcbDEBUG -DCB_PRECOMP -DWX_PRECOMP -DwxUSE_UNICODE -DwxDEBUG_LEVEL=0  -DEXPORT_LIB -DEXPORT_EVENTS -DWXMAKINGDLL_PROPGRID -DwxPG_USE_WXMODULE=1 -DWXMAKINGDLL_SCI    -IC:\Work\wxWidgets-2.9.1\include -IC:\Work\wxWidgets-2.9.1\contrib\include -IC:\Work\wxWidgets-2.9.1\lib\gcc_dll_32\mswu -Isdk\wxscintilla\include -Iinclude\tinyxml -Iinclude -Iinclude\tinyxml -Iinclude\scripting\bindings -Iinclude\scripting\include -Iinclude\scripting\sqplus -Iinclude\mozilla_chardet  -c C:\Work\codeblocks_trunk64\src\sdk\cbauibook.cpp -o .objs\sdk\cbauibook.o
C:\Work\wxWidgets-2.9.1\include/wx/event.h: In member function 'void cbAuiNotebook::MinimizeFreeSpace(wxAuiTabCtrl*)':
C:\Work\wxWidgets-2.9.1\include/wx/event.h:2997:18: error: 'virtual bool wxEvtHandler::ProcessEvent(wxEvent&)' is inaccessible
C:\Work\codeblocks_trunk64\src\sdk\cbauibook.cpp:520:36: error: within this context

I've changed setup0.h (wxUSE_STC=0) and used the following command line to build wxWidgets:
Code
mingw32-make -f makefile.gcc MONOLITHIC=1 SHARED=1 UNICODE=1 USE_STC=0 USE_PROPGRID=1 BUILD=release clean
mingw32-make -f makefile.gcc MONOLITHIC=1 SHARED=1 UNICODE=1 USE_STC=0 USE_PROPGRID=1 BUILD=release

I'm trying to build on Vista 32 with MINGW gcc (tdm). Result of gcc -v
Code
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=c:/mingw32/bin/../libexec/gcc/mingw32/4.5.1/lto-wrapper.exe
Target: mingw32
Configured with: ../../src/gcc-4.5.1/configure --build=mingw32 --enable-languages=c,ada,c++,fortran,objc,obj-c++ --enable-threads=win32 --enable-libgomp --enabl
e-lto --enable-fully-dynamic-string --enable-libstdcxx-debug --enable-version-specific-runtime-libs --disable-nls --disable-win32-registry --disable-symvers --p
refix=/mingw --disable-werror --enable-cxx-flags='-fno-function-sections -fno-data-sections' --with-pkgversion=tdm-1 --enable-sjlj-exceptions --with-bugurl=http
://tdm-gcc.tdragon.net/bugs
Thread model: win32
gcc version 4.5.1 (tdm-1)

I don't quite get the error, any help would be appreciated...

Edit:
I'm using the CodeBlocks_wx29 project and latest version from trunk r7032...

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Building with wxWidgets 2.9
« Reply #29 on: March 03, 2011, 12:09:48 pm »
A new branch would seem to be a good way to do it.
Agree. :)
There is already a wx/wxsmith branch why would you need another one?
(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 MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Building with wxWidgets 2.9
« Reply #30 on: March 03, 2011, 12:52:10 pm »
There is already a wx/wxsmith branch why would you need another one?
Because this development is not related to wxSmith, but the conversion to wx29.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Building with wxWidgets 2.9
« Reply #31 on: March 03, 2011, 02:21:06 pm »
Maybe we need to create a wx29 branch at some stage and work on getting it running. It's important for wxSmith because users (and we) are going to want to use the funky new controls that it brings and to do that we need to build wxSmith with 2.9. I've made a start on getting it to work with the 2.9 version but there's more to do, yet.
Some things in CB's code need to change due to deprecated or missing functions, etc. I'll keep chipping away at that and I'm happy to contribute whatever comes out if it to the greater good. I know Tim's made some progress, too, so we should make sure that the work isn't lost. A new branch would seem to be a good way to do it.
But Cryogen wants to change things in wxSmith -> add controls, so both branches would change wxSmith.
Also the wx2.9 branch should work with 2.8, because wx3.0 won't be released this year for sure and there are people on old linux distros, which won't have 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!]

Offline ptDev

  • Almost regular
  • **
  • Posts: 222
Re: Building with wxWidgets 2.9
« Reply #32 on: March 03, 2011, 05:06:12 pm »
But Cryogen wants to change things in wxSmith -> add controls, so both branches would change wxSmith.
Also the wx2.9 branch should work with 2.8, because wx3.0 won't be released this year for sure and there are people on old linux distros, which won't have it...

But wx2.9 makes too many incompatible changes, starting with the wxString changes. It is meant to allow to transition code to wx3.0. I wouldn't trust it to work well with wx2.8... unless one fills the source code with version macros.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Building with wxWidgets 2.9
« Reply #33 on: March 03, 2011, 08:48:57 pm »
It is already filled with them...
(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 oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Building with wxWidgets 2.9
« Reply #34 on: February 17, 2012, 09:25:43 pm »
Jens:
Is C::B working on your linux when using wx2.9?
I'm trying to see what is going on with wx2.9 and I get a crash in CC :(

What about making this topic a sticky one, so I don't waste 10 minutes searching for the wx2.9 porting topic (if this is the correct topic of course).
(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 MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Building with wxWidgets 2.9
« Reply #35 on: February 17, 2012, 09:31:31 pm »
Is C::B working on your linux when using wx2.9?
Its working fine here on Windows meanwhile, at least the core. However - I have a few patches pending where I am unsure if they are needed for wx29 (for 64bit they are).

I'm trying to see what is going on with wx2.9 and I get a crash in CC :(
Make sure you compile CC with -DCC_NO_COLLAPSE_ITEM, this solved it for me, at least in 64bit build (with wx29, of course).
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Building with wxWidgets 2.9
« Reply #36 on: February 17, 2012, 10:13:43 pm »
Code
#0 0x7ffff1552629	free() (/lib64/libc.so.6:??)
#1 0x45d44d wxString::ConvertedBuffer<wchar_t>::~ConvertedBuffer(this=0x7fffffffada8, __in_chrg=<optimized out>) (/usr/include/wx-2.9/wx/string.h:3518)
#2 0x45a7e9 wxString::~wxString(this=0x7fffffffad90, __in_chrg=<optimized out>) (/usr/include/wx-2.9/wx/string.h:1340)
#3 0x7fffd488ab95 ParserCommon::FileType(filename=..., force_refresh=true) (/home/obfuscated/projects/codeblocks/dev/trunk_clean/src/plugins/codecompletion/parser/parser.cpp:101)
#4 0x7fffd488be2e ParserBase::ReadOptions(this=0x15c5a70) (/home/obfuscated/projects/codeblocks/dev/trunk_clean/src/plugins/codecompletion/parser/parser.cpp:203)
#5 0x7fffd488b1e7 ParserBase::ParserBase(this=0x15c5a70) (/home/obfuscated/projects/codeblocks/dev/trunk_clean/src/plugins/codecompletion/parser/parser.cpp:143)
#6 0x7fffd48b44f4 NativeParser::NativeParser(this=0x15f9ff8) (/home/obfuscated/projects/codeblocks/dev/trunk_clean/src/plugins/codecompletion/nativeparser.cpp:288)
#7 0x7fffd482cd17 CodeCompletion::CodeCompletion(this=0x15f9f70) (/home/obfuscated/projects/codeblocks/dev/trunk_clean/src/plugins/codecompletion/codecompletion.cpp:486)
#8 0x7fffd48504bf PluginRegistrant<CodeCompletion>::CreatePlugin() (/home/obfuscated/projects/codeblocks/dev/trunk_clean/src/include/cbplugin.h:613)
#9 0x7ffff2646ac9 PluginManager::LoadPlugin(this=0x11c41b0, pluginName=...) (/home/obfuscated/projects/codeblocks/dev/trunk_clean/src/sdk/pluginmanager.cpp:1044)
#10 0x7ffff2646479 PluginManager::ScanForPlugins(this=0x11c41b0, path=...) (/home/obfuscated/projects/codeblocks/dev/trunk_clean/src/sdk/pluginmanager.cpp:985)
#11 0x48bac8 MainFrame::ScanForPlugins(this=0xcab870) (/home/obfuscated/projects/codeblocks/dev/trunk_clean/src/src/main.cpp:1061)
#12 0x486e2d MainFrame::MainFrame(this=0xcab870, parent=0x0) (/home/obfuscated/projects/codeblocks/dev/trunk_clean/src/src/main.cpp:571)
#13 0x47a3b8 CodeBlocksApp::InitFrame(this=0x7799e0) (/home/obfuscated/projects/codeblocks/dev/trunk_clean/src/src/app.cpp:417)
#14 0x47bc4d CodeBlocksApp::OnInit(this=0x7799e0) (/home/obfuscated/projects/codeblocks/dev/trunk_clean/src/src/app.cpp:642)
#15 0x480889 wxAppConsoleBase::CallOnInit(this=0x7799e0) (/usr/include/wx-2.9/wx/app.h:94)
#16 0x7ffff323fb34 wxEntry(int&, wchar_t**) () (/usr/lib64/libwx_baseu-2.9.so.3:??)
#17 0x479d3e main(argc=6, argv=0x7fffffffdaf8) (/home/obfuscated/projects/codeblocks/dev/trunk_clean/src/src/app.cpp:261)

Here is the crash log, I'm using the -DCC_NO_COLLAPSE_ITEM option. wxGTK 2.9.3.1 on gentoo linux 64bit.
(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 Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Building with wxWidgets 2.9
« Reply #37 on: February 18, 2012, 07:30:25 am »
It seems to work here with gcc 4.6.2, wx 2.9 from their trunk (I'm nit sure about the minor revision) on debian 64-bit.
But it is very, very slow.
Here is a snippet from debug log for simple hello-world project:
Quote
Create new parser for project 'test'
Updating class browser...
Class browser updated.
Starting batch parsing for project 'test'...
Project 'test' parsing stage done!
Project 'test' parsing stage done (110 total parsed files, 4482 tokens in 0 minute(s), 16.617 seconds).
Updating class browser...
Class browser updated.
here is the same for debugger-branch 7790 (wx2.8):
Quote
Create new parser for project 'test'
Updating class browser...
Class browser updated.
Starting batch parsing for project 'test'...
Project 'test' parsing stage done!
Project 'test' parsing stage done (108 total parsed files, 4313 tokens in 0 minute(s), 0.262 seconds).
Updating class browser...
Class browser updated.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5916
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Building with wxWidgets 2.9
« Reply #38 on: February 18, 2012, 08:31:01 am »
yesterday, i successful build CB against wx2.9.3 under windows XP, i also notice CC's parser is much much slower than the wx2.8.12.
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 MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Building with wxWidgets 2.9
« Reply #39 on: February 18, 2012, 10:21:54 am »
yesterday, i successful build CB against wx2.9.3 under windows XP, i also notice CC's parser is much much slower than the wx2.8.12.
Oh dear... I have this feeling that its due to the whole wxString ANSI/Unicode abstraction stuff introduced in wx29... :-\ I guess we need to instrument some time measuring to find out... :(
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5916
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Building with wxWidgets 2.9
« Reply #40 on: February 18, 2012, 10:24:32 am »
I just test it again right now, the result is:

C::B nightly build against wx2.8.12.

Code
Project 'Code::Blocks' parsing stage done (1419 total parsed files, 125538 tokens in 0 minute(s), 28.516 seconds).

C::B trunk build myself against wx2.9.3

Code
Project 'Code::Blocks' parsing stage done (1419 total parsed files, 125621 tokens in 0 minute(s), 32.652 seconds).

So, it looks like there are not much difference.  :)
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 ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5916
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Building with wxWidgets 2.9
« Reply #41 on: February 18, 2012, 10:33:50 am »
yesterday, i successful build CB against wx2.9.3 under windows XP, i also notice CC's parser is much much slower than the wx2.8.12.
Oh dear... I have this feeling that its due to the whole wxString ANSI/Unicode abstraction stuff introduced in wx29... :-\ I guess we need to instrument some time measuring to find out... :(
I have also deep analysis the wxString by reading it's document and code.

As I can see, the wxChar is still defined as wchar_t
wxWidgets: wxWidgets: Strings
Quote
wxChar is defined to be

    char when wxUSE_UNICODE==0
    wchar_t when wxUSE_UNICODE==1 (the default).


But the function wxString::GetChar(n) is much different between Linux and Windows.
Because under Windows, the wxString natively use wchar_t, so GetChar(n) will quickly do a fetch by base+address bias.
But under Linux, the wxString use utf8 format, so it will do more work, which means it should do the dynamic decoding from the beginning of the buffer, and count n "code point", then return the nth "code point" value. Luckily, wxString using a cache, which means the address returned by previous call of GetChar(n) was cached, if the next time, the user call GetChar(n+m), wxString is smart enough to begin the calculation/decoding from the address return from GetChar(n).

As a conclusion, if you have a source file in local disk and this file is encode in UTF8 format. Under windows, it should first convert to wchar_t array when the file is loaded and convert to wxString, because wxString use wchar_t natively in wxString. But under linux, we don't need the conversion, because wxString use natively UTF8 buffer. On the other side, when doing search in the wxString (like call GetChar()), it need do the conversion dynamically. So, from my analysis, there should not me much difference from wx2.8 to wx2.9 in Linux.


« Last Edit: February 18, 2012, 10:36:13 am by ollydbg »
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 Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Building with wxWidgets 2.9
« Reply #42 on: February 18, 2012, 06:18:01 pm »
I just test it again right now, the result is:

C::B nightly build against wx2.8.12.

Code
Project 'Code::Blocks' parsing stage done (1419 total parsed files, 125538 tokens in 0 minute(s), 28.516 seconds).

C::B trunk build myself against wx2.9.3

Code
Project 'Code::Blocks' parsing stage done (1419 total parsed files, 125621 tokens in 0 minute(s), 32.652 seconds).

So, it looks like there are not much difference.  :)

With wx2.8.12  from debian (64-bit, used compiler unknown):
Quote
Project 'Code::Blocks wx2.8.x - Unix' parsing stage done (1378 total parsed files, 74286 tokens in 0 minute(s), 7.577 seconds).

and with self-compiled wx2.9.4 (wx-trunk, 64-bit, compiled with gcc 4.6):
Quote
Project 'Code::Blocks wx2.8.x - Unix' parsing stage done (1851 total parsed files, 75516 tokens in 5 minute(s), 54.683 seconds).
The amount of parsed files is significantly different and the time needed for parsing ...  :o

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Building with wxWidgets 2.9
« Reply #43 on: February 19, 2012, 03:27:21 am »
Did you turn off all the debugging options in wxWidgets 2.9?
Because I could see them taking a lot of CPU time to run.

Note: Just making a release build is NOT enough to turn the the checking/debugging code off.
See wxDEBUG_LEVEL or DEBUG_FLAG=0.

Tim S.
« Last Edit: February 19, 2012, 04:17:24 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline ptDev

  • Almost regular
  • **
  • Posts: 222
Re: Building with wxWidgets 2.9
« Reply #44 on: February 19, 2012, 08:33:31 am »
The setting can be edited in setup.h prior to compiling.
Just uncomment this section:
Code
// ----------------------------------------------------------------------------
// debugging settings
// ----------------------------------------------------------------------------

// wxDEBUG_LEVEL will be defined as 1 in wx/debug.h so normally there is no
// need to define it here. You may do it for two reasons: either completely
// disable/compile out the asserts in release version (then do it inside #ifdef
// NDEBUG) or, on the contrary, enable more asserts, including the usually
// disabled ones, in the debug build (then do it inside #ifndef NDEBUG)
//
#ifdef NDEBUG
#define wxDEBUG_LEVEL 0
#else
#define wxDEBUG_LEVEL 2
#endif

Also, it would be interesting to know which wxString implementation 2.9.x uses. I've heard that as of 2.9.x, wxString is a wrapper to std::string (or std::wstring) by default. How does each implementation impact the performance?

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Building with wxWidgets 2.9
« Reply #45 on: February 19, 2012, 09:28:19 am »
Did you turn off all the debugging options in wxWidgets 2.9?
Because I could see them taking a lot of CPU time to run.
No, and this might be the reason.
I will not dig into it deeper for now, because I need the asserts to find more issues with wxWidgets (not only 2.9), that will otherwise silently be ignored.


Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Building with wxWidgets 2.9
« Reply #46 on: February 20, 2012, 11:06:19 am »
I have two patches here, to solve wx2.9 issues.

One issue leads to a crash in projectfiledialog, because of incorrect settings for wxGridSizer (columns and rows have to match the amount of children) and will surely not do any harm.

The other leads to a frozen (not repainted) application after splitting or unsplitting an editor.
This issue is most likely a wxGTK only issue and is related to reparenting the controls while the editor is frozen.
I have a patch here for this, that thaws the editor before the call to Reparent() and freezes it directly after.
I wrapped in #if defined ( __WXGTK__ ) && wxCHECK_VERSION(2, 9, 0), but before committing it, I would like to ask, whether it is really only a wxGTK issue or also happens on wxMSW.
The second question is, if it also happens with wxwidgets < 2.9.4 (the one I use for test). To be sure I check for wx2.9.0, but this might not be correct.

I will build a (real) debug version of wxWidgets and try to track down the bug and probably provide a patch for wxwidgets or at least file a bug-report with a simple testcase.