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

Offline MortenMacFly

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

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

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: gcc4.7 can't build codeblocks
« Reply #47 on: May 19, 2012, 04:48:15 pm »
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 reckless

  • Regular
  • ***
  • Posts: 338
Re: gcc4.7 can't build codeblocks
« Reply #48 on: May 20, 2012, 01:20:51 am »
patched before trunk update so didnt know. Ok nothing to report then.

Offline Jenna

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

Offline MortenMacFly

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

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

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Re: gcc4.7 can't build codeblocks
« Reply #52 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;
« Last Edit: August 07, 2012, 07:53:07 am by killerbot »

Offline Jenna

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

Offline killerbot

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

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: gcc4.7 can't build codeblocks
« Reply #55 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.
« Last Edit: August 07, 2012, 08:57:33 am by jens »

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: gcc4.7 can't build codeblocks
« Reply #56 on: August 07, 2012, 03:20:02 pm »
Patch builds and runs with no apparent issues (GCC 4.6, Windows XP).

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: gcc4.7 can't build codeblocks
« Reply #57 on: August 08, 2012, 08:33:56 am »
I committed at to trunk last evening  (svn r8206).
C::B should compile without -fpermissive now.

Offline MortenMacFly

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

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Re: gcc4.7 can't build codeblocks
« Reply #59 on: August 08, 2012, 11:12:33 am »
I already kindly did last week  8)
Maybe we should send him some nice beers ...