Author Topic: gcc4.7 can't build codeblocks  (Read 17816 times)

Offline reckless

  • Regular
  • ***
  • Posts: 303
Re: gcc4.7 can't build codeblocks
« Reply #30 on: April 20, 2012, 06:58:43 pm »
Ill give it a go thanks :)
Note allready linking libstdc++ static.
Besides the initialization problem it builds just fine.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 4474
    • My Best Post
Re: gcc4.7 can't build codeblocks
« Reply #31 on: April 23, 2012, 01:33:55 am »
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.
« Last Edit: April 23, 2012, 02:58:59 am by stahta01 »
C Programmer working to learn more about C++.
Compiling CB Trunk against wxWidgets WX_3_0_BRANCH branch.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org/index.php?title=Main_Page

Offline headkase

  • Advanced newcomer
  • *
  • Posts: 53
Re: gcc4.7 can't build codeblocks
« Reply #32 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.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 4474
    • My Best Post
Re: gcc4.7 can't build codeblocks
« Reply #33 on: April 25, 2012, 01:27:41 pm »
Did anyone save that pastie help_plugin.patch?  Pastie is dead.  Their pansy host pulled the plug on them.


Code: [Select]
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>

Code: [Select]
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;
« Last Edit: April 25, 2012, 01:29:14 pm by stahta01 »
C Programmer working to learn more about C++.
Compiling CB Trunk against wxWidgets WX_3_0_BRANCH branch.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org/index.php?title=Main_Page

Offline headkase

  • Advanced newcomer
  • *
  • Posts: 53
Re: gcc4.7 can't build codeblocks
« Reply #34 on: April 25, 2012, 11:27:03 pm »
Thank you stahta01, I'll also attach it here for good measure!

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 7788
Re: gcc4.7 can't build codeblocks
« Reply #35 on: April 25, 2012, 11:33:09 pm »
Does this patch work on windows or the help plugin is not compiled there?
<debugger plugin maintainer>
(most of the time I ignore long posts)

Offline stahta01

  • Lives here!
  • ****
  • Posts: 4474
    • My Best Post
Re: gcc4.7 can't build codeblocks
« Reply #36 on: April 26, 2012, 12:00:42 am »
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.
« Last Edit: April 26, 2012, 12:02:27 am by stahta01 »
C Programmer working to learn more about C++.
Compiling CB Trunk against wxWidgets WX_3_0_BRANCH branch.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org/index.php?title=Main_Page

Offline headkase

  • Advanced newcomer
  • *
  • Posts: 53
Re: gcc4.7 can't build codeblocks
« Reply #37 on: April 26, 2012, 12:25:39 am »
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.
« Last Edit: April 26, 2012, 01:37:53 am by headkase »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 7788
Re: gcc4.7 can't build codeblocks
« Reply #38 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.
<debugger plugin maintainer>
(most of the time I ignore long posts)

Offline headkase

  • Advanced newcomer
  • *
  • Posts: 53
Re: gcc4.7 can't build codeblocks
« Reply #39 on: April 26, 2012, 01:28:56 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.
« Last Edit: April 26, 2012, 02:40:31 am by headkase »

Offline reckless

  • Regular
  • ***
  • Posts: 303
Re: gcc4.7 can't build codeblocks
« Reply #40 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).

Offline reckless

  • Regular
  • ***
  • Posts: 303
Re: gcc4.7 can't build codeblocks
« Reply #41 on: May 18, 2012, 08:16:09 am »
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.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 8695
Re: gcc4.7 can't build codeblocks
« Reply #42 on: May 18, 2012, 01:28:45 pm »
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: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline xunxun

  • Almost regular
  • **
  • Posts: 187
Re: gcc4.7 can't build codeblocks
« Reply #43 on: May 18, 2012, 03:46:22 pm »
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

Offline reckless

  • Regular
  • ***
  • Posts: 303
Re: gcc4.7 can't build codeblocks
« Reply #44 on: May 19, 2012, 09:44:14 am »
@ 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.