Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: billyonthemountain on November 25, 2009, 01:32:21 pm

Title: Building Code::Blocks on Win 64
Post by: billyonthemountain on November 25, 2009, 01:32:21 pm
Hello everyone,

Trying to build code:blocks using the Mingw64/msys based WPG-System64 (http://www.cadforte.com/system64.html) build environmental on Windows 7 64-bits, I get the same error as pointed out in this thread (http://forums.codeblocks.org/index.php/topic,7321.0.html) (this one was on Linux) ie.
Code
||=== Code::Blocks, AutoRevision ===|
||warning: auto-importing has been activated without --enable-auto-import specified on the command line.|
||=== Code::Blocks, Squirrel ===|
include\scripting\squirrel\sqtable.h||In function 'SQHash HashObj(const SQObjectPtr&)':|
include\scripting\squirrel\sqtable.h|21|erreur: cast from 'SQRefCounted*' to 'SQInteger' loses precision|
||=== Build finished: 1 errors, 1 warnings ===|

Defining  _SQ64 doesn't help. I guess this won't be the only problem I will encounter, so I was wondering if anyone had experience in building code::blocks in a native 64-bits environment on Windows.

Thanks in advance for any advice

Regards, Billy
Title: Re: Building Code::Blocks on Win 64
Post by: stahta01 on November 25, 2009, 02:43:19 pm
I tried and gave up.

Note, you must use wxWidgets 2.9 for 64 bit; since wxWidgets 2.8 has 64 bit windows issues.

Plan to try again; once TDM makes a MinGW 64 Bit dev package
http://www.tdragon.net/recentgcc/

Tim S.
Title: Re: Building Code::Blocks on Win 64
Post by: Halan on November 28, 2009, 03:35:06 pm
Little bit off topic. Will the nightly builds at some point switch to 2.9 or do you wait until 3.0 is released?
Title: Re: Building Code::Blocks on Win 64
Post by: stahta01 on November 28, 2009, 04:28:44 pm
Little bit off topic. Will the nightly builds at some point switch to 2.9 or do you wait until 3.0 is released?

Most likely, the CB Devs, will wait till 3.0; unless 2.9 fixes a major issue on Windows or Linux.

Tim S.
Title: Re: Building Code::Blocks on Win 64
Post by: billyonthemountain on December 02, 2009, 11:06:39 am
Note, you must use wxWidgets 2.9 for 64 bit; since wxWidgets 2.8 has 64 bit windows issues.
Hum if I am not utterly mistaken this WPGSystem I am using has a native 64bit build of wxWidgets 2.9... "Should" from this point of view...
As for Squirrel, it can be compiled with GCC for Linux 64-bit but is it known to compile for a Win 64 platform ?

As for wxWidgets 3.0 :
Quote from: http://trac.wxwidgets.org/wiki/Roadmap
We hope to make 3.0 in the first half of 2010.
Means Codeblocks still has some way to go before official support for a Win 64 build...
Title: Re: Building Code::Blocks on Win 64
Post by: stahta01 on December 02, 2009, 04:32:55 pm
Quote from: billyonthemountain link=topic=11567.msg78977#msg78977

As for Squirrel, it can be compiled with GCC for Linux 64-bit but is it know to compile for a Win 64 platform ?

The most recent Squirrel is supposed to be Windows 64-bit; but, the wrapper code we use is NOT 64-bit Windows ready. IIRC, SqPlus is the wrapper CB uses.

http://wiki.squirrel-lang.org/default.aspx/SquirrelWiki/SqPlus.html

Tim S.
Title: Re: Building Code::Blocks on Win 64
Post by: Biplab on December 03, 2009, 05:02:06 pm
Hello everyone,

Trying to build code:blocks using the Mingw64/msys based WPG-System64 (http://www.cadforte.com/system64.html) build environmental on Windows 7 64-bits, I get the same error as pointed out in this thread (http://forums.codeblocks.org/index.php/topic,7321.0.html) (this one was on Linux) ie.
Code
||=== Code::Blocks, AutoRevision ===|
||warning: auto-importing has been activated without --enable-auto-import specified on the command line.|
||=== Code::Blocks, Squirrel ===|
include\scripting\squirrel\sqtable.h||In function 'SQHash HashObj(const SQObjectPtr&)':|
include\scripting\squirrel\sqtable.h|21|erreur: cast from 'SQRefCounted*' to 'SQInteger' loses precision|
||=== Build finished: 1 errors, 1 warnings ===|

Defining  _SQ64 doesn't help. I guess this won't be the only problem I will encounter, so I was wondering if anyone had experience in building code::blocks in a native 64-bits environment on Windows.

You can use the following patch. This will help you compile Squirrel and SqPlus without any error. Please note that the patch is a partial one (means it doesn't include patch for other part of C::B). I had to edit the patch manually. So if you can't use patch tool to apply the same, you need to manully patch the source code.

Edit 1: An updated patch is available at the following post-
Quote
http://forums.codeblocks.org/index.php/topic,11567.msg79095.html#msg79095

I've tried to make sure the patch doesn't break Linux build. However I can't test it at the moment as I don't have access to a 64-bit Linux machine.

You'll also need to define _WIN64 to root of Code::Blocks project options. As Tim said above, you need to use wx-2.9 to compile it correctly. So you need to manually edit the project file to include wx-2.9 libs.


At the moment I'm working on a 64-bit windows port of Code::Blocks. I'll commit the patch after some more testing and code cleanup.

Hope this helps. :)
Title: Re: Building Code::Blocks on Win 64
Post by: Jenna on December 03, 2009, 05:40:34 pm
I've tried to make sure the patch doesn't break Linux build. However I can't test it at the moment as I don't have access to a 64-bit Linux machine.

I just give it a quick try on debian 64-bit:

squirrel.h had to be patched manually (as you mentioned), no errors while building.
I tested scripting with the make_dist.script and everything seems to work.
Title: Re: Building Code::Blocks on Win 64
Post by: Biplab on December 04, 2009, 12:28:12 am
I've tried to make sure the patch doesn't break Linux build. However I can't test it at the moment as I don't have access to a 64-bit Linux machine.

I just give it a quick try on debian 64-bit:

squirrel.h had to be patched manually (as you mentioned), no errors while building.
I tested scripting with the make_dist.script and everything seems to work.

Thanks a lot for testing. :)

I'll come up with more patches as the work progresses.
Title: Re: Building Code::Blocks on Win 64
Post by: MortenMacFly on December 04, 2009, 06:33:15 am
I'll come up with more patches as the work progresses.
Good to hear and it works here (in my VM), too!

Hence I'd like to state that the squirrel development has continued, too. The new squirrel libraries are 64 bit compatible to my knowledge. I already tried an update of squirrel but an aweful lot has changed (including the interface etc...) However, I think we should still consider updating squirrel instead of patching our old branch a lot more. Because I believe most of the work is already done. :)
Title: Re: Building Code::Blocks on Win 64
Post by: billyonthemountain on December 04, 2009, 05:24:02 pm
You can use the following patch. This will help you compile Squirrel and SqPlus without any error. Please note that the patch is a partial one (means it doesn't include patch for other part of C::B). I had to edit the patch manually. So if you can't use patch tool to apply the same, you need to manully patch the source code.
[...]
I've tried to make sure the patch doesn't break Linux build. However I can't test it at the moment as I don't have access to a 64-bit Linux machine.

You'll also need to define _WIN64 to root of Code::Blocks project options. As Tim said above, you need to use wx-2.9 to compile it correctly. So you need to manually edit the project file to include wx-2.9 libs.
Hope this helps. :)
Thanks, both of them compile fine now, changed wxWidgets library name to
Code
wxmsw$(#WX.WX_VER)$(WX_SUFFIX)
Will be easier to switch to 3.0 later...

At the moment I'm working on a 64-bit windows port of Code::Blocks. I'll commit the patch after some more testing and code cleanup.

Hope this helps. :)
May I suggest a win64 porting branch ? Could give the porting issue more visibility and make patch testing easier especially with the squirrel update which doesn't look like a piece of cake...  :?
If you need help, I can do some testing on both win 64 and linux 64-bit (gentoo)...
Title: Re: Building Code::Blocks on Win 64
Post by: Conan Kudo on December 04, 2009, 11:26:46 pm
Little bit off topic. Will the nightly builds at some point switch to 2.9 or do you wait until 3.0 is released?

Most likely, the CB Devs, will wait till 3.0; unless 2.9 fixes a major issue on Windows or Linux.

Tim S.

wxWidgets 2.9 fixes a weird issue on the Mac side. Aside from switching to Cocoa, font dialog boxes work in wx2.9. The current release of CodeBlocks with wx2.8 doesn't let you change the fonts in the editor settings. The dialog pops up and then disappears.

Also, wxWidgets 2.9 is all Unicode now.
Title: Re: Building Code::Blocks on Win 64
Post by: Biplab on December 05, 2009, 05:47:35 pm
May I suggest a win64 porting branch ? Could give the porting issue more visibility and make patch testing easier especially with the squirrel update which doesn't look like a piece of cake...  :?
If you need help, I can do some testing on both win 64 and linux 64-bit (gentoo)...

Branching is a better way of hancdling this. But I'm not in favour of creating another branch at the moment. We are already running 2 branches and introducing another one may complicate the scenario. I prefer to put it in trunk at the moment.

Any kind help would be welcome. :)  I'd also urge all to test it on 32 bit platform, if possible.


Hence I'd like to state that the squirrel development has continued, too. The new squirrel libraries are 64 bit compatible to my knowledge. I already tried an update of squirrel but an aweful lot has changed (including the interface etc...) However, I think we should still consider updating squirrel instead of patching our old branch a lot more. Because I believe most of the work is already done. :)

At the moment I just want make sure Code::Blocks compiles fine on Win 64 bit. Porting to Linux shouldn't be an issue as porting is much easier on Linux and I believe current code well on 64 bit Linux at the moment. I'm ok with introducing updated Squirrel to trunk.


I'm posting an updated patch. This patch should allow anyone to build Code::Blocks (on Win 64) upto wxScintilla target. I'm getting an ICE (Internal Compiler Error) while compiling the SDK target. Previous patch was not clean as some of our source file had inconsistent line endings (now fixed in trunk). This patch is much cleaner to apply.

Code
Index: src/include/scripting/include/squirrel.h
===================================================================
--- src/include/scripting/include/squirrel.h (revision 5953)
+++ src/include/scripting/include/squirrel.h (working copy)
@@ -40,27 +40,33 @@
 #endif
 
 // C::B patch: so it builds on 64bit
-#ifdef _LP64
+#if defined(_LP64) || defined(_WIN64)
     #define _SQ64
 #endif
 
-#ifdef _SQ64
-#ifdef _MSC_VER
-typedef __int64 SQInteger;
-typedef unsigned __int64 SQUnsignedInteger;
-typedef unsigned __int64 SQHash; /*should be the same size of a pointer*/
+#if defined(_SQ64)
+    #if defined(__WXMSW__) /* Win specific code */
+        #ifdef _MSC_VER
+        typedef __int64 SQInteger;
+        typedef unsigned __int64 SQUnsignedInteger;
+        typedef unsigned __int64 SQHash; /*should be the same size of a pointer*/
+        #else
+        typedef long long SQInteger;
+        typedef unsigned long long SQUnsignedInteger;
+        typedef unsigned long long SQHash; /*should be the same size of a pointer*/
+        #endif
+    #else
+    typedef long SQInteger;
+    typedef unsigned long SQUnsignedInteger;
+    typedef unsigned long SQHash; /*should be the same size of a pointer*/
+    #endif
+    typedef int SQInt32;
 #else
-typedef long SQInteger;
-typedef unsigned long SQUnsignedInteger;
-typedef unsigned long SQHash; /*should be the same size of a pointer*/
+    typedef int SQInteger;
+    typedef int SQInt32; /*must be 32 bits(also on 64bits processors)*/
+    typedef unsigned int SQUnsignedInteger;
+    typedef unsigned int SQHash; /*should be the same size of a pointer*/
 #endif
-typedef int SQInt32;
-#else
-typedef int SQInteger;
-typedef int SQInt32; /*must be 32 bits(also on 64bits processors)*/
-typedef unsigned int SQUnsignedInteger;
-typedef unsigned int SQHash; /*should be the same size of a pointer*/
-#endif
 
 typedef float SQFloat;
 typedef void* SQUserPointer;
Index: src/include/scripting/sqplus/sqplus.h
===================================================================
--- src/include/scripting/sqplus/sqplus.h (revision 5953)
+++ src/include/scripting/sqplus/sqplus.h (working copy)
@@ -1,6 +1,6 @@
 // SqPlus.h
 // Created by John Schultz 9/05/05, major update 10/05/05.
-// Template function call design from LuaPlusCD by Joshua C. Jensen,
+// Template function call design from LuaPlusCD by Joshua C. Jensen,
 // inspired by luabind which was inspired by boost::python.
 // Const argument, const member functions, and Mac OS-X changes by Simon Michelmore.
 // DECLARE_INSTANCE_TYPE_NAME changes by Ben (Project5) from http://www.squirrel-lang.org/forums/.
@@ -23,7 +23,7 @@
   #endif
 #endif
 #include <memory.h>
-#if defined(_MSC_VER) || defined(__BORLANDC__)
+#if defined(_MSC_VER) || defined(__BORLANDC__)
   #include <tchar.h>
   #ifndef UNICODE
     #define SCSNPRINTF _snprintf
@@ -50,13 +50,21 @@
 #include "squirrel.h"
 
 // C::B patch: so it builds on 64bit, ecapsulate bool/int/float using Squirrel types
-#ifndef _WINDEF_
+/*#ifndef _WINDEF_
   typedef SQInteger BOOL;
   typedef SQInteger INT;
   typedef SQFloat   FLOAT;
   #define TRUE 1
   #define FALSE 0
-#endif
+#endif*/
+  #if defined(BOOL)
+    #undef BOOL
+  #endif
+  #define BOOL SQInteger
+  #define INT SQInteger
+  typedef SQFloat   FLOAT;
+  #define TRUE 1
+  #define FALSE 0
 
 #include "SquirrelObject.h"
 #include "SquirrelVM.h"
@@ -476,7 +484,7 @@
   sq_remove(v,-3); // Remove the root table.
   sq_push(v,1);    // Push the 'this'.
 #else // Kamaitati's change. 5/28/06 jcs.
-  sq_remove(v,-2); // Remove the root table.
+  sq_remove(v,-2); // Remove the root table.
   sq_pushroottable(v); // Push the 'this'.
 #endif
   if (SQ_FAILED(sq_call(v,1,SQTrue,SQ_CALL_RAISE_ERROR))) { // Call ClassName(): creates new instance and calls constructor (instead of sq_createinstance() where constructor is not called).
@@ -1580,8 +1588,8 @@
 template<typename T>
 struct ReleaseClassPtrPtr {
   static SQInteger release(SQUserPointer up,SQInteger size) {
-    if (up) {
-      T ** self = (T **)up;
+    if (up) {
+      T ** self = (T **)up;
       delete *self;
     } // if
     return 0;
@@ -1591,8 +1599,8 @@
 template<typename T>
 struct ReleaseClassPtr {
   static SQInteger release(SQUserPointer up,SQInteger size) {
-    if (up) {
-      T * self = (T *)up;
+    if (up) {
+      T * self = (T *)up;
       delete self;
     } // if
     return 0;
@@ -1628,7 +1636,7 @@
         SQUserPointer typeTag;
         sq_gettypetag(v,-1,&typeTag);
         newObjectTable.SetUserPointer(INT(size_t(typeTag)),newClass);
-        sq_poptop(v);
+        sq_poptop(v);
 #else
         instance.SetValue(SQ_ANCESTOR_CLASS_INDEX,i); // Store ancestor class index for recursive constructor calls to come.
         INT top = sq_gettop(v);
@@ -1699,7 +1707,7 @@
     } // if
     classHierArray.ArrayAppend(newClass);          // Add the class to the hierarchy array. The array values will be released and replaced with UserData to free created ancestor classes.
     // C::B patch for 64bit builds
-    newClass.SetValue(SQ_ANCESTOR_CLASS_INDEX,(SQInteger)-1); // When the class hierarchy is created, this var will be used to help in recursively creating ancestor classes.
+    //newClass.SetValue(SQ_ANCESTOR_CLASS_INDEX,(SQInteger)-1); // When the class hierarchy is created, this var will be used to help in recursively creating ancestor classes.
 #endif
   } // if
   sq_settop(v,top);
Index: src/include/scripting/sqplus/SquirrelBindingsUtilsWin32.h
===================================================================
--- src/include/scripting/sqplus/SquirrelBindingsUtilsWin32.h (revision 5953)
+++ src/include/scripting/sqplus/SquirrelBindingsUtilsWin32.h (working copy)
@@ -10,6 +10,8 @@
 #include <unknwn.h>
 #endif
 
+#include "sqplus.h"
+
 #ifndef SQUIRREL_BINDINGS_UTILS_H
 #include "SquirrelBindingsUtils.h"
 #endif
Index: src/include/wxscintilla/include/wx/wxscintilla.h
===================================================================
--- src/include/wxscintilla/include/wx/wxscintilla.h (revision 5953)
+++ src/include/wxscintilla/include/wx/wxscintilla.h (working copy)
@@ -2145,7 +2145,9 @@
 
 //----------------------------------------------------------------------
 
+#if !wxCHECK_VERSION(2, 9, 0) && !defined(__WIN64)
 typedef long wxIntPtr; // FIXME: back-port from wx29 (svn) to wx289
+#endif
 
 class WXDLLIMPEXP_SCI wxScintilla : public wxControl {
 public:
Index: src/sdk/scripting/sqplus/SquirrelBindingsUtilsWin32.cpp
===================================================================
--- src/sdk/scripting/sqplus/SquirrelBindingsUtilsWin32.cpp (revision 5953)
+++ src/sdk/scripting/sqplus/SquirrelBindingsUtilsWin32.cpp (working copy)
@@ -1,4 +1,4 @@
-#include "sqplus.h"
+//#include "sqplus.h"
 
 //#include "SquirrelObject.h"
 //#include "SquirrelVM.h"
Index: src/sdk/scripting/sqplus/SquirrelVM.cpp
===================================================================
--- src/sdk/scripting/sqplus/SquirrelVM.cpp (revision 5953)
+++ src/sdk/scripting/sqplus/SquirrelVM.cpp (working copy)
@@ -1,5 +1,6 @@
 #include <stdio.h>
 #include <stdarg.h>
+#include <string.h>
 
 #define _DEBUG_DUMP
 
@@ -21,7 +22,7 @@
 SQInteger SquirrelVM::_CallState = -1;
 SquirrelObject * SquirrelVM::_root = NULL;
 
-SquirrelError::SquirrelError()
+SquirrelError::SquirrelError()
 {
  const SQChar *s;
  sq_getlasterror(SquirrelVM::_VM);
@@ -131,7 +132,7 @@
  }
  sq_pop(_VM,1);
  throw SquirrelError();
-
+
 }
 
 
@@ -204,7 +205,7 @@
 SquirrelObject SquirrelVM::EndCall()
 {
  SquirrelObject ret;
- if(_CallState >= 0) {
+ if(_CallState >= 0) {
  SQInteger oldtop = sq_gettop(_VM);
  SQInteger nparams = _CallState;
  _CallState = -1;
@@ -215,7 +216,7 @@
  sq_settop(_VM,oldtop-(nparams+1));
  throw SquirrelError();
  }
-
+
  }
  return ret;
 }
Index: src/sdk/wxscintilla/src/PlatWX.cpp
===================================================================
--- src/sdk/wxscintilla/src/PlatWX.cpp (revision 5953)
+++ src/sdk/wxscintilla/src/PlatWX.cpp (working copy)
@@ -1383,7 +1383,11 @@
                                     void *lParam) {
 
     wxScintilla* sci = (wxScintilla*)w;
+    #if defined(_WIN64)
+    return sci->SendMsg(msg, wParam, (long long)lParam);
+    #else
     return sci->SendMsg(msg, wParam, (long)lParam);
+    #endif
 }
 
 
Index: src/sdk/wxscintilla/src/scintilla/include/Scintilla.h
===================================================================
--- src/sdk/wxscintilla/src/scintilla/include/Scintilla.h (revision 5953)
+++ src/sdk/wxscintilla/src/scintilla/include/Scintilla.h (working copy)
@@ -29,8 +29,8 @@
 #include <BaseTsd.h>
 #endif
 #ifdef MAXULONG_PTR
-typedef ULONG_PTR uptr_t;
-typedef LONG_PTR sptr_t;
+typedef UINT_PTR uptr_t;
+typedef INT_PTR sptr_t;
 #else
 typedef unsigned long uptr_t;
 typedef long sptr_t;
@@ -122,8 +122,8 @@
 #define SC_MARK_AVAILABLE 28
 #define SC_MARK_CHARACTER 10000
 /* CHANGEBAR begin */
-#define SC_MARKNUM_CHANGEUNSAVED 23
-#define SC_MARKNUM_CHANGESAVED 24
+#define SC_MARKNUM_CHANGEUNSAVED 23
+#define SC_MARKNUM_CHANGESAVED 24
 /* CHANGEBAR end */
 #define SC_MARKNUM_FOLDEREND 25
 #define SC_MARKNUM_FOLDEROPENMID 26
@@ -133,7 +133,7 @@
 #define SC_MARKNUM_FOLDER 30
 #define SC_MARKNUM_FOLDEROPEN 31
 /* CHANGEBAR begin */
-#define SC_MASK_FOLDERS 0xFF800000
+#define SC_MASK_FOLDERS 0xFF800000
 /* CHANGEBAR end */
 #define SCI_MARKERDEFINE 2040
 #define SCI_MARKERSETFORE 2041
Index: src/sdk/wxscintilla/src/ScintillaWX.cpp
===================================================================
--- src/sdk/wxscintilla/src/ScintillaWX.cpp (revision 5953)
+++ src/sdk/wxscintilla/src/ScintillaWX.cpp (working copy)
@@ -727,7 +727,7 @@
 
 //----------------------------------------------------------------------
 
-long ScintillaWX::DefWndProc(unsigned int /*iMessage*/, unsigned long /*wParam*/, long /*lParam*/) {
+sptr_t ScintillaWX::DefWndProc(unsigned int /*iMessage*/, uptr_t /*wParam*/, sptr_t /*lParam*/) {
     return 0;
 }
 
Index: src/sdk/wxscintilla/src/ScintillaWX.h
===================================================================
--- src/sdk/wxscintilla/src/ScintillaWX.h (revision 5953)
+++ src/sdk/wxscintilla/src/ScintillaWX.h (working copy)
@@ -117,9 +117,9 @@
     virtual void AddToPopUp(const char *label, int cmd = 0, bool enabled = true);
     virtual void ClaimSelection();
 
-    virtual long DefWndProc(unsigned int iMessage,
-                            unsigned long wParam,
-                            long lParam);
+    virtual sptr_t DefWndProc(unsigned int iMessage,
+                            uptr_t wParam,
+                            sptr_t lParam);
     virtual long WndProc(unsigned int iMessage,
                          unsigned long wParam,
                          long lParam);
Index: src/sdk/wxscintilla/src/wxscintilla.cpp
===================================================================
--- src/sdk/wxscintilla/src/wxscintilla.cpp (revision 5953)
+++ src/sdk/wxscintilla/src/wxscintilla.cpp (working copy)
@@ -1079,7 +1079,7 @@
 // Define a set of character that when typed cancel the auto-completion list.
 void wxScintilla::AutoCompStops (const wxString& characterSet)
 {
-    SendMsg(SCI_AUTOCSTOPS, 0, (long)(const char*)wx2sci(characterSet));
+    SendMsg(SCI_AUTOCSTOPS, 0, (wxIntPtr)(const char*)wx2sci(characterSet));
 }
 
 // Change the separator character in the string setting up an auto-completion list.
@@ -1760,7 +1760,7 @@
 // Show a call tip containing a definition near position pos.
 void wxScintilla::CallTipShow (int pos, const wxString& definition)
 {
-    SendMsg(SCI_CALLTIPSHOW, pos, (long)(const char*)wx2sci(definition));
+    SendMsg(SCI_CALLTIPSHOW, pos, (wxIntPtr)(const char*)wx2sci(definition));
 }
 
 // Remove the call tip from the screen.
Title: Re: Building Code::Blocks on Win 64
Post by: Biplab on December 08, 2009, 05:06:57 pm
Here's an update.

C::B and core plugins can now be compiled successfully on Win 64 bit platform. Do note my emphasis on the word "compiled". The code can now be compiled but is unstable at the moment!!

A patch is attached with the post.

Known issues:
1) There are couple of warnings to be fixed in Compiler depslib target.
2) crashhandler.cpp code needs to be updated to conform 64 bit api calls.
3) Scripting system is partially broken. Needs to be fixed.  <-- Fixed now. I accidentally commented one line which caused this bug.  :oops:

The patch may not work with patch tools. Manual patching may be necessary in such a case.


Edit 1: A new version of patch is uploaded. This fixes item no 3 stated above. If you have downloaded the previous file (64-bit_v1_08-Dec-09.7z), please redownload the patch. I had accidentally commented one line which caused the above bug.

[attachment deleted by admin]
Title: Re: Building Code::Blocks on Win 64
Post by: billyonthemountain on December 31, 2009, 05:36:33 pm
on x86_64-pc-linux-gnu-g++ the patch breaks sqplus...

Code
libtool: compile:  x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I../../../../src/include -I../../../../src/include/scripting/include -I../../../../src/include/scripting/sqplus -Ulinux -Uunix -O2 -ffast-math -DCB_AUTOCONF -O2 -pipe -march=core2 -fno-strict-aliasing -fPIC -DPIC -fexceptions -c SqPlus.cpp  -fPIC -DPIC -o .libs/SqPlus.o                                                                                                                 
In file included from SqPlus.cpp:2:                                                                                                                 
../../../../src/include/scripting/sqplus/sqplus.h: In function ‘void SqPlus::Push(SQVM*, long int)’:                                                 
../../../../src/include/scripting/sqplus/sqplus.h:1863: error: redefinition of ‘void SqPlus::Push(SQVM*, long int)’                                 
../../../../src/include/scripting/sqplus/sqplus.h:1861: error: ‘void SqPlus::Push(SQVM*, SQInteger)’ previously defined here                         
make[4]: *** [SqPlus.lo] Error 1                                                                                                                     
make[4]: Leaving directory `/var/tmp/portage/dev-util/codeblocks-9999-r23/work/codeblocks-9999/src/sdk/scripting/sqplus'                             
make[3]: *** [all-recursive] Error 1                                                                                                                 
make[3]: Leaving directory `/var/tmp/portage/dev-util/codeblocks-9999-r23/work/codeblocks-9999/src/sdk/scripting'                                   
make[2]: *** [all-recursive] Error 1                                                                                                                 
make[2]: Leaving directory `/var/tmp/portage/dev-util/codeblocks-9999-r23/work/codeblocks-9999/src/sdk'                                             
make[1]: *** [all-recursive] Error 1                                                                                                                 
make[1]: Leaving directory `/var/tmp/portage/dev-util/codeblocks-9999-r23/work/codeblocks-9999/src'                                                 
make: *** [all-recursive] Error 1
Title: Re: Building Code::Blocks on Win 64
Post by: jonok on January 07, 2010, 09:33:01 pm
Here's an update.

C::B and core plugins can now be compiled successfully on Win 64 bit platform. Do note my emphasis on the word "compiled". The code can now be compiled but is unstable at the moment!!

A patch is attached with the post.

Known issues:
1) There are couple of warnings to be fixed in Compiler depslib target.
2) crashhandler.cpp code needs to be updated to conform 64 bit api calls.
3) Scripting system is partially broken. Needs to be fixed.  <-- Fixed now. I accidentally commented one line which caused this bug.  :oops:

The patch may not work with patch tools. Manual patching may be necessary in such a case.


Edit 1: A new version of patch is uploaded. This fixes item no 3 stated above. If you have downloaded the previous file (64-bit_v1_08-Dec-09.7z), please redownload the patch. I had accidentally commented one line which caused the above bug.
Title: Re: Building Code::Blocks on Win 64
Post by: Biplab on January 12, 2010, 05:35:22 pm
I've uploaded a test build (core app and core plugins only) to the following link which is based on C::B trunk (rev 6078) and my patchset. If you are interested then you may download it from the following link.

Quote
http://www.box.net/shared/tsoetogrd3

Note that patches needed for Squirrel has already been committed to trunk. I'm attaching remaining patch (against trunk-rev 6078) needed to build core app and plugins. Contrib plugins are not updated yet for Win 64 build.

Important Notes:
1) This is a test build. Use it for testing only.
2) You need to "Kill" it from Task Manager after you finish your work. If you close it normally, it will stay in the memory. Source of Bug - so far I've been unable to trace it.
3) Clicking Settings > Editor will cause a segfault. I've found the offending line. However that line can't be a source of this bug (I'm quite sure). I'm still looking for the real source.

As the patch matures, I'll commit them in trunk. Any feedback is always welcome. :)

Edit 1:
@Billy, please try this new patch. Build issue on Linux should get resolved.

[attachment deleted by admin]
Title: Re: Building Code::Blocks on Win 64
Post by: billyonthemountain on January 13, 2010, 12:35:58 am
Compiling still fails here :
Code
/bin/sh ../../../../libtool --tag=CXX   --mode=compile x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I../../../../src/include -I/usr/lib64/wx/include/gtk2-unicode-release-2.9 -I/usr/include/wx-2.9 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread -I../../../../src/include -I../../../../src/include/wxscintilla/include -I../../../../src/include/scripting/include -I../../../../src/include/scripting/bindings -I../../../../src/include/scripting/sqplus  -Ulinux -Uunix  -O2 -ffast-math -DCB_AUTOCONF -O2 -pipe -march=core2 -fno-strict-aliasing  -fPIC -DPIC -fexceptions -c -o sc_wxtypes.lo sc_wxtypes.cpp                                                                                                                                         
libtool: compile:  x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I../../../../src/include -I/usr/lib64/wx/include/gtk2-unicode-release-2.9 -I/usr/include/wx-2.9 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread -I../../../../src/include -I../../../../src/include/wxscintilla/include -I../../../../src/include/scripting/include -I../../../../src/include/scripting/bindings -I../../../../src/include/scripting/sqplus -Ulinux -Uunix -O2 -ffast-math -DCB_AUTOCONF -O2 -pipe -march=core2 -fno-strict-aliasing -fPIC -DPIC -fexceptions -c sc_wxtypes.cpp  -fPIC -DPIC -o .libs/sc_wxtypes.o        
In file included from ../../../../src/include/scripting/bindings/sc_base_types.h:26,                                                                
                 from sc_wxtypes.cpp:18:                                                                                                            
../../../../src/include/scripting/sqplus/sqplus.h: In static member function ‘static SQInteger SqPlus::DirectCallInstanceMemberFunction<Callee, Func>::Dispatch(SQVM*) [with Callee = wxColour, Func = bool (wxGDIObject::*)()const]’:                                                                    
../../../../src/include/scripting/sqplus/sqplus.h:1323:   instantiated from ‘void SqPlus::sq_pushdirectinstanceclosure(SQVM*, const Callee&, Func, SQUnsignedInteger) [with Callee = wxColour, Func = bool (wxGDIObject::*)()const]’                                                                      
../../../../src/include/scripting/sqplus/sqplus.h:1407:   instantiated from ‘void SqPlus::RegisterInstance(SQVM*, HSQOBJECT, Callee&, Func, const SQChar*) [with Callee = wxColour, Func = bool (wxGDIObject::*)()const]’                                                                                
../../../../src/include/scripting/sqplus/sqplus.h:1761:   instantiated from ‘SqPlus::SQClassDef<TClassType>& SqPlus::SQClassDef<TClassType>::func(Func, const SQChar*) [with Func = bool (wxGDIObject::*)()const, TClassType = wxColour]’                                                                
sc_wxtypes.cpp:223:   instantiated from here                                                                                                        
../../../../src/include/scripting/sqplus/sqplus.h:1254: error: no matching function for call to ‘Call(wxColour&, bool (wxGDIObject::*&)()const, SQVM*&, int)’                                                                                                                                            
make[4]: *** [sc_wxtypes.lo] Error 1                                                                                                                
make[4]: Leaving directory `/var/tmp/portage/dev-util/codeblocks-9999-r23/work/codeblocks-9999/src/sdk/scripting/bindings'                          
make[3]: *** [all-recursive] Error 1                                                                                                                
make[3]: Leaving directory `/var/tmp/portage/dev-util/codeblocks-9999-r23/work/codeblocks-9999/src/sdk/scripting'                                    
make[2]: *** [all-recursive] Error 1                                                                                                                
make[2]: Leaving directory `/var/tmp/portage/dev-util/codeblocks-9999-r23/work/codeblocks-9999/src/sdk'                                              
make[1]: *** [all-recursive] Error 1                                                                                                                
make[1]: Leaving directory `/var/tmp/portage/dev-util/codeblocks-9999-r23/work/codeblocks-9999/src'                                                  
make: *** [all-recursive] Error 1
Using wx-2.9 svn on linux 64bit

2) You need to "Kill" it from Task Manager after you finish your work. If you close it normally, it will stay in the memory. Source of Bug - so far I've been unable to trace it.
Does also happen on Win64 using a 32bit build, still need to confirm it and do more some testing
Works with the 12.01 nightly, need to check my build system on windows
Title: Re: Building Code::Blocks on Win 64
Post by: Biplab on January 13, 2010, 12:52:28 am
I'll look into Linux build issue tonight. Thanks for your feedback. Hung app issue doesn't occur in 32 bit. However it crashes on normal exit. Debugger doesn't return any meaningful output on the crash. :-)
Title: Re: Building Code::Blocks on Win 64
Post by: billyonthemountain on January 13, 2010, 01:13:24 am
Just for interest : Using wx-2.8 on linux, fails as well but not at the same place...
Code
/bin/sh ../../../libtool --tag=CXX   --mode=compile x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I../../../src/include -I/usr/lib64/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread -I../../../src/include/wxscintilla/include -I../../../src/include -I../../../src/include/tinyxml  -Ulinux -Uunix  -O2 -ffast-math -DCB_AUTOCONF -O2 -pipe -march=core2 -fno-strict-aliasing  -fPIC -DPIC -fexceptions -c -o tinywxuni.lo tinywxuni.cpp                                                                                                     
libtool: compile:  x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I../../../src/include -I/usr/lib64/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread -I../../../src/include/wxscintilla/include -I../../../src/include -I../../../src/include/tinyxml -Ulinux -Uunix -O2 -ffast-math -DCB_AUTOCONF -O2 -pipe -march=core2 -fno-strict-aliasing -fPIC -DPIC -fexceptions -c tinywxuni.cpp  -fPIC -DPIC -o .libs/tinywxuni.o                                                                                                                       
In file included from ../../../src/include/sdk_common.h:40,                                                                                         
                 from ../../../src/include/sdk_precomp.h:13,                                                                                         
                 from tinywxuni.cpp:1:                                                                                                               
../../../src/include/prep.h:305: error: ‘wxIntPtr’ does not name a type                                                                             
../../../src/include/prep.h:307: error: expected ‘)’ before ‘in’                                                                                     
../../../src/include/prep.h:310: error: ‘wxIntPtr’ has not been declared                                                                             
../../../src/include/prep.h:316: error: expected type-specifier before ‘wxIntPtr’                                                                   
../../../src/include/prep.h: In constructor ‘ID::ID()’:                                                                                             
../../../src/include/prep.h:314: error: class ‘ID’ does not have any field named ‘value’                                                             
../../../src/include/prep.h:314: error: ‘wxIntPtr’ was not declared in this scope                                                                   
../../../src/include/prep.h: In member function ‘ID::operator void*() const’:                                                                       
../../../src/include/prep.h:317: error: ‘value’ was not declared in this scope                                                                       
../../../src/include/prep.h: In member function ‘bool ID::Valid() const’:                                                                           
../../../src/include/prep.h:319: error: ‘value’ was not declared in this scope                                                                       
../../../src/include/prep.h:319: error: ‘wxIntPtr’ was not declared in this scope                                                                   
../../../src/include/prep.h: In function ‘bool operator==(ID, ID)’:                                                                                 
../../../src/include/prep.h:322: error: ‘class ID’ has no member named ‘value’                                                                       
../../../src/include/prep.h:322: error: ‘class ID’ has no member named ‘value’                                                                       
../../../src/include/prep.h: In function ‘bool operator==(ID, int)’:                                                                                 
../../../src/include/prep.h:323: error: ‘class ID’ has no member named ‘value’                                                                       
../../../src/include/prep.h:323: error: ‘wxIntPtr’ was not declared in this scope                                                                   
../../../src/include/prep.h:323: error: expected ‘;’ before ‘b’                                                                                     
../../../src/include/prep.h: In function ‘bool operator!=(ID, ID)’:                                                                                 
../../../src/include/prep.h:325: error: ‘class ID’ has no member named ‘value’                                                                       
../../../src/include/prep.h:325: error: ‘class ID’ has no member named ‘value’                                                                       
../../../src/include/prep.h: In function ‘bool operator!=(ID, int)’:                                                                                 
../../../src/include/prep.h:326: error: ‘class ID’ has no member named ‘value’                                                                       
../../../src/include/prep.h: In function ‘ID GetID()’:                                                                                               
../../../src/include/prep.h:332: error: ‘wxIntPtr’ does not name a type                                                                             
../../../src/include/prep.h:333: error: ‘id’ was not declared in this scope                                                                         
../../../src/include/prep.h: At global scope:                                                                                                       
../../../src/include/prep.h:337: error: ‘ConstructID’ declared as an ‘inline’ variable                                                               
../../../src/include/prep.h:337: error: ‘ID ConstructID’ redeclared as different kind of symbol                                                     
../../../src/include/prep.h:310: error: previous declaration of ‘ID ConstructID(int)’                                                               
../../../src/include/prep.h:337: error: ‘wxIntPtr’ was not declared in this scope                                                                   
make[3]: *** [tinywxuni.lo] Error 1                                                                                                                 
make[3]: Leaving directory `/var/tmp/portage/dev-util/codeblocks-9999-r23/work/codeblocks-9999/src/base/tinyxml'                                     
make[2]: *** [all-recursive] Error 1                                                                                                                 
make[2]: Leaving directory `/var/tmp/portage/dev-util/codeblocks-9999-r23/work/codeblocks-9999/src/base'                                             
make[1]: *** [all-recursive] Error 1                                                                                                                 
make[1]: Leaving directory `/var/tmp/portage/dev-util/codeblocks-9999-r23/work/codeblocks-9999/src'                                                 
make: *** [all-recursive] Error 1
I'm not really familiar with wxwidgets internals but it seems there's a non-negligible gap between 2.8.10 and 2.9; handling 2.8/2.9, win/linux/MacOs 32/64bits might get tricky...   :?
Title: Re: Building Code::Blocks on Win 64
Post by: Biplab on January 13, 2010, 04:45:19 pm
Try the attached patch. You are right in saying that use of wxIntPtr is very tricky. It's not defined in wx-2.8. I'll modify affected codes.

Compiling still fails here :
Code
../../../../src/include/scripting/sqplus/sqplus.h:1254: error: no matching function for call to ‘Call(wxColour&, bool (wxGDIObject::*&)()const, SQVM*&, int)’                                                                                                                                             
make[4]: *** [sc_wxtypes.lo] Error 1                                                                                                                 
make[4]: Leaving directory `/var/tmp/portage/dev-util/codeblocks-9999-r23/work/codeblocks-9999/src/sdk/scripting/bindings'                           
make[3]: *** [all-recursive] Error 1                                                                                                                 
make[3]: Leaving directory `/var/tmp/portage/dev-util/codeblocks-9999-r23/work/codeblocks-9999/src/sdk/scripting'                                   
make[2]: *** [all-recursive] Error 1                                                                                                                 
make[2]: Leaving directory `/var/tmp/portage/dev-util/codeblocks-9999-r23/work/codeblocks-9999/src/sdk'                                             
make[1]: *** [all-recursive] Error 1                                                                                                                 
make[1]: Leaving directory `/var/tmp/portage/dev-util/codeblocks-9999-r23/work/codeblocks-9999/src'                                                 
make: *** [all-recursive] Error 1
Using wx-2.9 svn on linux 64bit

I couldn't reproduce this on my 32 bit machine. Are you still getting this error?

[attachment deleted by admin]
Title: Re: Building Code::Blocks on Win 64
Post by: billyonthemountain on January 13, 2010, 09:01:55 pm
Here are my test results : (all done against revision 6083)

Code
Making all in lexers                                                                                          
[...]            
make[3]: Entering directory `/home/paccolat/tmp/devel/codeblocks_linux64/trunk/src/sdk'                      
if /bin/sh ../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I. -I../../src/include -I/usr/lib64/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread -I../../src/include -I../../src/include/wxscintilla/include -I../../src/include/tinyxml -I../../src/include/scripting/include -I../../src/include/scripting/sqplus -I../../src/include/mozilla_chardet  -Ulinux -Uunix  -O2 -ffast-math -DCB_AUTOCONF -g -O2 -DCB_PRECOMP -Winvalid-pch -fPIC -DPIC -fexceptions -MT nullptr.lo -MD -MP -MF ".deps/nullptr.Tpo" -c -o nullptr.lo nullptr.cpp; \                                                                                                                                      
        then mv -f ".deps/nullptr.Tpo" ".deps/nullptr.Plo"; else rm -f ".deps/nullptr.Tpo"; exit 1; fi                                              
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I. -I../../src/include -I/usr/lib64/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread -I../../src/include -I../../src/include/wxscintilla/include -I../../src/include/tinyxml -I../../src/include/scripting/include -I../../src/include/scripting/sqplus -I../../src/include/mozilla_chardet -Ulinux -Uunix -O2 -ffast-math -DCB_AUTOCONF -g -O2 -DCB_PRECOMP -Winvalid-pch -fPIC -DPIC -fexceptions -MT nullptr.lo -MD -MP -MF .deps/nullptr.Tpo -c nullptr.cpp  -fPIC -DPIC -o .libs/nullptr.o    
In file included from nullptr.cpp:10:                                                                                                                
../../src/include/prep.h:312: error: ‘size_t’ does not name a type                                                                                  
../../src/include/prep.h:314: error: expected ‘)’ before ‘in’                                                                                        
../../src/include/prep.h:317: error: ‘size_t’ has not been declared                                                                                  
../../src/include/prep.h:323: error: expected type-specifier before ‘size_t’                                                                        
../../src/include/prep.h: In constructor ‘ID::ID()’:                                                                                                
../../src/include/prep.h:321: error: class ‘ID’ does not have any field named ‘value’                                                                
../../src/include/prep.h:321: error: ‘size_t’ was not declared in this scope                                                                        
../../src/include/prep.h: In member function ‘ID::operator void*() const’:                                                                          
../../src/include/prep.h:324: error: ‘value’ was not declared in this scope                                                                          
../../src/include/prep.h: In member function ‘bool ID::Valid() const’:                                                                              
../../src/include/prep.h:326: error: ‘value’ was not declared in this scope                                                                          
../../src/include/prep.h:326: error: ‘size_t’ was not declared in this scope                                                                        
../../src/include/prep.h: In function ‘bool operator==(ID, ID)’:                                                                                    
../../src/include/prep.h:329: error: ‘class ID’ has no member named ‘value’                                                                          
../../src/include/prep.h:329: error: ‘class ID’ has no member named ‘value’                                                                          
../../src/include/prep.h: In function ‘bool operator==(ID, int)’:                                                                                    
../../src/include/prep.h:330: error: ‘class ID’ has no member named ‘value’
../../src/include/prep.h:330: error: ‘size_t’ was not declared in this scope
../../src/include/prep.h:330: error: expected ‘;’ before ‘b’
../../src/include/prep.h: In function ‘bool operator!=(ID, ID)’:
../../src/include/prep.h:332: error: ‘class ID’ has no member named ‘value’
../../src/include/prep.h:332: error: ‘class ID’ has no member named ‘value’
../../src/include/prep.h: In function ‘bool operator!=(ID, int)’:
../../src/include/prep.h:333: error: ‘class ID’ has no member named ‘value’
../../src/include/prep.h: In function ‘ID GetID()’:
../../src/include/prep.h:339: error: ‘size_t’ does not name a type
../../src/include/prep.h:340: error: ‘id’ was not declared in this scope
../../src/include/prep.h: At global scope:
../../src/include/prep.h:344: error: ‘ConstructID’ declared as an ‘inline’ variable
../../src/include/prep.h:344: error: ‘ID ConstructID’ redeclared as different kind of symbol
../../src/include/prep.h:317: error: previous declaration of ‘ID ConstructID(int)’
../../src/include/prep.h:344: error: ‘size_t’ was not declared in this scope

Code
Making all in bindings                                                                                                                               
make[4]: Entering directory `/home/paccolat/tmp/devel/codeblocks_linux64/trunk/src/sdk/scripting/bindings'                                          
if /bin/sh ../../../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I. -I../../../../src/include -I/usr/lib64/wx/include/gtk2-unicode-release-2.9 -I/usr/include/wx-2.9 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread -I../../../../src/include -I../../../../src/include/wxscintilla/include -I../../../../src/include/scripting/include -I../../../../src/include/scripting/bindings -I../../../../src/include/scripting/sqplus  -Ulinux -Uunix  -O2 -ffast-math -DCB_AUTOCONF -g -O2 -DCB_PRECOMP -Winvalid-pch -fPIC -DPIC -fexceptions -MT sc_wxtypes.lo -MD -MP -MF ".deps/sc_wxtypes.Tpo" -c -o sc_wxtypes.lo sc_wxtypes.cpp; \                                                                                                          
        then mv -f ".deps/sc_wxtypes.Tpo" ".deps/sc_wxtypes.Plo"; else rm -f ".deps/sc_wxtypes.Tpo"; exit 1; fi                                      
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I. -I../../../../src/include -I/usr/lib64/wx/include/gtk2-unicode-release-2.9 -I/usr/include/wx-2.9 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread -I../../../../src/include -I../../../../src/include/wxscintilla/include -I../../../../src/include/scripting/include -I../../../../src/include/scripting/bindings -I../../../../src/include/scripting/sqplus -Ulinux -Uunix -O2 -ffast-math -DCB_AUTOCONF -g -O2 -DCB_PRECOMP -Winvalid-pch -fPIC -DPIC -fexceptions -MT sc_wxtypes.lo -MD -MP -MF .deps/sc_wxtypes.Tpo -c sc_wxtypes.cpp  -fPIC -DPIC -o .libs/sc_wxtypes.o
In file included from ../../../../src/include/scripting/bindings/sc_base_types.h:26,
                 from sc_wxtypes.cpp:18:
../../../../src/include/scripting/sqplus/sqplus.h: In static member function ‘static SQInteger SqPlus::DirectCallInstanceMemberFunction<Callee, Func>::Dispatch(SQVM*) [with Callee = wxColour, Func = bool (wxGDIObject::*)()const]’:
../../../../src/include/scripting/sqplus/sqplus.h:1313:   instantiated from ‘void SqPlus::sq_pushdirectinstanceclosure(SQVM*, const Callee&, Func, SQUnsignedInteger) [with Callee = wxColour, Func = bool (wxGDIObject::*)()const]’
../../../../src/include/scripting/sqplus/sqplus.h:1397:   instantiated from ‘void SqPlus::RegisterInstance(SQVM*, HSQOBJECT, Callee&, Func, const SQChar*) [with Callee = wxColour, Func = bool (wxGDIObject::*)()const]’
../../../../src/include/scripting/sqplus/sqplus.h:1751:   instantiated from ‘SqPlus::SQClassDef<TClassType>& SqPlus::SQClassDef<TClassType>::func(Func, const SQChar*) [with Func = bool (wxGDIObject::*)()const, TClassType = wxColour]’
sc_wxtypes.cpp:223:   instantiated from here
../../../../src/include/scripting/sqplus/sqplus.h:1244: error: no matching function for call to ‘Call(wxColour&, bool (wxGDIObject::*&)()const, SQVM*&, int)’

Code
Making all in bindings                                                                                                                               
make[4]: Entering directory `/home/paccolat/tmp/devel/codeblocks_linux64/trunk/src/sdk/scripting/bindings'                                          
if /bin/sh ../../../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I. -I../../../../src/include -I/usr/lib64/wx/include/gtk2-unicode-release-2.9 -I/usr/include/wx-2.9 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread -I../../../../src/include -I../../../../src/include/wxscintilla/include -I../../../../src/include/scripting/include -I../../../../src/include/scripting/bindings -I../../../../src/include/scripting/sqplus  -Ulinux -Uunix  -O2 -ffast-math -DCB_AUTOCONF -g -O2 -DCB_PRECOMP -Winvalid-pch -fPIC -DPIC -fexceptions -MT sc_wxtypes.lo -MD -MP -MF ".deps/sc_wxtypes.Tpo" -c -o sc_wxtypes.lo sc_wxtypes.cpp; \                                                                                                          
        then mv -f ".deps/sc_wxtypes.Tpo" ".deps/sc_wxtypes.Plo"; else rm -f ".deps/sc_wxtypes.Tpo"; exit 1; fi                                      
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I. -I../../../../src/include -I/usr/lib64/wx/include/gtk2-unicode-release-2.9 -I/usr/include/wx-2.9 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread -I../../../../src/include -I../../../../src/include/wxscintilla/include -I../../../../src/include/scripting/include -I../../../../src/include/scripting/bindings -I../../../../src/include/scripting/sqplus -Ulinux -Uunix -O2 -ffast-math -DCB_AUTOCONF -g -O2 -DCB_PRECOMP -Winvalid-pch -fPIC -DPIC -fexceptions -MT sc_wxtypes.lo -MD -MP -MF .deps/sc_wxtypes.Tpo -c sc_wxtypes.cpp  -fPIC -DPIC -o .libs/sc_wxtypes.o                                                                                                                                    
In file included from ../../../../src/include/scripting/bindings/sc_base_types.h:26,                                                                
                 from sc_wxtypes.cpp:18:                                                                                                            
../../../../src/include/scripting/sqplus/sqplus.h: In static member function ‘static SQInteger SqPlus::DirectCallInstanceMemberFunction<Callee, Func>::Dispatch(SQVM*) [with Callee = wxColour, Func = bool (wxGDIObject::*)()const]’:
../../../../src/include/scripting/sqplus/sqplus.h:1323:   instantiated from ‘void SqPlus::sq_pushdirectinstanceclosure(SQVM*, const Callee&, Func, SQUnsignedInteger) [with Callee = wxColour, Func = bool (wxGDIObject::*)()const]’
../../../../src/include/scripting/sqplus/sqplus.h:1407:   instantiated from ‘void SqPlus::RegisterInstance(SQVM*, HSQOBJECT, Callee&, Func, const SQChar*) [with Callee = wxColour, Func = bool (wxGDIObject::*)()const]’
../../../../src/include/scripting/sqplus/sqplus.h:1761:   instantiated from ‘SqPlus::SQClassDef<TClassType>& SqPlus::SQClassDef<TClassType>::func(Func, const SQChar*) [with Func = bool (wxGDIObject::*)()const, TClassType = wxColour]’
sc_wxtypes.cpp:223:   instantiated from here
../../../../src/include/scripting/sqplus/sqplus.h:1254: error: no matching function for call to ‘Call(wxColour&, bool (wxGDIObject::*&)()const, SQVM*&, int)’

Looks like the patch still breaks the wx-2.8 build, wx-2.9 unaffected so far (wx-2.9 migration issue)
Hope it helps...
Title: Re: Building Code::Blocks on Win 64
Post by: vityan on April 01, 2010, 01:55:23 pm
C::B Build 6198
WxWidGets 2.91 SVN(31.03.2010)
MingW-W64 27.03.2010 Native Compiler(X64 -> X64) by sezero(Personal builds on MingW-W64 download section)


Status: SUCCESS build of native C::B X64 :)


Ok - I've worked on it 2 days(Don't afraid of post count of 1 post - I'm old happy C::B user and old C developer and building C::B/WxWidgets from source for more than year).


Let's start.

Prerequecities:

1)WxWidgets 2.91-SVN(Don't use nightly snapshots as they missing the Ribon subfolders in the archive)
2)My small fix-up for WxWidgets Source Code(One header file):
  include\wx\msw\listctrl.h
  
  Find:
   // Sets the item data
    bool SetItemPtrData(long item, wxUIntPtr data);
    bool SetItemData(long item, long data) { return SetItemPtrData(item, data); }

  Replace to:
     // Sets the item data
    bool SetItemPtrData(long item, wxUIntPtr data);
    bool SetItemData(long item, wxUIntPtr data) { return SetItemPtrData(item, data); }

3)C::B HEAD Source Code.
4)My Patch against C::B Source for Win-X64(The patch is very big and thus cannot be posted in the message body):
   http://pastebin.com/QjZW8n9G (http://pastebin.com/QjZW8n9G)


5) Disable PCH in C::B Project settings(Remove CB_PRECOMP and WX_PRECOMP defines)

Now build it.

NOTE: I currently have one last problem with WxWidgets X64 library mislinking(ld link it with empty Export table i.e without symbols and thus the library is not usefull now. Ima working on this issue currently - Gonna try debug builds and as the last resort build static library).
I gonna inform here about the progress ;)
Title: Re: Building Code::Blocks on Win 64
Post by: MortenMacFly on April 01, 2010, 04:58:20 pm
Status: SUCCESS build of native C::B X64 :)
Although this is great news, please remember the following:
- there has already been done s lot work on this especially for the scripting engine
- both works should be merged
- your patch has a lot diffs due to white spaces and tabs which makes it hard to read
- please respect that as we in feature freeze there won't be much work on this atm (and only atm).
- please post this on the patch tracker, too therefore (probably after a clean-up concerning the white spaces).
Title: Re: Building Code::Blocks on Win 64
Post by: vityan on April 01, 2010, 05:50:34 pm
[MortenMacFly]

Quote
- there has already been done s lot work on this especially for the scripting engine
I know - I view the list of changes commited by you,shahta and other active members and there are moves to X64 compatability.
Anyway there are still some work to be done.

Quote
- both works should be merged
- your patch has a lot diffs due to white spaces and tabs which makes it hard to read

This is Tortoise's Diff fault :) The patch has some "dummy changes"(Then code wth "-" gets replaced with exactly same code with "+" sign).

The change set can be reduced drastically by fixing "Basic types overlap" bug in SCPlus.
In short:
scplus.h defines INT,BOOL and FLAT types but those are already defined in windef.h in MingW-W64. While INT type is 32 bit in MingW64 ScPlus enforces it to be 64 bit(shahta's workaround i think). While scplus.h has protect against inclusion of windef.h vice versa doesn't apply(windef.h ofc doesn't check for inclusion of scplus.h and tries to redefine the types).

After a lot of headaches with those ive made a clear decision that defined types SHOULD NEVER overlap with Compiler's internal type and thus(Using UltraEdit Find And Replace in Files) replaced all INT,BOOL and FLOAT in SCPlus(Header+Src) with non-conflicting safe types CBINT,CBBOOL,CBFLOAT. This change is the biggest part of the patch file(about 70-80%) while portability fixes are 5-9 patches(Pointers extensions to be 64 bit(I dont "shrink" pointers by casting - Thats not a way of porting) and some extensions to interface functions of some classes with work with different types of data - extended to work with long long type too(Maximum supported integer was long which is 32 bit integer)).

Quote
- please respect that as we in feature freeze there won't be much work on this atm (and only atm).

I've read about it today and im glad that C::B finally reached the release point(Congrats about this grea event).
I know that such drastic changes will not enter trunk anytime soon but i wish you'r understanding that ppl will be able to apply a patch to official sources and run "X64" Edition unofficially until it will get merged(i suppose it will be changed a lot for merge :))

Quote
- please post this on the patch tracker, too therefore (probably after a clean-up concerning the white spaces).

Ill do it then ill be able to build fully working C::B(Till now it is unable to run yet. Release builds of WxWidgets 2.91 are miscompiled resulting in invalid PE module and debug builds compiles better but causes codeblcoks.dll module to crash. Im currently trying static builds).
Title: Re: Building Code::Blocks on Win 64
Post by: ironhead on August 17, 2010, 02:27:28 pm
Sorry for reviving such an old thread, but is there any plans to incorporate the Win64 changes into Code::Blocks svn?  I'm trying to compile it for my Win7 64-bit machine and hitting similar issues to those mentioned in this thread.

Thank you.
Title: Re: Building Code::Blocks on Win 64
Post by: Biplab on August 17, 2010, 03:10:35 pm
Sorry for reviving such an old thread, but is there any plans to incorporate the Win64 changes into Code::Blocks svn?  I'm trying to compile it for my Win7 64-bit machine and hitting similar issues to those mentioned in this thread.

Thank you.

Thank you for reviving this old thread! :)

The answer is Yes, it will be incorporated in SVN. I was waiting for the new release. Now as the release process is over, I'll commit those changes to trunk. But it will take some time. At least I target committing major portion of patch to trunk within few months. There are few things holding me at the moment.

1) I am using WPG-System64 to compile C::B under Windows 64. However I believe WPG-System64 project is currently unmaintained and I would like to move to MinGW-w64 released builds. However if I use MinGW-w64 compiler C::B compiles fine; but it crashes when I try to run it. GDB also doesn't give crash report. If I can't resolve that I may need to stay with WPG-System64 compiler unless I find some suitable alternative.

2) I still could not figure out a good way to resolve hang-on-exit bug. This is a major blocker for us at the moment.

Any help in this regard is appreciated. :)
Title: Re: Building Code::Blocks on Win 64
Post by: oBFusCATed on August 17, 2010, 03:25:11 pm
2) I still could not figure out a good way to resolve hang-on-exit bug. This is a major blocker for us at the moment.
This could be related to this:
http://forums.codeblocks.org/index.php/topic,10908.msg87337.html#msg87337

Also on linux I get this crash:

Code
(gdb) bt
#0  0x0000000000000021 in ?? ()
#1  0x00007ffff7aa33a0 in wxPGGlobalVarsClass::~wxPGGlobalVarsClass() () from /usr/lib/libcodeblocks.so.0
#2  0x00007ffff7ab9508 in wxPGGlobalVarsClassManager::~wxPGGlobalVarsClassManager() () from /usr/lib/libcodeblocks.so.0
#3  0x00007ffff485aa25 in __cxa_finalize () from /lib/libc.so.6
#4  0x00007ffff7782556 in ?? () from /usr/lib/libcodeblocks.so.0
#5  0x0000000000000076 in ?? ()
#6  0x0000000000000000 in ?? ()
This is related to the wxPG 1.4 and happens only when I build C::B with autotools sysmem.
Title: Re: Building Code::Blocks on Win 64
Post by: billyonthemountain on August 17, 2010, 09:21:34 pm
If I can't resolve that I may need to stay with WPG-System64 compiler unless I find some suitable alternative.
Did you try with TDragon's multilib build of GCC ? It's not a native 64bit compiler but it should do the job until the issues with mingw-w64 have been solved...

@Biplab: I haven't seen vityan's updated patch on the tracker so I suppose your patch "64bit-13-01-10_v1" is still the last version ?
Title: Re: Building Code::Blocks on Win 64
Post by: TDragon on August 17, 2010, 09:36:51 pm
Did you try with TDragon's multilib build of GCC ? It's not a native 64bit compiler but it should do the job until the issues with mingw-w64 have been solved...

It's the closest thing to a native 64-bit compiler you're going to find. It's configured with build, host, and target system all assigned as x86_64-w64-mingw32. Even the MinGW-w64 project itself doesn't distribute a build with this configuration.

If the fact that the compiler binaries are 32-bit is causing problems for you, I'd definitely like to hear about it.
Title: Re: Building Code::Blocks on Win 64
Post by: ironhead on August 18, 2010, 03:22:01 am
The answer is Yes, it will be incorporated in SVN. I was waiting for the new release. Now as the release process is over, I'll commit those changes to trunk. But it will take some time. At least I target committing major portion of patch to trunk within few months. There are few things holding me at the moment.

Excellent, I look forward to beta testing it! ;)

As TDragon mentioned, his TDM-GCC is excellent.  It's based on MinGW-w64 and produces native 64-bit binaries.  If you are looking for a native 64-bit gcc, I've also come across this: http://code.google.com/p/mingw-w64-dgn/ (http://code.google.com/p/mingw-w64-dgn/).

Cheers!

Chris
Title: Re: Building Code::Blocks on Win 64
Post by: Biplab on August 18, 2010, 04:08:58 pm
This could be related to this:
http://forums.codeblocks.org/index.php/topic,10908.msg87337.html#msg87337

Also on linux I get this crash:

Code
(gdb) bt
#0  0x0000000000000021 in ?? ()
#1  0x00007ffff7aa33a0 in wxPGGlobalVarsClass::~wxPGGlobalVarsClass() () from /usr/lib/libcodeblocks.so.0
#2  0x00007ffff7ab9508 in wxPGGlobalVarsClassManager::~wxPGGlobalVarsClassManager() () from /usr/lib/libcodeblocks.so.0
#3  0x00007ffff485aa25 in __cxa_finalize () from /lib/libc.so.6
#4  0x00007ffff7782556 in ?? () from /usr/lib/libcodeblocks.so.0
#5  0x0000000000000076 in ?? ()
#6  0x0000000000000000 in ?? ()
This is related to the wxPG 1.4 and happens only when I build C::B with autotools sysmem.

I'll check that thread. Thanks for the pointer. However the bug I'm mentioning is not wxPG related.

It's the closest thing to a native 64-bit compiler you're going to find. It's configured with build, host, and target system all assigned as x86_64-w64-mingw32. Even the MinGW-w64 project itself doesn't distribute a build with this configuration.

If the fact that the compiler binaries are 32-bit is causing problems for you, I'd definitely like to hear about it.

I have not tried TDM-GCC 64 bit compiler. The issue is not that the compiler binary is 32 bit; issue is resulting C::B 64 bit binary doesn't run. It crashes at startup and GDB doesn't show any useful information. I'll give TDM-GCC a try.


@Biplab: I haven't seen vityan's updated patch on the tracker so I suppose your patch "64bit-13-01-10_v1" is still the last version ?

I had posted another patch on 29/may/2010. That patch is also attached with this post.

If my current build (with wx-2.9.1) is successful, I'll post another patch.



Excellent, I look forward to beta testing it! ;)

As TDragon mentioned, his TDM-GCC is excellent.  It's based on MinGW-w64 and produces native 64-bit binaries.  If you are looking for a native 64-bit gcc, I've also come across this: http://code.google.com/p/mingw-w64-dgn/ (http://code.google.com/p/mingw-w64-dgn/).

Thanks for the pointer. I'll try them in future.

If my current build successful I'll upload a new binary. You can try that! :)

Edit 1:
Old Patch attached.
Title: Re: Building Code::Blocks on Win 64
Post by: Biplab on August 18, 2010, 06:01:33 pm
I've uploaded a new test build to the following link.

Quote
http://www.box.net/shared/qkjyd2yldy

Patch needed to build this is attached with this post.

Please note-
1) hang-on-exit bug is still there. You need to kill it using Task manager.
2) If this build crashes while opening a project / file, disable "Code Completion" plugin and then try again.
3) This build includes only Core plugins.
Title: Re: Building Code::Blocks on Win 64
Post by: billyonthemountain on August 26, 2010, 03:36:26 pm
1) hang-on-exit bug is still there. You need to kill it using Task manager.
2) If this build crashes while opening a project / file, disable "Code Completion" plugin and then try again.

Ok I did some quick and dirty testing :

=> opening codeblocks (core) project file and contrib plugins workspace causes the application to crash. disabling Code Completion plugin effectively solves the issue. (as mentioned)
=> buling codeblocks (w/ contrib plugins) using the command line works properly. The hang-on-exit bug doesn't apply in this case.
=> running codeblocks in safe mode still harbors the hang-on-exit bug.

I will try to make use of this build for my upcoming project. Will post feedback as I encounter issues.

regards, Billy

ps: I was wondering if the dumpfiles windows provides for crash reports could be of any use... If needed I'll post them too.
Title: Re: Building Code::Blocks on Win 64
Post by: Biplab on August 26, 2010, 05:53:20 pm
ps: I was wondering if the dumpfiles windows provides for crash reports could be of any use... If needed I'll post them too.

Please post them. :)
Title: Re: Building Code::Blocks on Win 64
Post by: billyonthemountain on August 26, 2010, 06:37:19 pm
Ok here (http://documents.epfl.ch/users/p/pa/paccolat/www/Crashdumps.zip) you are.
Those are the crash dumps for both cases (hang-on-exit and opening a project with CC enabled).

I have noticed two more things:
Somehow I managed to close CB without having to force it to close; however it would take about 10secs+ to close and I can't figure out how to reproduce it. Most of the time I still have to kill the program.
Second, CB doesn't crash after re-enabling CC when a project is open. Of course it still doesn't work properly afterwards...

steps to reproduce :
---
A.1:Open CB
A.2:Open the CB project file
Result: Crash
---
B.1:Open CB
B.2:Disable CC-plugin
B.3:Open the CB project file
B.4:Enable CC-plugin
Result: CB stays alive, CC not working
Title: Re: Building Code::Blocks on Win 64
Post by: Biplab on August 29, 2010, 07:11:01 am
Ok here (http://documents.epfl.ch/users/p/pa/paccolat/www/Crashdumps.zip) you are.
Those are the crash dumps for both cases (hang-on-exit and opening a project with CC enabled).

Hi Billy,

I can't unzip your crash dumps. Please post them in .7z format or use a zip file version which 7-zip can understand.

Regards,

Biplab
Title: Re: Building Code::Blocks on Win 64
Post by: ollydbg on August 29, 2010, 07:57:54 am
Ok here (http://documents.epfl.ch/users/p/pa/paccolat/www/Crashdumps.zip) you are.
Those are the crash dumps for both cases (hang-on-exit and opening a project with CC enabled).

Hi Billy,

I can't unzip your crash dumps. Please post them in .7z format or use a zip file version which 7-zip can understand.

Regards,

Biplab

I can unzip his file with 7z beta version.
Title: Re: Building Code::Blocks on Win 64
Post by: billyonthemountain on August 29, 2010, 01:32:32 pm
effectively, it seems 7-zip beta (9.15) (http://7-zip.org/) has some backwards compatibility issues...
I re-uploaded the files again but using 7z (bzip2 method). Let me know if it works...
Title: Re: Building Code::Blocks on Win 64
Post by: Biplab on August 29, 2010, 04:08:42 pm
effectively, it seems 7-zip beta (9.15) (http://7-zip.org/) has some backwards compatibility issues...
I re-uploaded the files again but using 7z (bzip2 method). Let me know if it works...

Thanks a lot. I upgraded 7-zip and then I was able to extract old file.

However I could not extract more info from the crash dumps. I need to run compiled C::B under GDB to get any meaningful trace.
Title: Re: Building Code::Blocks on Win 64
Post by: childinsilence on October 03, 2010, 12:00:16 am
I've tried to build C::B rev. 6661 on Win7 x64 wit TDM64-GCC 4.5.1.
All seems fine till the make reaches SqPlus. Then I get:
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  -std=c++0x -Wall   -I.\include -ID:\Daten\Stefan\Tools\WxWidgets\wxWidgets-2.9.1\contrib\include -I.\lib\gcc_dll\mswu -Isdk\wxscintilla\include -Isdk\wxpropgrid\include -Iinclude\tinyxml -Iinclude\scripting\include -Iinclude\scripting\sqplus  -c D:\Daten\Stefan\Entwicklung\codeblocks\trunk\src\sdk\scripting\sqplus\SquirrelBindingsUtilsWin32.cpp -o .objs\sdk\scripting\sqplus\SquirrelBindingsUtilsWin32.o
In file included from c:\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.5.1/../../../../x86_64-w64-mingw32/include/windows.h:62:0,
                 from include\scripting\sqplus/SquirrelBindingsUtilsWin32.h:7,
                 from D:\Daten\Stefan\Entwicklung\codeblocks\trunk\src\sdk\scripting\sqplus\SquirrelBindingsUtilsWin32.cpp:5:
c:\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.5.1/../../../../x86_64-w64-mingw32/include/windef.h:105:13: error: conflicting declaration 'typedef int BOOL'
include\scripting\sqplus/sqplus.h:54:21: error: 'BOOL' has a previous declaration as 'typedef SQInteger BOOL'
c:\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.5.1/../../../../x86_64-w64-mingw32/include/windef.h:132:13: error: conflicting declaration 'typedef int INT'
include\scripting\sqplus/sqplus.h:55:21: error: 'INT' has a previous declaration as 'typedef SQInteger INT'

I think there is a problem with the inclusion order and the different sizes. SQInteger is typedefed to __int64 not to int.
Title: Re: Building Code::Blocks on Win 64
Post by: daniloz on February 28, 2011, 08:52:43 pm
Just a ping...

Any news on building C::B on Win 64. I've just tried on win7 with wxWidgets 2.9.11 and I'm still hitting the SQPlus redefinition of BOOL and INT. Even after applying the patch I've found in "some post I don't remember anymore" (I'll try to provide a link here), I hit an error when compiling cbauibook.cpp, related to ProcessEvent... sorry, I don't have the log and no access to my win7 computer right now... But wanted to see if anyone has done it, anyway...

Any help is much appreciated.

Thx,
daniloz
Title: Re: Building Code::Blocks on Win 64
Post by: Biplab on January 31, 2012, 05:40:08 am
First of all, sorry for the delay in updating this thread and keeping you all up to date.

I have updated my patches to trunk and posted a new build at the following link. Patch required to build is added to the binary package and as well as also attached to this post. Grab it from the following link and let me know how it works.

Quote
http://www.box.com/s/dyh4yenh2byrgig4dpuv

Important notes:
1) CC freezes while parsing. So disable it until this is fixed.
2) Some quick testing shows "Crash-on-exit" problem is gone (with CC disabled).
3) Doesn't include any Contrib plugins.
4) Crash handler exchndl.dll is omitted as the code is broken under Win 64 bit. So if you are interested in debugging it, let me know - I'll post a build with Debugging information.
Title: Re: Building Code::Blocks on Win 64
Post by: MortenMacFly on January 31, 2012, 07:15:44 am
Quote
http://www.box.com/s/dyh4yenh2byrgig4dpuv
VERY NICE, Biplab!

I've done a lot of work in that direction, too. I'll try to integrate both of our works.

1) CC freezes while parsing. So disable it until this is fixed.
2) Some quick testing shows "Crash-on-exit" problem is gone (with CC disabled).
3) Doesn't include any Contrib plugins.
4) Crash handler exchndl.dll is omitted as the code is broken under Win 64 bit. So if you are interested in debugging it, let me know - I'll post a build with Debugging information.
Concerning 1.): I guess I've fixed this. Because it does not happen on my machine anymore.
Concerning 2.): Good to know - was it related to the Pushing 7 Popping of the event handlers, too?
Concerning 3.): I have *some* working already. But it's a pain to need another project file all the time (at least for me).
Concerning 4.): I did some work in that direction, that it will at least compile, but still not work., :-(

BTW: Did you try on Linux, too?
Title: Re: Building Code::Blocks on Win 64
Post by: Biplab on January 31, 2012, 07:52:49 am
I've done a lot of work in that direction, too. I'll try to integrate both of our works.

Good to know that. You can send me patches and I'll incorporate them & test.

Concerning 1.): I guess I've fixed this. Because it does not happen on my machine anymore.
Concerning 2.): Good to know - was it related to the Pushing 7 Popping of the event handlers, too?
Concerning 3.): I have *some* working already. But it's a pain to need another project file all the time (at least for me).
Concerning 4.): I did some work in that direction, that it will at least compile, but still not work., :-(

BTW: Did you try on Linux, too?
1) That's good news. Send / commit a patch.
2) Yes. It was related to that.
3) I'll compile them and fix if patch is necessary.
4) Awaiting your patch.

And, I didn't try it on Linux. :)
Title: Re: Building Code::Blocks on Win 64
Post by: Biplab on February 19, 2012, 10:03:29 am
A new build has been uploaded to my server. You can download it from-

Quote
http://codeblocks.biplab.in/win-64/CB_20120213_r7798_x86-64.7z

Patch (to trunk)-
Quote
http://codeblocks.biplab.in/win-64/CB_20120213_r7798_x86-64_r1_patch.7z

Important notes:
1) Contrib plugins are not included.
2) Disable CC plugin if the build is unstable.

From my next build, I'll start to include couple of Contrib plugins.
Title: Re: Building Code::Blocks on Win 64
Post by: MortenMacFly on February 19, 2012, 08:10:11 pm
Quote
http://codeblocks.biplab.in/win-64/CB_20120213_r7798_x86-64_r1_patch.7z
I still have a few differences in my patches. In addition, CC works just fine for me meanwhile on C::B 64 bit. Maybe we should really start to commit to SVN trunk (as we had discussed already) to merge our task forces.. ;-) ;D ;D ;D
Title: Re: Building Code::Blocks on Win 64
Post by: oBFusCATed on February 19, 2012, 08:29:57 pm
I don't know why you're not doing this committing stuff, already. If it doesn't break 32bit or linux build it is all ok.
Also more eyes will be inspecting your progress :)
Title: Re: Building Code::Blocks on Win 64
Post by: MortenMacFly on February 19, 2012, 09:55:41 pm
I don't know why you're not doing this committing stuff, already.
Ok... I can do it, too. You'll see the next couple of days...
Title: Re: Building Code::Blocks on Win 64
Post by: Biplab on February 19, 2012, 11:47:38 pm
Quote
http://codeblocks.biplab.in/win-64/CB_20120213_r7798_x86-64_r1_patch.7z
I still have a few differences in my patches. In addition, CC works just fine for me meanwhile on C::B 64 bit. Maybe we should really start to commit to SVN trunk (as we had discussed already) to merge our task forces.. ;-) ;D ;D ;D

I told you earlier to send your patches so that I can understand the difference. :)


I don't know why you're not doing this committing stuff, already. If it doesn't break 32bit or linux build it is all ok.
Also more eyes will be inspecting your progress :)

1) I found CC is unstable.
2) Some portions are missing. E.g., Crash Handler.
3) It uses wx-2.9.x which is not a stable release. Also my build uses wxWidgets' wxPropGrid library; instead of the one included in C::B trunk.

Thus I prefer to commit it after it gets stable and wx is bumped to wx-3.
Title: Re: Building Code::Blocks on Win 64
Post by: oBFusCATed on February 19, 2012, 11:53:11 pm
All wx2.9 builds use the wx2.9 supplied wxpropgrid, as far as I know (I've tried only to build on linux).

If 64bit changes doesn't affect the 32bit+linux, there is not point in maintaining separate patches:)
Title: Re: Building Code::Blocks on Win 64
Post by: Biplab on February 19, 2012, 11:57:05 pm
All wx2.9 builds use the wx2.9 supplied wxpropgrid, as far as I know (I've tried only to build on linux).

If 64bit changes doesn't affect the 32bit+linux, there is not point in maintaining separate patches:)

Most of my changes are wrapped in _WIN64 macro. So it should not affect Linux / 32 bit build. :)
Title: Re: Building Code::Blocks on Win 64
Post by: daniloz on February 20, 2012, 11:32:55 am
A new build has been uploaded to my server. You can download it from-
Quote
http://codeblocks.biplab.in/win-64/CB_20120213_r7798_x86-64.7z

Thanks for the release... I'm looking forward to see C::B running natively in 64-bit... :-)

However (there's always a however ;-) ), when I start C::B from your release, I got the following error:

Code
---------------------------
wxWidgets Debug Alert
---------------------------
C:\wxWidgets\include/wx/strvararg.h(453): assert "(argtype & (wxFormatStringSpecifier<T>::value)) == argtype" failed in wxArgNormalizer(): format specifier doesn't match argument type
Do you want to stop the program?
You can also choose [Cancel] to suppress further warnings.
---------------------------

My system: Win 7 64-bit
Title: Re: Building Code::Blocks on Win 64
Post by: Jenna on February 20, 2012, 12:48:33 pm
This should be fixed in actual trunk and will surely make it in Biplab's win64-build.
It also occurs on linux 64-bit with wx2.9 if debug-messages are on.

There are some more format issues, that will be fixed in trunk as far as they are found.
Title: Re: Building Code::Blocks on Win 64
Post by: Biplab on February 20, 2012, 03:48:03 pm
This should be fixed in actual trunk and will surely make it in Biplab's win64-build.
It also occurs on linux 64-bit with wx2.9 if debug-messages are on.

There are some more format issues, that will be fixed in trunk as far as they are found.

Thanks Jens for the fix.

Thanks for the release... I'm looking forward to see C::B running natively in 64-bit... :-)

However (there's always a however ;-) ), when I start C::B from your release, I got the following error:

Code
---------------------------
wxWidgets Debug Alert
---------------------------
C:\wxWidgets\include/wx/strvararg.h(453): assert "(argtype & (wxFormatStringSpecifier<T>::value)) == argtype" failed in wxArgNormalizer(): format specifier doesn't match argument type
Do you want to stop the program?
You can also choose [Cancel] to suppress further warnings.
---------------------------

My system: Win 7 64-bit

Debug messages are On (by default) in wx-2.9 series. Thus you encountered that message. I can suppress that by rebuilding wx-2.9; but I think it's a good idea to keep them on so that we can fix them.
Title: Re: Building Code::Blocks on Win 64
Post by: stahta01 on February 21, 2012, 02:53:29 am
Biplab: Your patch on a the file incrementalselectlistdlg.cpp.

Code
Index: src/sdk/incrementalselectlistdlg.cpp
===================================================================
--- src/sdk/incrementalselectlistdlg.cpp (revision 7798)
+++ src/sdk/incrementalselectlistdlg.cpp (working copy)
@@ -119,7 +119,11 @@
     if (selection == wxNOT_FOUND)
         return wxNOT_FOUND;
 
+    #if defined(_WIN64)
+    return reinterpret_cast<long long>(m_List->GetClientData(selection));
+    #else
     return reinterpret_cast<long>(m_List->GetClientData(selection));
+    #endif
 }
 
 void IncrementalSelectListDlg::FillList()

The patch I tried on Windows 32; I am NOT a well experienced C++ Programmer, so it might not be valid.

Code
Index: src/sdk/incrementalselectlistdlg.cpp
===================================================================
--- src/sdk/incrementalselectlistdlg.cpp (revision 7823)
+++ src/sdk/incrementalselectlistdlg.cpp (working copy)
@@ -119,7 +119,7 @@
     if (selection == wxNOT_FOUND)
         return wxNOT_FOUND;
 
-    return reinterpret_cast<long>(m_List->GetClientData(selection));
+    return reinterpret_cast<cbIntPtr>(m_List->GetClientData(selection));
 }
 
 void IncrementalSelectListDlg::FillList()

I have attached a small sub-set of Biplab's patch were cbIntPtr is used.
Note: I changed wxIntPtr to cbIntPtr; and maybe some more small changes.

Tim S.
Title: Re: Building Code::Blocks on Win 64
Post by: Biplab on February 21, 2012, 03:31:38 am
Tim,

I fully agree with you.

The patch I tried on Windows 32; I am NOT a well experienced C++ Programmer, so it might not be valid.

Code
Index: src/sdk/incrementalselectlistdlg.cpp
===================================================================
--- src/sdk/incrementalselectlistdlg.cpp (revision 7823)
+++ src/sdk/incrementalselectlistdlg.cpp (working copy)
@@ -119,7 +119,7 @@
     if (selection == wxNOT_FOUND)
         return wxNOT_FOUND;
 
-    return reinterpret_cast<long>(m_List->GetClientData(selection));
+    return reinterpret_cast<cbIntPtr>(m_List->GetClientData(selection));
 }
 
 void IncrementalSelectListDlg::FillList()

I have attached a small sub-set of Biplab's patch were cbIntPtr is used.
Note: I changed wxIntPtr to cbIntPtr; and maybe some more small changes.

Tim S.

I'll add your patch to my next build. Thanks for pointing this. :)

Regards,

Biplab
Title: Re: Building Code::Blocks on Win 64
Post by: MortenMacFly on February 21, 2012, 07:04:45 am
I'll add your patch to my next build. Thanks for pointing this. :)
That's how I did it, too btw...
Title: Re: Building Code::Blocks on Win 64
Post by: MortenMacFly on February 21, 2012, 07:30:37 am
I'll add your patch to my next build. Thanks for pointing this. :)
That's how I did it, too btw...
Nope, full-stop that's not fully how I did it. Since wx2.9.1 you can/should use this signature for he callback in newfromtemplatedlg.cpp safely:
int wxCALLBACK SortTemplates(wxIntPtr item1, wxIntPtr item2, wxIntPtr /*sortData*/)
...since wxIntPtr is what's expected and what's working. There is no need to use an own version.

Oh dear... probably I should really start to clean things out and commit...

BTW: I believe cbIntPtr was only relevant for wx2.9.0. Staring with wx2.9.1 and above we should use wxIntPtr IMHO.
Title: Re: Building Code::Blocks on Win 64
Post by: Biplab on February 21, 2012, 11:55:44 am
I'll add your patch to my next build. Thanks for pointing this. :)
That's how I did it, too btw...
Nope, full-stop that's not fully how I did it. Since wx2.9.1 you can/should use this signature for he callback in newfromtemplatedlg.cpp safely:
int wxCALLBACK SortTemplates(wxIntPtr item1, wxIntPtr item2, wxIntPtr /*sortData*/)
...since wxIntPtr is what's expected and what's working. There is no need to use an own version.

Oh dear... probably I should really start to clean things out and commit...

BTW: I believe cbIntPtr was only relevant for wx2.9.0. Staring with wx2.9.1 and above we should use wxIntPtr IMHO.

When I started working on it, cbIntPtr was necessary. And if you want to maintain compatibility with wx-2.8.x, you should keep cbIntPtr in the code. It'll be translated to wxIntPtr wherever applicable.

wx-2.9.x is development version and that api may change again.
Title: Re: Building Code::Blocks on Win 64
Post by: MortenMacFly on February 21, 2012, 12:43:17 pm
And if you want to maintain compatibility with wx-2.8.x, you should keep cbIntPtr in the code.
No, in recent wx2.8 wxIntPtr is defined correctly (see wx/defs.h) - so its no longer a wx2.9.x thing. So you are more safe if you use wxIntPtr meanwhile... that was my point.
Title: Re: Building Code::Blocks on Win 64
Post by: stahta01 on February 21, 2012, 01:42:34 pm
And if you want to maintain compatibility with wx-2.8.x, you should keep cbIntPtr in the code.
No, in recent wx2.8 wxIntPtr is defined correctly (see wx/defs.h) - so its no longer a wx2.9.x thing. So you are more safe if you use wxIntPtr meanwhile... that was my point.

Where is it Documented as being in 2.8; I ask because I tried your argument with using wx_str() and it failed even though it has been in every 2.8 release I checked (checked about 4 releases).

Tim S.
Title: Re: Building Code::Blocks on Win 64
Post by: Biplab on February 21, 2012, 01:58:34 pm
And if you want to maintain compatibility with wx-2.8.x, you should keep cbIntPtr in the code.
No, in recent wx2.8 wxIntPtr is defined correctly (see wx/defs.h) - so its no longer a wx2.9.x thing. So you are more safe if you use wxIntPtr meanwhile... that was my point.

My point is to keep things simple. wx-2.8 api is well established. wx-2.9 api is meant for wx-3.0. It may change over time until wx-3.0 is released. Till then I'd use wx-2.8 & wx-2.9 api separately wherever possible.

A couple of #ifdef s here and there wouldn't make any difference to the binary. It's trivial to remove them when we want to drop support of wx-2.8.

If we keep following bleeding edge wx-trunk, we may end up breaking Linux/Mac builds. If I'm not wrong, there are distros which come with older wx packages.
Title: Re: Building Code::Blocks on Win 64
Post by: MortenMacFly on February 21, 2012, 02:25:32 pm
My point is to keep things simple. wx-2.8 api is well established. wx-2.9 api is meant for wx-3.0. It may change over time until wx-3.0 is released. Till then I'd use wx-2.8 & wx-2.9 api separately wherever possible.
Full agreed.

If we keep following bleeding edge wx-trunk, we may end up breaking Linux/Mac builds. If I'm not wrong, there are distros which come with older wx packages.
Most likely I simply don't get it, but why defining an own type (cbIntPtr) if there is a type in both: wx2.8 and wx2.9 that works?

Where is it Documented as being in 2.8; I ask because I tried your argument with using wx_str() and it failed even though it has been in every 2.8 release I checked (checked about 4 releases).
Its not, I believe its not even documented in wx29... ;-) I just checked, it was introduced by JS himself in r66923, currently they are at r70626. However, I don't get what you mean with wx_str()? We are talking about {cb/wx}IntPtr here. ???
Title: Re: Building Code::Blocks on Win 64
Post by: stahta01 on February 21, 2012, 02:43:01 pm
Its not, I believe its not even documented in wx29... ;-) I just checked, it was introduced by JS himself in r66923, currently they are at r70626. However, I don't get what you mean with wx_str()? We are talking about {cb/wx}IntPtr here. ???

I was just showing the example where I was told you could NOT use a 2.9 feature in 2.8 till it is documented in 2.8; This is even true when the feature existed in both 2.6 and 2.8. There is about 100 #ifdef that are not needed in Code::Blocks because of the c_str/wx_str functions where in 2.8 wx_str is defined the same as c_str but I could not use it because it was not documented.

Tim S.
Title: Re: Building Code::Blocks on Win 64
Post by: MortenMacFly on February 21, 2012, 02:53:31 pm
There is about 100 #ifdef that are not needed in Code::Blocks because of the c_str/wx_str functions where in 2.8 wx_str is defined the same as c_str but I could not use it because it was not documented.
I agree on probably not using methods / classes that are back-ported from wx2.9.x and are either not documented or encapsulated in a special "#if wxABI_VERSION >= 208XX". But this specific function is there for ages and works. In addition it does exactly the same as the 5-liner "#ifdef" in Code::Blocks. Maybe I am missing something but honestly I don't see a reason not to use it. Did I told you so?

Quote from: wx/include/string.h
Code
    // identical to c_str(), for wxWin 1.6x compatibility
    const wxChar* wx_str()  const { return c_str(); }
Title: Re: Building Code::Blocks on Win 64
Post by: stahta01 on February 21, 2012, 03:02:26 pm
Did I told you so?

I do NOT think that you were the one who said no to it. But, one of the CB Dev team did.

I just added all the #if guards because I wanted to get the original 2.9 patch(s) applied.

I planned to submit a patch removing the #if 2.9 when wxWidgets 3.0 is released.

Tim S.

 
Title: Re: Building Code::Blocks on Win 64
Post by: MortenMacFly on February 25, 2012, 09:51:04 am
This should be fixed in actual trunk and will surely make it in Biplab's win64-build.
It also occurs on linux 64-bit with wx2.9 if debug-messages are on.
BTW: What drives me nuts are these warnings:
Code
../../src/common/menucmn.cpp(976): assert "item" failed in Enable(): attempt to enable an item which doesn't exist
Did anyone already figured out a good way how to catch them? They occur in every call to updateui, so very often and the debugger gets crazy after a while...
Title: Re: Building Code::Blocks on Win 64
Post by: Jenna on February 25, 2012, 10:01:44 am
This should be fixed in actual trunk and will surely make it in Biplab's win64-build.
It also occurs on linux 64-bit with wx2.9 if debug-messages are on.
BTW: What drives me nuts are these warnings:
Code
../../src/common/menucmn.cpp(976): assert "item" failed in Enable(): attempt to enable an item which doesn't exist
Did anyone already figured out a good way how to catch them? They occur in every call to updateui, so very often and the debugger gets crazy after a while...
I don't get them on linux.
I will try on win7, nbut I do not have a 64bit build of wx at the moment.
But I will see if I get them here also.
Title: Re: Building Code::Blocks on Win 64
Post by: MortenMacFly on February 25, 2012, 10:04:24 am
I will try on win7, nbut I do not have a 64bit build of wx at the moment.
Its not 64 bit related, but wx2.9.x and they come from OnSearchMenuUpdateUI btw...
Title: Re: Building Code::Blocks on Win 64
Post by: MortenMacFly on February 25, 2012, 10:24:11 am
Its not 64 bit related, but wx2.9.x and they come from OnSearchMenuUpdateUI btw...
...what might be related and what is not clear to me:
We load the menu like this:
Code
    wxXmlResource *myres = wxXmlResource::Get();
    myres->Load(resPath + _T("/resources.zip#zip:main_menu.xrc"));
...but the toolbar like this:
Code
    wxXmlResource *myres = wxXmlResource::Get();
    myres->Load(resPath + _T("/resources.zip#zip:*.xrc"));
Notice the *.xrc for the toolbar. Why? This cannot be any good...
Title: Re: Building Code::Blocks on Win 64
Post by: MortenMacFly on February 25, 2012, 10:44:28 am
Notice the *.xrc for the toolbar. Why? This cannot be any good...
...and another one: Dos anybody know why we don't use the Manager function to load the menubar and toolbar from the XRC files anymore?
Title: Re: Building Code::Blocks on Win 64
Post by: Jenna on April 09, 2012, 02:18:43 pm
This should be fixed in actual trunk and will surely make it in Biplab's win64-build.
It also occurs on linux 64-bit with wx2.9 if debug-messages are on.
BTW: What drives me nuts are these warnings:
Code
../../src/common/menucmn.cpp(976): assert "item" failed in Enable(): attempt to enable an item which doesn't exist
Did anyone already figured out a good way how to catch them? They occur in every call to updateui, so very often and the debugger gets crazy after a while...
This should be fixed in r7929, at least for the OnUpdateUI-stuff, but there are of course more issues, that have been hidden in wx2.8 .