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

Offline xunxun

  • Almost regular
  • **
  • Posts: 187
gcc4.7 can't build codeblocks
« 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
Regards,
xunxun

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: gcc4.7 can't build codeblocks
« Reply #1 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...
(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 Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: gcc4.7 can't build codeblocks
« Reply #2 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.

Offline xunxun

  • Almost regular
  • **
  • Posts: 187
Re: gcc4.7 can't build codeblocks
« Reply #3 on: March 01, 2012, 10:19:59 am »
I will use -fpermissive before you modify them. :)
Regards,
xunxun

Offline SharkCZ

  • Almost regular
  • **
  • Posts: 131
Re: gcc4.7 can't build codeblocks
« Reply #4 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.
Code::Blocks package maintainer for Fedora and EPEL

Offline SharkCZ

  • Almost regular
  • **
  • Posts: 131
Re: gcc4.7 can't build codeblocks
« Reply #5 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.
Code::Blocks package maintainer for Fedora and EPEL

Offline Freem

  • Almost regular
  • **
  • Posts: 219
Re: gcc4.7 can't build codeblocks
« Reply #6 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...

Offline headkase

  • Almost regular
  • **
  • Posts: 159
Re: gcc4.7 can't build codeblocks
« Reply #7 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?

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: gcc4.7 can't build codeblocks
« Reply #8 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?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline headkase

  • Almost regular
  • **
  • Posts: 159
Re: gcc4.7 can't build codeblocks
« Reply #9 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! ?

Offline xunxun

  • Almost regular
  • **
  • Posts: 187
Re: gcc4.7 can't build codeblocks
« Reply #10 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.
Regards,
xunxun

Offline headkase

  • Almost regular
  • **
  • Posts: 159
Re: gcc4.7 can't build codeblocks
« Reply #11 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.

Offline headkase

  • Almost regular
  • **
  • Posts: 159
Re: gcc4.7 can't build codeblocks
« Reply #12 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

That patch was made by RevenantX and he detailed how to use it, for Arch, Here.

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

Awesome. ;)

Edit: I also used ONLY that one patch and the -fpermissive compiler flag.
« Last Edit: April 17, 2012, 04:39:46 pm by headkase »

Offline reckless

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

Offline headkase

  • Almost regular
  • **
  • Posts: 159
Re: gcc4.7 can't build codeblocks
« Reply #14 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.
« Last Edit: April 17, 2012, 05:24:33 pm by headkase »