News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

wxSmithAui fails to compile

Started by Miguel Gimenez, April 29, 2016, 02:29:30 PM

Previous topic - Next topic

Miguel Gimenez

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.

stahta01

GCC Compiler version is likely needed to confirm the error.

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

Miguel Gimenez

gcc version 5.1.0 (tdm-1) on Windows XP sp3, 32 bits

stahta01

Quote from: mgimenez on April 29, 2016, 04:30:06 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++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

stahta01

#4
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.

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.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

oBFusCATed

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!]

Miguel Gimenez

#6
Quote from: oBFusCATed 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.

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:


--- 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" />

Jenna

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.

Miguel Gimenez

It compiles OK again on Windows, thanks.