News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

gcc4.7 can't build codeblocks

Started by xunxun, March 01, 2012, 09:20:25 AM

Previous topic - Next topic

reckless

Ill give it a go thanks :)
Note allready linking libstdc++ static.
Besides the initialization problem it builds just fine.

stahta01

#31
EDIT: Found link to patch in this thread http://pastie.org/pastes/3781948

I will try it and see if it is all that is needed for Windows Build fix.
EDit2: It fixed it for the Windows Build of contrib help plugin.

Has anyone gotten the contrib help plugin to build?

It did not compile without errors even after I added the "-fpermissive" option to it.


The other  contrib plugins compiled successfully.

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]

headkase

Did anyone save that pastie help_plugin.patch?  Pastie is dead.  Their pansy host pulled the plug on them.

stahta01

#33
Quote from: headkase on April 25, 2012, 08:35:05 AM
Did anyone save that pastie help_plugin.patch?  Pastie is dead.  Their pansy host pulled the plug on them.



Index: src/plugins/contrib/help_plugin/man2html.cpp
===================================================================
--- src/plugins/contrib/help_plugin/man2html.cpp (revision 7939)
+++ src/plugins/contrib/help_plugin/man2html.cpp (working copy)
@@ -123,7 +123,7 @@

#include <ctype.h>

-//#include <unistd.h>
+#include <unistd.h>
#include <string.h>

#include <stdio.h>



Index: src/plugins/contrib/help_plugin/defs.h
===================================================================
--- src/plugins/contrib/help_plugin/defs.h (revision 7939)
+++ src/plugins/contrib/help_plugin/defs.h (working copy)
@@ -289,7 +289,7 @@

            if (i.second == false && overwrite)
            {
-                find(k)->second = t;
+                this->find(k)->second = t;
            }

            return i.first;
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]

headkase

Thank you stahta01, I'll also attach it here for good measure!

oBFusCATed

Does this patch work on windows or the help plugin is not compiled there?
(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!]

stahta01

#36
Quote from: oBFusCATed on April 25, 2012, 11:33:09 PM
Does this patch work on windows or the help plugin is not compiled there?

It fixes the compile errors under windows (on the help plugin) that are left after the "-fpermissive" option is used.

Tested with un-official MinGW (nuwen.net) GCC version 4.7 under windows 7 32 bit wxWidgets 2.8 branch.

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]

headkase

#37
Just wanted to add: I just compiled Code::Blocks SVN 7943 under Arch Linux x86_64 using the attached help_plugin_fix.patch and the "-fpermissive" compiler option with GCC 4.7.0.  It appears to be working fine.

Edit: removed attachment.

oBFusCATed

In svn...

@headkase: Why are you adding the patch for every post? Keep in mind that the disk space for the forum is limited and attachments get deleted from time to time. So please don't abuse the attach feature of the forum.
(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!]

headkase

#39
Quote from: oBFusCATed on April 26, 2012, 01:13:32 AM
In svn...

@headkase: Why are you adding the patch for every post? Keep in mind that the disk space for the forum is limited and attachments get deleted from time to time. So please don't abuse the attach feature of the forum.

Ok, sorry, didn't realize that.  Was just being a bit paranoid when the patch was lost for a bit with pastie.

Edit: I see SVN is now up to 7944.  Compiling now with just "-fpermissive", when the compile is done in about 20 minutes will post if it succeeded or not.

Edit2: Code::Blocks SVN 7944 built successfully, in Arch Linux x86_64,  under GCC 4.7.0 using only the "-fpermissive" compiler flag.  Thank you very much oBFusCATed! :)

See: Here for the source of the patch that was posted.  It was contributed by RevenantX so props to him and thanks to the credited source.

reckless

Finally i got it working :)

Gcc-4.7.0 can be bootstrapped with

--disable-build-poststage1-with-cxx \
--disable-build-with-cxx \

For the libstdc++ problem you need to recompile binutils and mingw-w64 api.
use --enable-threads=posix and suddenly it worked  ??? damnest thing is all executables now need libwinpthread-0.dll (im gonna try if i can link it in statically).

reckless

Just a heads up.
Got gcc 4.7.0 to work with win32 threads again and i rebuilt the trunk version of CodeBlocks with it, and it works it seems.
I can upload the 4.7.0 build CodeBlocks if someone wants to test it.

MortenMacFly

Quote from: reckless on May 18, 2012, 08:16:09 AM
Got gcc 4.7.0 to work with win32 threads again and i rebuilt the trunk version of CodeBlocks with it, and it works it seems.
The question is: Did you need to patch C::B to make it compile or not?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

xunxun

Quote from: reckless on May 14, 2012, 06:52:23 AM
Finally i got it working :)

Gcc-4.7.0 can be bootstrapped with

--disable-build-poststage1-with-cxx \
--disable-build-with-cxx \

For the libstdc++ problem you need to recompile binutils and mingw-w64 api.
use --enable-threads=posix and suddenly it worked  ??? damnest thing is all executables now need libwinpthread-0.dll (im gonna try if i can link it in statically).

Don't know why you add
--disable-build-poststage1-with-cxx \
--disable-build-with-cxx \

Another thing, when you use --enable-threads=posix and winpthread, I suggest you to use gcc static edition, because someone found that shared edition is not normal when using some std:thread
Regards,
xunxun

reckless

@ Morten. Only with the patches from here + -fpermissive in the compiler vars.
@ Xunxun. Dont need pthreads anymore i got i working with win32 threads. Only need --disable-build-poststage1-with-cxx because g++ seems to have a bug with its system header composition (older versions of gcc used gcc for bootstrapping everything, 4.7.0 uses g++ from stage2 and forward). But agree if using --enable-threads=posix and winpthread static might be the better choice.