Author Topic: wxSmithAui fails to compile  (Read 5166 times)

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1564
wxSmithAui fails to compile
« on: April 29, 2016, 02:29:30 pm »
Revision 10832 broke compilation of wxSmithAui.cbp on Windows: the removing of -std=gnu++11 makes TDM signal an error about strdup (and others) not found in buffer.h (from wxWidgets 2.8).

If I add again the option compilation ends successfully.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7592
    • My Best Post
Re: wxSmithAui fails to compile
« Reply #1 on: April 29, 2016, 04:19:29 pm »
GCC Compiler version is likely needed to confirm the error.

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 Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1564
Re: wxSmithAui fails to compile
« Reply #2 on: April 29, 2016, 04:30:06 pm »
gcc version 5.1.0 (tdm-1) on Windows XP sp3, 32 bits

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7592
    • My Best Post
Re: wxSmithAui fails to compile
« Reply #3 on: April 29, 2016, 06:50:55 pm »
gcc version 5.1.0 (tdm-1) on Windows XP sp3, 32 bits

I will try to duplicate the issue later today on Windows 7 using gcc version 5.1.0 (tdm-1) .
And, post a patch that I will test on Debian Linux; IIRC,  wxSmithAui is both an Windows and Linux project; so the changes need tested on both.

Currently doing Linux stuff; so, will have to finish that before re-booting to Windows 7.

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: 7592
    • My Best Post
Re: wxSmithAui fails to compile
« Reply #4 on: April 29, 2016, 11:09:35 pm »
I have confirmed the problem on Windows 7 64 bit Using TDM GCC 5.1.0 32 bit mingw.org version.

Note: I will add the patch to this post when I confirm it works on Windows; will NOT have time to test on Linux today.

This worked on Windows will need to confirm it causes no issues on Linux.
Code
diff --git a/src/plugins/contrib/wxSmithAui/wxSmithAui.cbp b/src/plugins/contrib/wxSmithAui/wxSmithAui.cbp
index 20f7a41..24b150f 100644
--- a/src/plugins/contrib/wxSmithAui/wxSmithAui.cbp
+++ b/src/plugins/contrib/wxSmithAui/wxSmithAui.cbp
@@ -48,6 +48,7 @@
                                        <Add option="-fmessage-length=0" />
                                        <Add option="-fexceptions" />
                                        <Add option="-Winvalid-pch" />
+                                       <Add option="-std=gnu++11" />
                                        <Add option="-DHAVE_W32API_H" />
                                        <Add option="-D__WXMSW__" />
                                        <Add directory="$(#wx.include)" />

Tim S.
« Last Edit: April 29, 2016, 11:28:30 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 oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: wxSmithAui fails to compile
« Reply #5 on: May 01, 2016, 07:33:21 pm »
mgimenez: There is no way that breakage has been introduced with rev 10832 - it has affected only the unix project and not the windows ones. I guess we've forgotten to add the -std=gnu++11 flag for this project, so the stahta01 patch should be correct.
(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 Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1564
Re: wxSmithAui fails to compile
« Reply #6 on: May 03, 2016, 02:39:40 pm »
mgimenez: There is no way that breakage has been introduced with rev 10832 - it has affected only the unix project and not the windows ones. I guess we've forgotten to add the -std=gnu++11 flag for this project, so the stahta01 patch should be correct.

wxSmithAui.cbp is included in the Codeblocks.workspace file and in Codeblocks-unix.workspace, so it's common to both versions and a change in the unix version affects the windows version (as they are the same file).

Revision 10832 does change wxSmithAui.cbp and removes the -std=gnu++11 option, as you can see below:

Code
--- a/trunk/src/plugins/contrib/wxSmithAui/wxSmithAui.cbp
+++ b/trunk/src/plugins/contrib/wxSmithAui/wxSmithAui.cbp
@@ -17,7 +17,6 @@
  <Option host_application="../../../devel/codeblocks" />
  <Option run_host_application_in_terminal="0" />
  <Compiler>
- <Add option="-ansi" />
  <Add option="`wx-config --version=2.8 --cflags`" />
  <Add option="-Winvalid-pch" />
  <Add option="-fexceptions" />
@@ -85,7 +84,6 @@
  <Add option="-DCB_PRECOMP" />
  <Add option="-DWX_PRECOMP" />
  <Add option="-std=c++11" />
- <Add option="-std=gnu++11" />
  <Add directory="../../../include" />
  <Add directory="../../../sdk/wxscintilla/include" />
  <Add directory="../../../sdk/wxpropgrid/include" />
« Last Edit: May 03, 2016, 07:35:10 pm by mgimenez »

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: wxSmithAui fails to compile
« Reply #7 on: May 03, 2016, 06:56:15 pm »
You are right: I changed it for the whole project, but we have to distinguish between Windows and Unix/Mac here.

Can you please test the latest trunk (if possible).
It should fix this issue.

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1564
Re: wxSmithAui fails to compile
« Reply #8 on: May 03, 2016, 07:36:03 pm »
It compiles OK again on Windows, thanks.