Author Topic: Compiling C::B wit wx2.9  (Read 17936 times)

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3352
Compiling C::B wit wx2.9
« on: February 27, 2013, 10:38:36 pm »
I know that wx2.9 isn't supported, but i am keeping on trying ;)
if i complie c::b unix wx 2.9 i get a lot of errors like:
Code
trunk/src/src/environmentsettingsdlg.cpp|263|error: invalid use of incomplete type 'struct wxAuiDockArt'|
/usr/local/include/wx-2.9/wx/aui/framemanager.h|130|error: forward declaration of 'struct wxAuiDockArt'|

if i add
Code
#include <wx/aui/dockart.h>

it compiles without errors....

bug?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: Compiling C::B wit wx2.9
« Reply #1 on: February 27, 2013, 10:46:35 pm »
Probably, but please use one of the other topics about wx2.9.
(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 BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3352
Re: Compiling C::B wit wx2.9
« Reply #2 on: February 27, 2013, 10:59:57 pm »
what other topic? i searched but the newest was from 08.2012... i don't dig in tombs

any way a other bug:
to compile the contributed plugins:
cctest:
the wrong search directory for libraries: there is devel but should be devel29

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: Compiling C::B wit wx2.9
« Reply #3 on: February 27, 2013, 11:43:40 pm »
what other topic? i searched but the newest was from 08.2012... i don't dig in tombs
This is relatively new...

any way a other bug:
to compile the contributed plugins:
cctest:
the wrong search directory for libraries: there is devel but should be devel29
Patches?
(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 ouch

  • Almost regular
  • **
  • Posts: 223
Re: Compiling C::B wit wx2.9
« Reply #4 on: February 28, 2013, 11:03:39 pm »
actually cctest compiled fine for me.

but the exporter stops at the pdf part:

Code
mingw32-g++.exe -DWXMAKINGLIB_PDFDOC -Wall -O2 -Winvalid-pch -mthreads -fexceptions -DHAVE_W32API_H -D__WXMSW__ -DWX_PRECOMP -DWXUSINGDLL -DwxUSE_UNICODE -DWXMAKINGDLL_PDFDOC -DwxPDF_USE_WXMODULE=0 -IC:\Programming\wxWidgets\wxWidgets\include -IC:\Programming\wxWidgets\wxWidgets\lib\gcc_dll\mswu -IwxPdfDocument\include -c C:\Programming\codeblocks\src\plugins\contrib\source_exporter\wxPdfDocument\src\pdffont.cpp -o ..\..\..\.objs29\plugins\contrib\source_exporter\wxPdfDocument\src\pdffont.o
C:\Programming\codeblocks\src\plugins\contrib\source_exporter\wxPdfDocument\src\pdfencrypt.cpp: In function 'void MD5Final(unsigned char*, MD5_CTX*)':
C:\Programming\codeblocks\src\plugins\contrib\source_exporter\wxPdfDocument\src\pdfencrypt.cpp:188:32: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
C:\Programming\codeblocks\src\plugins\contrib\source_exporter\wxPdfDocument\src\pdfencrypt.cpp:189:32: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
In file included from C:\Programming\codeblocks\src\plugins\contrib\source_exporter\wxPdfDocument\src\pdfdc.cpp:26:0:
C:\Programming\codeblocks\src\plugins\contrib\source_exporter\wxPdfDocument\src\pdfdc29.inc: In constructor 'wxPdfDC::wxPdfDC()':
C:\Programming\codeblocks\src\plugins\contrib\source_exporter\wxPdfDocument\src\pdfdc29.inc:30:30: error: cannot allocate an object of abstract type 'wxPdfDCImpl'
In file included from wxPdfDocument\include/wx/pdfdc.h:36:0,
                 from C:\Programming\codeblocks\src\plugins\contrib\source_exporter\wxPdfDocument\src\pdfdc29.inc:17,
                 from C:\Programming\codeblocks\src\plugins\contrib\source_exporter\wxPdfDocument\src\pdfdc.cpp:26:
wxPdfDocument\include/wx/pdfdc29.h:40:26: note:   because the following virtual functions are pure within 'wxPdfDCImpl':
In file included from C:\Programming\wxWidgets\wxWidgets\include/wx/wx.h:51:0,
                 from C:\Programming\wxWidgets\wxWidgets\include/wx/wxprec.h:59,
                 from C:\Programming\codeblocks\src\plugins\contrib\source_exporter\wxPdfDocument\src\pdfdc.cpp:14:
C:\Programming\wxWidgets\wxWidgets\include/wx/dc.h:607:18: note: virtual void wxDCImpl::DoDrawLines(int, const wxPoint*, wxCoord, wxCoord)
C:\Programming\wxWidgets\wxWidgets\include/wx/dc.h:612:18: note: virtual void wxDCImpl::DoDrawPolygon(int, const wxPoint*, wxCoord, wxCoord, wxPolygonFillMode)
In file included from C:\Programming\codeblocks\src\plugins\contrib\source_exporter\wxPdfDocument\src\pdfdc.cpp:26:0:
C:\Programming\codeblocks\src\plugins\contrib\source_exporter\wxPdfDocument\src\pdfdc29.inc: In constructor 'wxPdfDC::wxPdfDC(const wxPrintData&)':
C:\Programming\codeblocks\src\plugins\contrib\source_exporter\wxPdfDocument\src\pdfdc29.inc:35:41: error: cannot allocate an object of abstract type 'wxPdfDCImpl'
In file included from wxPdfDocument\include/wx/pdfdc.h:36:0,
                 from C:\Programming\codeblocks\src\plugins\contrib\source_exporter\wxPdfDocument\src\pdfdc29.inc:17,
                 from C:\Programming\codeblocks\src\plugins\contrib\source_exporter\wxPdfDocument\src\pdfdc.cpp:26:
wxPdfDocument\include/wx/pdfdc29.h:40:26: note:   since type 'wxPdfDCImpl' has pure virtual functions
In file included from C:\Programming\codeblocks\src\plugins\contrib\source_exporter\wxPdfDocument\src\pdfdc.cpp:26:0:
C:\Programming\codeblocks\src\plugins\contrib\source_exporter\wxPdfDocument\src\pdfdc29.inc: In constructor 'wxPdfDC::wxPdfDC(wxPdfDocument*, double, double)':
C:\Programming\codeblocks\src\plugins\contrib\source_exporter\wxPdfDocument\src\pdfdc29.inc:40:74: error: cannot allocate an object of abstract type 'wxPdfDCImpl'
In file included from wxPdfDocument\include/wx/pdfdc.h:36:0,
                 from C:\Programming\codeblocks\src\plugins\contrib\source_exporter\wxPdfDocument\src\pdfdc29.inc:17,
                 from C:\Programming\codeblocks\src\plugins\contrib\source_exporter\wxPdfDocument\src\pdfdc.cpp:26:
wxPdfDocument\include/wx/pdfdc29.h:40:26: note:   since type 'wxPdfDCImpl' has pure virtual functions

I've attached a patch to fix the missing header issue.

But I'm not sure how you want to go about fixing this, I think the author might have to handle that one.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7785
    • My Best Post
Re: Compiling C::B wit wx2.9
« Reply #5 on: March 01, 2013, 02:26:31 pm »
Possible patch for the missing header issue above.
NOT Tested.

FYI: wx/aui/aui.h is NOT in sdk_common.h therefore it should NOT be guarded by CB_PRECOMP.
wx/aui/aui.h includes "wx/aui/dockart.h" and several other headers; it does nothing but include other headers.

Tim S.

Code
Index: src/src/environmentsettingsdlg.cpp
===================================================================
--- src/src/environmentsettingsdlg.cpp (revision 8888)
+++ src/src/environmentsettingsdlg.cpp (working copy)
@@ -10,7 +10,6 @@
 #include <sdk.h>
 
 #ifndef CB_PRECOMP
-    #include <wx/aui/aui.h>
     #include <wx/button.h>
     #include <wx/menu.h>
     #include <wx/radiobut.h>
@@ -39,6 +38,7 @@
     #include "cbauibook.h"
 #endif
 
+#include <wx/aui/aui.h>
 #include <wx/listbook.h>
 
 #include "configurationpanel.h"
« Last Edit: March 01, 2013, 02:28:25 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3352
Re: Compiling C::B wit wx2.9
« Reply #6 on: March 01, 2013, 08:25:33 pm »
thanks you for the patches
i was also at the wxPDF errors, but i tried to use the compiled c::b and i got an floating-point exception at startup, so i try to fix this first.
The crash occurred on wxWidgets startup, i think in the aui part.....

i try to fix this error with the help of the wxWidgets forum.

actually cctest compiled fine for me.

this can be if you compiled c::b before with wx2.8. because the searchpath (if not fixed in the actual svn) for the libcodeblocks0 is definitively wrong.

thanks!

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: Compiling C::B wit wx2.9
« Reply #7 on: March 01, 2013, 08:36:10 pm »
Just for the record:
Which version of wx2.9 do you use ?
2.9.4 (the actual developer-release) or 2.9 from trunk, which is under heavy development ?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7785
    • My Best Post
Re: Compiling C::B wit wx2.9
« Reply #8 on: March 01, 2013, 08:46:18 pm »
Untested Patch

Code
Index: src/plugins/codecompletion/cctest_wx29-unix.cbp
===================================================================
--- src/plugins/codecompletion/cctest_wx29-unix.cbp (revision 8890)
+++ src/plugins/codecompletion/cctest_wx29-unix.cbp (working copy)
@@ -43,7 +43,7 @@
  <Linker>
  <Add library="codeblocks" />
  <Add option="`$(WX_CONFIG) --libs std,propgrid`" />
- <Add directory="../../devel" />
+ <Add directory="../../devel29" />
  </Linker>
  <Unit filename="cctest/cctest_app.cpp" />
  <Unit filename="cctest/cctest.cpp" />

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

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3352
Re: Compiling C::B wit wx2.9
« Reply #9 on: March 01, 2013, 09:31:54 pm »
Just for the record:
Which version of wx2.9 do you use ?
2.9.4 (the actual developer-release) or 2.9 from trunk, which is under heavy development ?

wx2.9_svn because someone in the wxforum told me to not use 2.9.4 but the actual svn version....

Untested Patch

this should work ;)

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: Compiling C::B wit wx2.9
« Reply #10 on: March 01, 2013, 09:45:40 pm »
Thanks, I just compiled C::B under linux with actual wx2.9 svn.

At least building the project is okay now.
I will run it, but do not expect it to work errorfree.

Next step is to check autotools, whether they still work.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: Compiling C::B wit wx2.9
« Reply #11 on: March 01, 2013, 10:01:06 pm »
thanks you for the patches
i was also at the wxPDF errors, but i tried to use the compiled c::b and i got an floating-point exception at startup, so i try to fix this first.
The crash occurred on wxWidgets startup, i think in the aui part.....

i try to fix this error with the help of the wxWidgets forum.

actually cctest compiled fine for me.

this can be if you compiled c::b before with wx2.8. because the searchpath (if not fixed in the actual svn) for the libcodeblocks0 is definitively wrong.

thanks!
The pdf-exporter part is fixed in my local copy.

I do not get any exceptions, just warnings about format-strings, but they should be fixable.

Did you clean the .pch directory when (re-)building wxwidgets ?
Did you install wxWidgets, or do you run wx-config from the build-folder (normally recommended) ?

Offline utelle

  • Single posting newcomer
  • *
  • Posts: 9
Re: Compiling C::B wit wx2.9
« Reply #12 on: March 01, 2013, 10:48:34 pm »
The pdf-exporter part is fixed in my local copy.

I do not get any exceptions, just warnings about format-strings, but they should be fixable.

[...]
It would be a good idea to send me the patches required to fix the problems in wxPdfDC, so that I can incorporate them in wxPdfDocument for the next release.

It was stated that wxWidgets-SVN is used to compile C::B. wxPdfDocument is developed and tested against official wxWidgets releases only (i.e. 2.8.12 and 2.9.4), since I don't have the time to keep it in sync with wxWidgets-SVN which is really a moving target.

Regards,

Ulrich

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: Compiling C::B wit wx2.9
« Reply #13 on: March 01, 2013, 11:24:42 pm »
The pdf-exporter part is fixed in my local copy.

I do not get any exceptions, just warnings about format-strings, but they should be fixable.

[...]
It would be a good idea to send me the patches required to fix the problems in wxPdfDC, so that I can incorporate them in wxPdfDocument for the next release.

It was stated that wxWidgets-SVN is used to compile C::B. wxPdfDocument is developed and tested against official wxWidgets releases only (i.e. 2.8.12 and 2.9.4), since I don't have the time to keep it in sync with wxWidgets-SVN which is really a moving target.

Regards,

Ulrich

I attach the patch, I just committed to trunk.
Basically the issue is, that the wxDCImpl base class now wants the wxPoint-array as const.

Offline ouch

  • Almost regular
  • **
  • Posts: 223
Re: Compiling C::B wit wx2.9
« Reply #14 on: March 04, 2013, 10:12:40 pm »
svn 8898 builds fine, Thanks everyone!

I get an assertion on a wxchecklistbox right off the bat though. Anyone else get this or is it just because I'm loading an older wx2.8 project file?

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3352
Re: Compiling C::B wit wx2.9
« Reply #15 on: March 04, 2013, 10:48:43 pm »
i finally also managed to build c::b with wx2.9.

I think my build environment is a mess . My errors came from the "double" link against the monolithic libwx_gtk2u-2.9.so.5 and the libwx_gtk2u_aui-2.9.so.5. This was because of the "wx-config --libs std,aui,propgrid". I deleted the std,aui,propgrid and now it is working.  If i'm not wrong c::b is linked against the monolithic build of wx, so why are there this additional "--libs std,aui,propgrid"?

o.t. Am I the only one with a monolithic and a normal wx build? How is your wx build?

thanks!

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: Compiling C::B wit wx2.9
« Reply #16 on: March 04, 2013, 10:51:29 pm »
As far as I know the default wxWidgets builld on most (all?) linuxes is not monolithic.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3352
Re: Compiling C::B wit wx2.9
« Reply #17 on: March 12, 2013, 07:23:55 pm »
As far as I know the default wxWidgets builld on most (all?) linuxes is not monolithic.

so this wiki entry is misleading and should be removed (the passage about monolithic build):
http://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Linux#Building_wxWidgets

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: Compiling C::B wit wx2.9
« Reply #18 on: March 12, 2013, 08:00:44 pm »
As far as I know the default wxWidgets builld on most (all?) linuxes is not monolithic.

so this wiki entry is misleading and should be removed (the passage about monolithic build):
http://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Linux#Building_wxWidgets
The wiki is about selfbuild wxWidgets, and it says monolithic seems not to be the default, even if the documentation says so. But the whole wiki article is quiet old, as it refers to 2.8.7 .

What I said (or meant) is, that the default wxWidgets-packages distributed by wxWidgets and by the distros are shared non monolithic builds.
That's why the project files (and the autotools files) explicitely load aui, propgrid and richtext library (if needed).