Author Topic: Building Code::Blocks on Win 64  (Read 82580 times)

Offline billyonthemountain

  • Multiple posting newcomer
  • *
  • Posts: 40
Building Code::Blocks on Win 64
« on: November 25, 2009, 01:32:21 pm »
Hello everyone,

Trying to build code:blocks using the Mingw64/msys based WPG-System64 build environmental on Windows 7 64-bits, I get the same error as pointed out in this thread (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
(ASM, C/C++)||(VISION&AI)||(EMBEDDED SYSTEMS)

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7588
    • My Best Post
Re: Building Code::Blocks on Win 64
« Reply #1 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.
« Last Edit: November 25, 2009, 02:46:43 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Halan

  • Multiple posting newcomer
  • *
  • Posts: 43
Re: Building Code::Blocks on Win 64
« Reply #2 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?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7588
    • My Best Post
Re: Building Code::Blocks on Win 64
« Reply #3 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.
« Last Edit: November 29, 2009, 04:30:49 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline billyonthemountain

  • Multiple posting newcomer
  • *
  • Posts: 40
Re: Building Code::Blocks on Win 64
« Reply #4 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...
« Last Edit: December 29, 2009, 05:25:15 pm by billyonthemountain »
(ASM, C/C++)||(VISION&AI)||(EMBEDDED SYSTEMS)

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7588
    • My Best Post
Re: Building Code::Blocks on Win 64
« Reply #5 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.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Building Code::Blocks on Win 64
« Reply #6 on: December 03, 2009, 05:02:06 pm »
Hello everyone,

Trying to build code:blocks using the Mingw64/msys based WPG-System64 build environmental on Windows 7 64-bits, I get the same error as pointed out in this thread (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. :)
« Last Edit: December 05, 2009, 05:50:11 pm by Biplab »
Be a part of the solution, not a part of the problem.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Building Code::Blocks on Win 64
« Reply #7 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.

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Building Code::Blocks on Win 64
« Reply #8 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.
Be a part of the solution, not a part of the problem.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Building Code::Blocks on Win 64
« Reply #9 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. :)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline billyonthemountain

  • Multiple posting newcomer
  • *
  • Posts: 40
Re: Building Code::Blocks on Win 64
« Reply #10 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)...
(ASM, C/C++)||(VISION&AI)||(EMBEDDED SYSTEMS)

Offline Conan Kudo

  • Multiple posting newcomer
  • *
  • Posts: 111
    • Enano CMS Project
Re: Building Code::Blocks on Win 64
« Reply #11 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.
« Last Edit: December 05, 2009, 08:50:53 pm by Pharaoh Atem »

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Building Code::Blocks on Win 64
« Reply #12 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.
Be a part of the solution, not a part of the problem.

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Building Code::Blocks on Win 64
« Reply #13 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]
« Last Edit: December 08, 2009, 05:24:52 pm by Biplab »
Be a part of the solution, not a part of the problem.

Offline billyonthemountain

  • Multiple posting newcomer
  • *
  • Posts: 40
Re: Building Code::Blocks on Win 64
« Reply #14 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
(ASM, C/C++)||(VISION&AI)||(EMBEDDED SYSTEMS)