Author Topic: Codeblocks contrib plugins for wx31 fails to compile with mingw v8.1.0  (Read 1803 times)

Offline ouch

  • Almost regular
  • **
  • Posts: 221
Just tried compiling on win 7 64bit with the 32 bit version of mingw. I have tried both versions of mingw 7.1 and mingw 8.1 and they both fail at the same place below:

Code: [Select]
i686-w64-mingw32-g++.exe -shared  -Wl,--out-implib=..\..\..\devel31\libwxflatnotebook.a -Wl,--dll -LC:\Programming\wxWidgets\wxWidgets\lib\gcc_dll ..\..\..\.objs31\plugins\contrib\wxContribItems\wxFlatNotebook\wxFlatNotebook\src\wxFlatNotebook\fnb_customize_dlg.o ..\..\..\.objs31\plugins\contrib\wxContribItems\wxFlatNotebook\wxFlatNotebook\src\wxFlatNotebook\fnb_resources.o ..\..\..\.objs31\plugins\contrib\wxContribItems\wxFlatNotebook\wxFlatNotebook\src\wxFlatNotebook\popup_dlg.o ..\..\..\.objs31\plugins\contrib\wxContribItems\wxFlatNotebook\wxFlatNotebook\src\wxFlatNotebook\renderer.o ..\..\..\.objs31\plugins\contrib\wxContribItems\wxFlatNotebook\wxFlatNotebook\src\wxFlatNotebook\wxFlatNotebook.o ..\..\..\.objs31\plugins\contrib\wxContribItems\wxFlatNotebook\wxFlatNotebook\src\wxFlatNotebook\xh_fnb.o  -o ..\..\..\devel31\wxflatnotebook.dll -Wl,--enable-auto-import -mthreads  -lwxmsw31u
In file included from C:\Programming\wxWidgets\wxWidgets\include/wx/arrstr.h:16,
                 from C:\Programming\wxWidgets\wxWidgets\include/wx/filefn.h:15,
                 from C:\Programming\wxWidgets\wxWidgets\include/wx/utils.h:20,
                 from C:\Programming\wxWidgets\wxWidgets\include/wx/cursor.h:75,
                 from C:\Programming\wxWidgets\wxWidgets\include/wx/event.h:21,
                 from C:\Programming\wxWidgets\wxWidgets\include/wx/window.h:18,
                 from C:\Programming\wxWidgets\wxWidgets\include/wx/control.h:22,
                 from C:\Programming\wxWidgets\wxWidgets\include/wx/statline.h:23,
                 from wxFlatNotebook\include/wx/wxFlatNotebook/fnb_customize_dlg.h:14,
                 from C:\Programming\codeblocks\src\plugins\contrib\wxContribItems\wxFlatNotebook\src\wxFlatNotebook\fnb_customize_dlg.cpp:10:
wxFlatNotebook\include/wx/wxFlatNotebook/wxFlatNotebook.h:58:43: error: expected ')' before '*' token
 WX_DECLARE_USER_EXPORTED_OBJARRAY(wxWindow*, wxWindowPtrArray, WXDLLIMPEXP_FNB);
                                           ^

edit: Fixed typo in subject.
« Last Edit: June 12, 2018, 08:18:28 pm by ouch »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6319
    • My Best Post
Just tried compiling on win 7 64bit with the 32 bit version of mingw. I have tried both versions of mingw 7.1 and mingw 8.1 and they both fail at the same place below:

Post link to at least one compiler installer that fails with build error.

Edit: Also, post the wxWidgets version information.

Tim S.
« Last Edit: June 12, 2018, 06:41:51 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline BlueHazzard

  • Lives here!
  • ****
  • Posts: 2028
Does this wxWidgets version work with an other compiler?

Offline ouch

  • Almost regular
  • **
  • Posts: 221
The wxWidgets I used was the trunk version that was just updated today before building. ( last revision was 71bb680 )

and the mingw version I used was their installer:

https://mingw-w64.org/doku.php/download

Specifically:

https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/installer/mingw-w64-install.exe/download

and yes the wxWidgets version I'm using seems to work fine with my software that I wrote.
« Last Edit: June 12, 2018, 07:04:19 pm by ouch »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6319
    • My Best Post
Downloading the win32-sjlj version of Mingw64 gcc 8.1.0; Edited typo in GCC version number.

It will take several hours to build wxWidgets and then build Code::Blocks.

Note: My guess is that the wxWidgets changed an header file; and, the fix is the include a header in Code::Blocks source code.

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

Offline ouch

  • Almost regular
  • **
  • Posts: 221
If you want I could upload my libs to google drive or something.

My compiler has the following selection: i686-8.1.0-posix-sjlj-rt_v6-rev0

edit: it's uploading now. You just nee the mono DLL release and debug builds right?
« Last Edit: June 12, 2018, 08:13:42 pm by ouch »

Offline BlueHazzard

  • Lives here!
  • ****
  • Posts: 2028
and yes the wxWidgets version I'm using seems to work fine with my software that I wrote.

I meant if codeblocks builds with a other compiler but the same wx version. Because i think this is a wx issue and not a compiler issue...

Offline ouch

  • Almost regular
  • **
  • Posts: 221
That I don't know. I was using mingw 7.1 and an old trunk release of wxWidgets. Which doesn't help much.

I originally had this error trying to compile codeblocks with mingw 7.1 and the new updated trunk build of wxWidgets. I then updated mingw to 8.1 hoping to fix the issue only to get the same message. So it very well could be a wxWidgets issue.

And for whatever reason google drive won't let me upload that file. It gets stuck on "finishing upload" I've uploaded it 3 times with the same result. :(

also, my shift is done, so I won't have access to this computer again until thursday.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6319
    • My Best Post
Does not seem to be a missing wxWidgets header include problem.

I did confirm the problem with wxWidgets recent git master and Mingw64 32 bit GCC 8.1.0 compiler.
Now building with an GCC 6.4.0 and wxWidgets recent git master to see if wxWidgets or compiler was the trigger of the issue.

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

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6319
    • My Best Post
Starting on Date: 5/31/2018 there was many changes to WX_DECLARE_USER_EXPORTED_OBJARRAY [header file] I think the changes resulted in only classnames being supported instead of pointers to classnames. This is theory I have done nothing to confirm it.

Edit: I have stopped work on this and I am going with the likely problem is in Code::Blocks source code; and, it is beyond me to either fix or definitely confirm that C::B wxContrib code is the real problem.

Tim S.
« Last Edit: June 13, 2018, 03:27:10 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Miguel Gimenez

  • Almost regular
  • **
  • Posts: 128
These are the changes mentioned by stahta01. The original macro definition was

Code: [Select]
#define WX_DECLARE_OBJARRAY_WITH_DECL(T, name, decl) \
    typedef T _wxObjArray##name;                            \
    _WX_DECLARE_OBJARRAY(_wxObjArray##name, name, wxArrayPtrVoid, decl)

and the current is

Code: [Select]
#define WX_DECLARE_OBJARRAY_WITH_DECL(T, name, classdecl)                     \
    classdecl wxObjectArrayTraitsFor##name                                    \
    {                                                                         \
    public:                                                                   \
        static T* Clone(const T& item);                                       \
        static void Free(T* p);                                               \
    };                                                                        \
    typedef wxBaseObjectArray<T, wxObjectArrayTraitsFor##name>                \
        wxBaseObjectArrayFor##name;                                           \
    typedef int (wxCMPFUNC_CONV *CMPFUNC##T)(T **pItem1, T **pItem2);         \
    classdecl name : public wxBaseObjectArrayFor##name                        \
    {                                                                         \
    public:                                                                   \
        name() : wxBaseObjectArrayFor##name() { }                             \
        name(const name& src) : wxBaseObjectArrayFor##name(src) { }           \
    }

but this comment in wxWidgets docs (see http://docs.wxwidgets.org/trunk/dynarray_8h.html#a015654ccb706038e60295cc202679be3)

Quote
// note: not "MyClass *"!

suggests that

Code: [Select]
WX_DECLARE_USER_EXPORTED_OBJARRAY(wxWindow*, wxWindowPtrArray, WXDLLIMPEXP_FNB);
is incorrect. The original macro definition was tolerant, but the new is not.

Offline gd_on

  • Regular
  • ***
  • Posts: 416
Just to add some informations.
I tried to compile wxwidgets 3.1.1 and codeblocks svn 11416 with mingw 64 bits 7.3 (I used x86_64-7.3.0-release-posix-seh-rt_v5-rev0.7z, but I'm not sure if it's the best choice !). It's OK.
With x86_64-8.1.0-release-posix-seh-rt_v6-rev0.7z, wxwidgets 3.1.1 compilation fails with problems decribed above (WX_DECLARE...), so no way to compile C::B.
gd_on
Windows 10 or 7, svn C::B (last version or almost!), WxWidgets 2.8.12, Compilers TDM 4.9.2 32 bits (gcc and gfortran installed in C:\MinGW32). Tests with C::B 64 bits and WxWidgets 2.8.12 or 3.1.1 (64 bits) compiled by TDM 4.9.2 in C:\MinGW64

Offline Miguel Gimenez

  • Almost regular
  • **
  • Posts: 128
This patch solves the issue with Windows 7, wxWidgets-master, CB trunk, GCC 7.2.0, 32 bits.

If somebody tests it successfully in another environment (p.e. GCC 8 ) I will post a ticket with the patch in SF.
« Last Edit: June 13, 2018, 01:59:26 pm by Miguel Gimenez »

Offline ouch

  • Almost regular
  • **
  • Posts: 221
Codeblocks Trunk: 11416

wxWidgets trunk: 1adc3ba

MingW64: i686-8.1.0-posix-sjlj-rt_v6-rev0

On windows 7 64bit home edition.

I can confirm that patch allows it to compile, And upon testing Codeblocks opens up and I'm able to edit files.

So I would say it looks like this fixes it.

Thanks Miguel Gimenez!

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6319
    • My Best Post
To be [more] sure it is safe the Lib Finder plugin needs to be tested.

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