Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: xunxun on March 01, 2012, 09:20:25 am

Title: gcc4.7 can't build codeblocks
Post by: xunxun on March 01, 2012, 09:20:25 am
Error log

Code
g++.exe -Wall -g -pipe -mthreads -fmessage-length=0 -fexceptions -Winvalid-pch -DHAVE_W32API_H -D__WXMSW__ -DWXUSINGDLL -DcbDEBUG -DCB_PRECOMP -DWX_PRECOMP -DwxUSE_UNICODE -fno-inline -iquote.objs\include -I.objs\include -I. -IF:\MyProject\GUI\wxWidgets\WX_2_8_BRANCH\include -IF:\MyProject\GUI\wxWidgets\WX_2_8_BRANCH\contrib\include -IF:\MyProject\GUI\wxWidgets\WX_2_8_BRANCH\lib\gcc_dll\mswu -Isdk\wxscintilla\include -Isdk\wxpropgrid\include -Iinclude\tinyxml -Iinclude\scripting\include -Iinclude\scripting\squirrel -IE:\build\cb\src\sdk\scripting\squirrel -IE:\build\cb\src -c E:\build\cb\src\sdk\scripting\squirrel\sqvm.cpp -o .objs\sdk\scripting\squirrel\sqvm.o
In file included from include\scripting\squirrel/sqobject.h:5:0,
from include\scripting\squirrel/sqpcheader.h:16,
from E:\build\cb\src\sdk\scripting\squirrel\sqvm.cpp:4:
include\scripting\squirrel/squtils.h: In instantiation of 'sqvector<T>::~sqvector() [with T = int]':
include\scripting\squirrel/sqclosure.h:83:52: required from here
include\scripting\squirrel/squtils.h:38:4: error: 'sq_vm_free' was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
In file included from include\scripting\squirrel/sqpcheader.h:17:0,
from E:\build\cb\src\sdk\scripting\squirrel\sqvm.cpp:4:
include\scripting\squirrel/sqstate.h:142:6: note: 'void sq_vm_free(void*, SQUnsignedInteger)' declared here, later in the translation unit
In file included from include\scripting\squirrel/sqobject.h:5:0,
from include\scripting\squirrel/sqpcheader.h:16,
from E:\build\cb\src\sdk\scripting\squirrel\sqvm.cpp:4:
include\scripting\squirrel/squtils.h: In instantiation of 'void sqvector<T>::_realloc(SQUnsignedInteger) [with T = int; SQUnsignedInteger = unsigned int]':
include\scripting\squirrel/squtils.h:45:4: required from 'void sqvector<T>::resize(SQUnsignedInteger, const T&) [with T = int; SQUnsignedInteger = unsigned int]'
include\scripting\squirrel/squtils.h:27:3: required from 'void sqvector<T>::copy(const sqvector<T>&) [with T = int]'
include\scripting\squirrel/sqclosure.h:97:34: required from here
include\scripting\squirrel/squtils.h:97:3: error: 'sq_vm_realloc' was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
In file included from include\scripting\squirrel/sqpcheader.h:17:0,
from E:\build\cb\src\sdk\scripting\squirrel\sqvm.cpp:4:
include\scripting\squirrel/sqstate.h:141:7: note: 'void* sq_vm_realloc(void*, SQUnsignedInteger, SQUnsignedInteger)' declared here, later in the translation unit
E:\build\cb\src\sdk\scripting\squirrel\sqvm.cpp: In member function 'bool SQVM::Execute(SQObjectPtr&, SQInteger, SQInteger, SQInteger, SQObjectPtr&, SQBool, SQVM::ExecutionType)':
E:\build\cb\src\sdk\scripting\squirrel\sqvm.cpp:1062:1: warning: control reaches end of non-void function [-Wreturn-type]

You can see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52446
http://gcc.gnu.org/gcc-4.7/porting_to.html

This can be temporarily worked around by using -fpermissive
Title: Re: gcc4.7 can't build codeblocks
Post by: oBFusCATed on March 01, 2012, 09:48:19 am
Patches welcome, as non of us is that brave to try to build c::b or wx using this alpha version :)

It seems that you have to reorder some functions...
Title: Re: gcc4.7 can't build codeblocks
Post by: Jenna on March 01, 2012, 10:08:58 am
Patches welcome, as non of us is that brave to try to build c::b or wx using this alpha version :)

It seems that you have to reorder some functions...
Not completely correct.
I will do it, if I find the time, I have gcc 4.7 on my debian-system since several weeks.
Title: Re: gcc4.7 can't build codeblocks
Post by: xunxun on March 01, 2012, 10:19:59 am
I will use -fpermissive before you modify them. :)
Title: Re: gcc4.7 can't build codeblocks
Post by: SharkCZ on April 06, 2012, 03:34:21 pm
I have a patch to fix squirrel (fixed in Fedora squirrel package and also sent to upstream), but I wasn't able to fix the template thing in sqplus.
Title: Re: gcc4.7 can't build codeblocks
Post by: SharkCZ on April 06, 2012, 03:39:15 pm
And I also have a patch that allows building C::B with system provided squirrel library, which would make one less place where distros must fix such issue.
Title: Re: gcc4.7 can't build codeblocks
Post by: Freem on April 08, 2012, 08:42:32 pm
I do know this have nothing related with that problem (because it is related to squirrel), but with the software on which I am currently working on, gcc4.7 was not able to compile wxWidgets 2.9.3, but it was fixed in the trunk, so if someone want to compile it and wxWidgets himself, he could have to compile wxWidgets from trunk version.
Since I guess that C::B have big dependencies on wxWidgets, there might be some other things to fix for people which try to use wxWidgets 2.9

Really, I am not sure this reply will help someone, but...
Title: Re: gcc4.7 can't build codeblocks
Post by: headkase on April 16, 2012, 09:20:25 am
Just wanted to add my experience to this thread:

I'm trying to get the C::B SVN, which at this moment is 7932, to compile on Arch Linux.  Just not having any luck.  Even with -fpermissive it eventually errors out because Arch is *only* gcc 4.7.0.  There are some user-created gcc alternatives in Arch but they all just, well, suck so they aren't a realistic thing to install just to use them to compile C::B.  I'm hoping sooner rather than later that C::B SVN's code is updated so that it can compile under GCC 4.7.0.  Until it does so I'm, so so terribly, stuck using C::B 10.05.

On a related note: 10.05, 2010 May.  Pretty well coming up on two years: is there an expected release date for a new-stable C::B?
Title: Re: gcc4.7 can't build codeblocks
Post by: MortenMacFly on April 16, 2012, 09:28:41 am
I'm hoping sooner rather than later that C::B SVN's code is updated so that it can compile under GCC 4.7.0.  Until it does so I'm, so so terribly, stuck using C::B 10.05.
Why? We offer nightly builds that probably also work on your platform. Did you try?
Title: Re: gcc4.7 can't build codeblocks
Post by: headkase on April 16, 2012, 09:45:32 am
I'm hoping sooner rather than later that C::B SVN's code is updated so that it can compile under GCC 4.7.0.  Until it does so I'm, so so terribly, stuck using C::B 10.05.
Why? We offer nightly builds that probably also work on your platform. Did you try?

I'm using the nightly build for my Windows machine but my x86_64 Arch machine I haven't come across a pre-built binary for it yet.  I know there are .deb files, I've seen them posted in the nightly threads by the gentleman that does that, but my package manager is not apt-get-based - it is pacman.  If there is another pre-built Linux source, other than .deb, then I'd be surely interested to hear about it! ?
Title: Re: gcc4.7 can't build codeblocks
Post by: xunxun on April 16, 2012, 05:56:03 pm
Just wanted to add my experience to this thread:

I'm trying to get the C::B SVN, which at this moment is 7932, to compile on Arch Linux.  Just not having any luck.  Even with -fpermissive it eventually errors out because Arch is *only* gcc 4.7.0.  There are some user-created gcc alternatives in Arch but they all just, well, suck so they aren't a realistic thing to install just to use them to compile C::B.  I'm hoping sooner rather than later that C::B SVN's code is updated so that it can compile under GCC 4.7.0.  Until it does so I'm, so so terribly, stuck using C::B 10.05.

On a related note: 10.05, 2010 May.  Pretty well coming up on two years: is there an expected release date for a new-stable C::B?

-fpermissive can't fix all things (especially in contrib plugins), maybe you can try SharkCZ's patches.

Hope Jens will fix soon.
Title: Re: gcc4.7 can't build codeblocks
Post by: headkase on April 16, 2012, 06:11:03 pm
-fpermissive can't fix all things (especially in contrib plugins), maybe you can try SharkCZ's patches.

Hope Jens will fix soon.

I did try his mempatch but the error is not occurring there, it is occurring in the help plug in.  At least there first - maybe after too if the compilation made it past the help plugin.  The mempatch is not needed for squirrel when you use -fpermissive: compilation passes right by squirrel just complaining.
Title: Re: gcc4.7 can't build codeblocks
Post by: headkase on April 17, 2012, 03:49:19 pm
I was able to get Code::Blocks SVN 7932 to compile with GCC 4.7.0 using this patch:

Here (http://pastie.org/pastes/3781948)

That patch was made by RevenantX and he detailed how to use it, for Arch, Here (https://aur.archlinux.org/packages.php?ID=18493).

I also used the "-fpermissive" compiler flag for the compile.

Awesome. ;)

Edit: I also used ONLY that one patch and the -fpermissive compiler flag.
Title: Re: gcc4.7 can't build codeblocks
Post by: reckless on April 17, 2012, 05:13:32 pm
Heh funny we stumbled on the same bugger  ;D Btw Erase also needs to be this->Erase.
I can build it to but the darn thing crashes :(
Title: Re: gcc4.7 can't build codeblocks
Post by: headkase on April 17, 2012, 05:22:56 pm
Heh funny we stumbled on the same bugger  ;D Btw Erase also needs to be this->Erase.
I can build it to but the darn thing crashes :(

The build I made doesn't crash: it appears to be working just fine.

I used just that patch, it runs, I can compile a project and run it.  I also debugged the project and that worked.  I've compiled a simple console application and an SDL application.  Both have worked for me.
Title: Re: gcc4.7 can't build codeblocks
Post by: reckless on April 17, 2012, 09:14:34 pm
Been having some problems getting 4.7.0 stable on windows atleast good to hear it works on other architectures.
Sources that dont use libstdc++ work ok but those using libstdc++ crash with initialization error 0x000005.
Title: Re: gcc4.7 can't build codeblocks
Post by: xunxun on April 17, 2012, 09:19:46 pm
Been having some problems getting 4.7.0 stable on windows atleast good to hear it works on other architectures.
Sources that dont use libstdc++ work ok but those using libstdc++ crash with initialization error 0x000005.

It's strange.
Can you try -static linker option to make libstdc++ static link?
I haven't come across the problem.
Title: Re: gcc4.7 can't build codeblocks
Post by: headkase on April 17, 2012, 09:55:26 pm
Been having some problems getting 4.7.0 stable on windows atleast good to hear it works on other architectures.
Sources that dont use libstdc++ work ok but those using libstdc++ crash with initialization error 0x000005.


What compiler toolchain are you using on Windows?  I'm using this GCC 4.7.0:

Here (http://code.google.com/p/mingw-builds/downloads/list)

It comes in x86 and x86_64 flavors.  However, x86 will compile to x86_64 and vice-versa.  Which one you download therefore doesn't actually matter other than having one architecture the default.  Using this compiler toolchain on Windows: you have to manually point Code::Blocks at the toolchain executables - they aren't named as C::B expects them to be.

But, I'm not compiling C::B on Windows, I use the Nightlies there, - I'm just asking what toolchain you are using on Windows.

Edit: one thing to notice about those builds: there is no dwarf variant in the newest versions.  They are all sjlj variants.  That is because:

Quote
for windows OS, dwarf is a foreign way to implement the exceptions. It can not work correctly in windows because the implementation of С++ and C(SEH) exceptions in MSVC compiler uses SJLJ. Due to this fact, are introduced subtle bugs coming from the destruction of the stack and throwing/catching of exceptions between dll-modules.
Title: Re: gcc4.7 can't build codeblocks
Post by: xunxun on April 17, 2012, 10:39:12 pm

Edit: one thing to notice about those builds: there is no dwarf variant in the newest versions.  They are all sjlj variants.  That is because:

Quote
for windows OS, dwarf is a foreign way to implement the exceptions. It can not work correctly in windows because the implementation of С++ and C(SEH) exceptions in MSVC compiler uses SJLJ. Due to this fact, are introduced subtle bugs coming from the destruction of the stack and throwing/catching of exceptions between dll-modules.


mingw-build builds use multiple lib (32bit and 64bit), so he ( author is nixman ) must use sjlj to make gcc work.

In general, I like gcc with no multiple lib, so I build dw2 in win32 toolchain (official mingw also use dw2), and build sjlj in win64 toolchain.
Title: Re: gcc4.7 can't build codeblocks
Post by: headkase on April 17, 2012, 10:47:48 pm
mingw-build builds use multiple lib (32bit and 64bit), so he ( author is nixman ) must use sjlj to make gcc work.

In general, I like gcc with no multiple lib, so I build dw2 in win32 toolchain (official mingw also use dw2), and build sjlj in win64 toolchain.

I believe you.  :P ;)  That particular toolchain, the one I linked, is the one I'm using now although because the official MinGW (32 bit only), Here (http://www.mingw.org/), only has GCC 4.6.2 as of this moment.  There is also a 64-bit MinGW: Here (http://mingw-w64.sourceforge.net/) but I've never used that one - just have it bookmarked.  :)
Title: Re: gcc4.7 can't build codeblocks
Post by: reckless on April 18, 2012, 12:16:15 am
Self compiled version used my previous working compiler (4.6.3) to bootstrap it.
I had a feeling something was of with my gcc build but i just tried one from mingw64 site and it also does it :S
Ill have a try with the one you posted. 
Title: Re: gcc4.7 can't build codeblocks
Post by: reckless on April 18, 2012, 12:40:21 am
Ok tried with the version you posted and its the same 0xc000005 error  ??? may i ask which version of wxwidgets you used ? was it 2.9.
I have a bad feeling that its wxwidgets crashing im using 2.8.11 and tried recompiling it with gcc-4.7.0 the built dll also crashes my working C::B so i guess somethings going totally fubar with wx 2.8.
Title: Re: gcc4.7 can't build codeblocks
Post by: headkase on April 18, 2012, 01:05:07 am
Ok tried with the version you posted and its the same 0xc000005 error  ??? may i ask which version of wxwidgets you used ? was it 2.9.
I have a bad feeling that its wxwidgets crashing im using 2.8.11 and tried recompiling it with gcc-4.7.0 the built dll also crashes my working C::B so i guess somethings going totally fubar with wx 2.8.

On my Arch Linux machine: my system-installed version of wxgtk is 2.8.12.

However, inside the C::B source-code folder there are folders for wx items such as wxscintella so I'm not sure where you are getting your wxwidgets from.

On Windows I'm using the prebuilt nightly and that includes a wx .dll file that you just drop into the nightly folder.
Title: Re: gcc4.7 can't build codeblocks
Post by: reckless on April 18, 2012, 05:07:21 pm
i ment specifically if trying to build codeblocks with gcc-4.7.0 on windows :)
example build codeblocks on windows with gcc-4.7.0 using a previously built wxwidgets (compiled with gcc-4.6.x) = crash.
rebuilding wxwidgets + codeblocks with gcc-4.7.0 on windows = crash.
so my thought was that the old 2.8 version of wxwidgets was somehow incompatible with gcc-4.7.0, strange thing it builds just fine but the dll does not work.
i checked it with depends to see if i was missing a dependency but all looks fine. debugging it turns out that it triggers a buffer overflow in malloc but no pointer to where.
this happens with all versions of gcc-4.7.0 even the latest from trunk so something is definatly fubar.
Title: Re: gcc4.7 can't build codeblocks
Post by: headkase on April 18, 2012, 09:33:39 pm
Have you tried to test the wxwidgets .dll on it's own with a minimal test program?  Compile the .dll, compile a small program that uses that dll and just opens a window, maybe makes a few buttons, and waits to close.  That's it.  Once you have wxwidgets working with that test program then try to try it with C::B?

Also, you don't have old wx .dll file(s) sitting in like your C:\Windows folder where they might override anything new you might compile do you?

I see on wxWidgets' download page (http://www.wxwidgets.org/downloads/) that only source is provided for Windows so you'll have to compile it at any rate.

Also, your include folders (for .lib and .h, etc) are set up correctly for wx in your compilation environment?  The includes are not mis-matched, as in you aren't using a .h file from one version and attempting to use the corresponding .dll from another version with that .h file?
Title: Re: gcc4.7 can't build codeblocks
Post by: reckless on April 20, 2012, 04:08:53 am
All setup according to wiki and still a nogo :/ no other wxwidgets dll's on system (depends can show the full path of loaded dll's)
Tried to start over completely but it still crashes. Weirdly enough cb_share_config.exe works but C::B itself crashes.
Title: Re: gcc4.7 can't build codeblocks
Post by: headkase on April 20, 2012, 04:15:20 am
All setup according to wiki and still a nogo :/ no other wxwidgets dll's on system (depends can show the full path of loaded dll's)
Tried to start over completely but it still crashes. Weirdly enough cb_share_config.exe works but C::B itself crashes.

Yeah, sorry then.  I don't really know what to suggest, I was just trying to hit all the obvious ones.. :(
Title: Re: gcc4.7 can't build codeblocks
Post by: reckless on April 20, 2012, 12:50:15 pm
Np all help welcome :) it might be a bug with gcc itself in that case ill report it to the gcc folks.
Title: Re: gcc4.7 can't build codeblocks
Post by: xunxun on April 20, 2012, 01:03:22 pm
Np all help welcome :) it might be a bug with gcc itself in that case ill report it to the gcc folks.

You can report to gcc bugzilla.
Jens don't allow us to discuss the problem here.

Let's return to gcc4.7 patch for cb discuss.
Title: Re: gcc4.7 can't build codeblocks
Post by: stahta01 on April 20, 2012, 01:55:40 pm
Been having some problems getting 4.7.0 stable on windows atleast good to hear it works on other architectures.
Sources that dont use libstdc++ work ok but those using libstdc++ crash with initialization error 0x000005.

It's strange.
Can you try -static linker option to make libstdc++ static link?
I haven't come across the problem.

This nuwen.net build of 4.7 worked for me; I had to do the "-fpermissive" option.

NOTE: No minGW dll was used so, I guess it used static build.

Tim S.

http://nuwen.net/mingw.html (http://nuwen.net/mingw.html)
Title: Re: gcc4.7 can't build codeblocks
Post by: reckless 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.
Title: Re: gcc4.7 can't build codeblocks
Post by: stahta01 on April 23, 2012, 01:33:55 am
EDIT: Found link to patch in this thread http://pastie.org/pastes/3781948 (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.
Title: Re: gcc4.7 can't build codeblocks
Post by: 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.
Title: Re: gcc4.7 can't build codeblocks
Post by: stahta01 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
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
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;
Title: Re: gcc4.7 can't build codeblocks
Post by: headkase on April 25, 2012, 11:27:03 pm
Thank you stahta01, I'll also attach it here for good measure!
Title: Re: gcc4.7 can't build codeblocks
Post by: oBFusCATed on April 25, 2012, 11:33:09 pm
Does this patch work on windows or the help plugin is not compiled there?
Title: Re: gcc4.7 can't build codeblocks
Post by: stahta01 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.
Title: Re: gcc4.7 can't build codeblocks
Post by: headkase 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.
Title: Re: gcc4.7 can't build codeblocks
Post by: 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.
Title: Re: gcc4.7 can't build codeblocks
Post by: headkase 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 (https://aur.archlinux.org/packages.php?ID=18493) for the source of the patch that was posted.  It was contributed by RevenantX so props to him and thanks to the credited source.
Title: Re: gcc4.7 can't build codeblocks
Post by: 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).
Title: Re: gcc4.7 can't build codeblocks
Post by: reckless 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.
Title: Re: gcc4.7 can't build codeblocks
Post by: MortenMacFly 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?
Title: Re: gcc4.7 can't build codeblocks
Post by: xunxun 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
Title: Re: gcc4.7 can't build codeblocks
Post by: reckless 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.
Title: Re: gcc4.7 can't build codeblocks
Post by: MortenMacFly on May 19, 2012, 02:53:49 pm
@ Morten. Only with the patches from here + -fpermissive in the compiler vars.
What patches are left? The help-plugin is up-to-date. Is there something else missing?
Title: Re: gcc4.7 can't build codeblocks
Post by: xunxun on May 19, 2012, 04:28:05 pm
@ Morten. Only with the patches from here + -fpermissive in the compiler vars.
What patches are left? The help-plugin is up-to-date. Is there something else missing?

You can see

http://forums.codeblocks.org/index.php/topic,16039.msg109945.html#msg109945
Title: Re: gcc4.7 can't build codeblocks
Post by: MortenMacFly on May 19, 2012, 04:48:15 pm
http://forums.codeblocks.org/index.php/topic,16039.msg109945.html#msg109945
Thats what I meant with:
The help-plugin is up-to-date.
So this is in SVN already, isn't it? So nothing to do here.
Title: Re: gcc4.7 can't build codeblocks
Post by: reckless on May 20, 2012, 01:20:51 am
patched before trunk update so didnt know. Ok nothing to report then.
Title: Re: gcc4.7 can't build codeblocks
Post by: Jenna on August 07, 2012, 12:31:35 am
-fpermissive can't fix all things (especially in contrib plugins), maybe you can try SharkCZ's patches.

Hope Jens will fix soon.

Long time ago:
After many fixes from killerbot to silent warnings on gcc4.7 and a  pm from him, it looks like I found a solution for the "-fpermissive"-desaster:
Code
commit e70c8a008439072718760876b048deae1ec74c27
Author: Jens Lody <jens@codeblocks.org>
Date:   Mon Aug 6 23:30:49 2012 +0200

    * gcc 4.7 fixes

Index: src/include/scripting/bindings/sc_base_types.h
===================================================================
--- src/include/scripting/bindings/sc_base_types.h
+++ src/include/scripting/bindings/sc_base_types.h
@@ -33,6 +33,7 @@ DECLARE_INSTANCE_TYPE(wxPoint);
 DECLARE_INSTANCE_TYPE(wxSize);
 DECLARE_INSTANCE_TYPE(wxString);

+using SqPlus::GetTypeName;
 // C::B primitives and types
 DECLARE_INSTANCE_TYPE(ConfigManager);
 DECLARE_INSTANCE_TYPE(EditorManager);
@@ -59,6 +60,7 @@ namespace SqPlus \
     inline T Get(TypeWrapper<T>,HSQUIRRELVM v,int idx) { SQInteger i; SQPLUS_CHECK_GET(sq_getinteger(v,idx,&i)); return (T)i; } \
 }

+using SqPlus::Push;
 DECLARE_ENUM_TYPE(wxPathFormat);
 DECLARE_ENUM_TYPE(wxPathNormalize);
 DECLARE_ENUM_TYPE(PrintColourMode);
Index: src/plugins/contrib/codesnippets/codesnippets.cpp
===================================================================
--- src/plugins/contrib/codesnippets/codesnippets.cpp
+++ src/plugins/contrib/codesnippets/codesnippets.cpp
@@ -93,7 +93,6 @@ CodeSnippets::CodeSnippets()
     m_bMouseLeftKeyDown = false;
     m_bMouseIsDragging = false;
     m_bDragCursorOn = false;
-    m_pDragCursor = false;
     m_MouseDownX = m_MouseDownY = 0;
     m_MouseUpX = m_MouseUpY = 0;
     #if !wxCHECK_VERSION(2, 8, 12)
Index: src/plugins/contrib/help_plugin/defs.h
===================================================================
--- src/plugins/contrib/help_plugin/defs.h
+++ src/plugins/contrib/help_plugin/defs.h
@@ -297,7 +297,7 @@ class QMap : public std::map<Key, T>

         int remove(const Key &k)
         {
-            return erase(k);
+            return this->erase(k);
         }
 };

Index: src/plugins/debuggergdb/gdb_driver.cpp
===================================================================
--- src/plugins/debuggergdb/gdb_driver.cpp
+++ src/plugins/debuggergdb/gdb_driver.cpp
@@ -82,6 +82,7 @@ static wxRegEx reInferiorExited2(wxT("^\\[[Ii]nferior[ \\t].+[ \\t]exited[ \\t]w
                                  wxRE_EXTENDED);

 // scripting support
+using SqPlus::Push;
 DECLARE_INSTANCE_TYPE(GDB_driver);

 GDB_driver::GDB_driver(DebuggerGDB* plugin)


Any feedback welcome!
Title: Re: gcc4.7 can't build codeblocks
Post by: MortenMacFly on August 07, 2012, 06:33:51 am
After many fixes from killerbot to silent warnings on gcc4.7 and a  pm from him, it looks like I found a solution for the "-fpermissive"-desaster:
Is this the same you posted in the other thread?
Title: Re: gcc4.7 can't build codeblocks
Post by: Jenna on August 07, 2012, 07:38:01 am
After many fixes from killerbot to silent warnings on gcc4.7 and a  pm from him, it looks like I found a solution for the "-fpermissive"-desaster:
Is this the same you posted in the other thread?
Yes, but this one is for the public to test it.

It works fine here on fedora 64-bit and gcc4.7, but I did not test it on other platforms and with older compilers.
I don't think it can break anything, just want to be sure, before committing it.
Title: Re: gcc4.7 can't build codeblocks
Post by: killerbot on August 07, 2012, 07:47:17 am
see my comment in the other thread

EDIT : which not everyone can see :
duplicating here :

works fine for me too, however I would change one thing to the patch:

you just removed :     m_pDragCursor = false;

Now the member is not init-ed ==>

Code
    m_pDragCursor = 0;
Title: Re: gcc4.7 can't build codeblocks
Post by: Jenna on August 07, 2012, 08:05:04 am
you just removed :     m_pDragCursor = false;

Now the member is not init-ed ==>

Code
    m_pDragCursor = 0;


It was initialised at the end of the constructor anyway (that's why I just removed the wrong initialisation):
Code
    m_pDragCursor = new wxCursor(wxCURSOR_HAND);
To be sure it's 0 in case of a not working initialisation, we can preset it to 0.
Title: Re: gcc4.7 can't build codeblocks
Post by: killerbot on August 07, 2012, 08:20:09 am
no you are absolutely correct, no need to set it. I overlooked that line.

And to be really nice : all of them could have been done in the initializer list :-)
But that's another story.

Let's give people time to object to the patch till this evening ?
Title: Re: gcc4.7 can't build codeblocks
Post by: Jenna on August 07, 2012, 08:38:35 am
And to be really nice : all of them could have been done in the initializer list :-)
But that's another story.
And we could do this in many places I guess.

Let's give people time to object to the patch till this evening ?
Yes, and I will try to compile it with an older gcc (4.2 if I remember correctly 4.4, I do not use my windows installation on my laptop often) on windows.
Title: Re: gcc4.7 can't build codeblocks
Post by: Alpha on August 07, 2012, 03:20:02 pm
Patch builds and runs with no apparent issues (GCC 4.6, Windows XP).
Title: Re: gcc4.7 can't build codeblocks
Post by: Jenna on August 08, 2012, 08:33:56 am
I committed at to trunk last evening  (svn r8206).
C::B should compile without -fpermissive now.
Title: Re: gcc4.7 can't build codeblocks
Post by: MortenMacFly on August 08, 2012, 08:54:34 am
C::B should compile without -fpermissive now.
Cools stuff. Now all thats needed on windows is a stable GCC 4.7.x compiler... :-)

Maybe we should nag TDM all together... Harhar...
Title: Re: gcc4.7 can't build codeblocks
Post by: killerbot on August 08, 2012, 11:12:33 am
I already kindly did last week  8)
Maybe we should send him some nice beers ...