| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
 |  | |||
 |  | |||
 |  | |||
 |  | |||
 |  | |||
 |  | |||
 |  | |||
 |  | |||
Code::Blocks is a free, open-source cross-platform IDE that supports various compilers.
DreamSDK is a modern, ready-to-use environment for the Sega Dreamcast development, designed for the Microsoft Windows platform. It's a package composed by a lot of pre-compiled tools; and Code::Blocks is a nice IDE which unleash the power of DreamSDK.
This repository hold a special edition of the official Code::Blocks 25.03 stable release modified for adding full support of DreamSDK.
If you are interested about Code::Blocks but not in Sega Dreamcast development using DreamSDK, you may use the official Code::Blocks release then. But if you are interested in Sega Dreamcast development using DreamSDK, and at the same time, you are interested in regular development, you can use this special edition of Code::Blocks without any issue, as the changes performed in this fork are not destructive, they only applies in DreamSDK profile.
Notables changes of this special edition of Code::Blocks includes:
The changes are located in the Code:Blocks source in the sdk, Compiler and Debugger projects. The new sdk (codeblocks.dll) module is needed to expose the required CallHooks() function in the Squirrel script (used to refresh the IDE while using the dc profile), that's why almost all compiled binaries are provided in the generated patch.
This repository will allow you to build Code::Blocks 25.03 for embedding it in the Code::Blocks Patcher for DreamSDK.
Code::Blocks 25.03 is available in both 32-bits and 64-bits. You will need to build both versions from the same source. Unlike Code::Blocks 17.12 or 20.03, Code::Blocks 25.03 does not support Windows XP: it only works with Windows 10 and later.
In summary, the goal of this repository is to generate the following packages:
These packages will be embedded in the Code::Blocks Patcher for DreamSDK (codeblocks-patcher.exe). This patcher is available in the Code::Blocks Patcher for DreamSDK repository.
This documents assumes that you're using a 64-bit Windows. 64-bit Windows can build 32-bit binaries as well.
This section contains instructions to follow after the initial cloning is complete. Install all the prerequisites below before trying to work with this repository. Some are provided for convenience while others must be downloaded manually.
These are provided directly in this repository, under the tools directory:
These are not provided in this repository but could be easily downloaded:
Just unzip the 2 WinLibs toolchains in the drive root, usually C:\:
After installing all the prerequisites, you need to build wxWidgets for Windows, i.e. wxMSW. You only need to do that once; fortunately because this process is really very long.
The .\wxMSW\bin directory will be created, that will contains both debug and release wxWidgets for Windows builds, both on 32-bit and 64-bit flavours.
Boost is used for some plugins in Code::Blocks, for example for the Nassi–Shneiderman plugin.
This section explains how to install Boost for Code::Blocks.
Unzip boost 1.87.0. The location where Boost is unzipped is called officially $BOOST_ROOT. Usually, $BOOST_ROOT will be set as C:\Program Files\boost\boost_1_87_0, but it could be C:\boost_1_87_0 or whatever you want.
Open a Windows Command prompt.
Enter the following commands:
set WINLIBS_ROOT=C:\mingw64 set CODEBLOCKS_ROOT=C:\Program Files\CodeBlocks set BOOST_ROOT=C:\Program Files\boost\boost_1_87_0 set PATH=%WINLIBS_ROOT%\bin\;%PATH% cd /D %BOOST_ROOT% bootstrap gcc b2 install --toolset=gcc "--prefix=%CODEBLOCKS_ROOT%" boost.stacktrace.from_exception=off
After running those commands, Boost is indeed installed. If using a 64-bit Windows, it will be installed for both 64-bit and 32-bit (as using the WinLibs 64-bit toolchain allow to build both CPU architectures), and of course if you compiled under a 32-bit Windows, only 32-bit has been built. Now we need to configure Code::Blocks IDE, as explained below.
To build Code::Blocks you will indeed need Code::Blocks. Install the IDE without the embedded MinGW compiler (as it isn't needed) then unzip both WinLibs toolchains if not already done (see above). Now, it's necessary to configure Debuggers and Compilers in Code::Blocks.
As always, this section assumes that you are setting up things on 64-bit Windows, but adjust the settings if necessary.
Result:
Note: This part has been written using the WinLibs official guide as base.
The Code::Blocks project is expecting to use the GNU GCC Compiler profile for 64-bit project, while the GNU GCC Compiler (32-bit) profile would be used for 32-bit Windows. Please note, the GNU GCC Compiler (32-bit) is not the official compiler expected by the Code::Blocks 32-bit source, but it make things easier as we can build both 64-bit and 32-bit Code::Blocks binaries on a single machine like this.
Let's configure the 64-bit profile, GNU GCC Compiler:
Result:
Then, select the options forcing the build of static binaries. If not doing so, you will be forced to redistribute MinGW-w64 runtime libraries (DLL), something that we don't want for Code::Blocks.
Result:
Now it's time to create the 32-bit profile, named GNU GCC Compiler (32-bit):
You can now validate the Compiler settings dialog by clicking OK.
After making this configuration, you can open the Code::Blocks IDE project in Code::Blocks.
Start Code::Blocks then open the .\codeblocks\codeblocks\src\CodeBlocks_wx32_64.workspace file for 64-bit build or the CodeBlocks_wx32.workspace file for 32-bit build.
As always in this document, we will consider that you want to build the 64-bit release, so we will open the CodeBlocks_wx32_64.workspace file. This will open the CodeBlocks Workspace wx3.2.x (64 bit) workspace in your Code::Blocks IDE.
The Global Variables window should be shown automatically, if not, select the Settings > Global Variables menu item in Code::Blocks. Select (or create) the following variables:
Here is an example of the Global Variables window filled in:

Note regarding wx32_64: In practice, we will use only the release build of wxMSW, as we won't debug wxMSW itself. But if for some reasons, you want to use the Debug builds of wxMSW, then input ${root}\wxMSW\bin\${arch}\debug in base field (and do the adaptations for the rest). You will need to update the WX_SUFFIX project variable in all projects using wxMSW:

This WX_SUFFIX variable need to be updated on all projects using wxMSW, so it could be really long to update.
You can now try to build Code::Blocks IDE in Debug mode.
Again, this part of the document assumes that 64-bit Code::Blocks will be built under WinLibs MinGW 64-bit toolchain.
You will have to check and copy the wxMSW libraries now if not already done, but this will be done only once (or as soon as you have to rebuild wxMSW for some reason). From the .\wxMSW\bin appropriate directory, copy the wxmsw32u_gcc_custom.dll and wxmsw32u_gl_gcc_custom.dll files in the .\codeblocks\src\devel32_64 directory if they aren't copied already. If you are using Debug release of wxMSW, then of course you will copy the wxmsw32ud_gcc_custom.dll and wxmsw32ud_gl_gcc_custom.dll files instead.
If you want to debug the Code::Blocks build, you must first install a DreamSDK working package in C:\DreamSDK\. If you don't have an C: drive (really?!), you have to do some changes:

Open the .\codeblocks\codeblocks\src\CodeBlocks_wx32_64.workspace if not already done.
Select the Settings > Global Variables menu item then select the cb_release_type variable and enter -O2 in the base field.
Change the content of the .\codeblocks\src\include\autorevision.h file. In normal conditions, this file is created automatically when using SVN and the autorevision tool. Or you may just create this autorevision.h file manually. The SVN revision 13644 is the official revision for the 25.03 release.
/*13644*/
//don't include this header, only configmanager-revision.cpp should do this.
#ifndef AUTOREVISION_H
#define AUTOREVISION_H
#include <wx/string.h>
namespace autorevision
{
const unsigned int svn_revision = 13644;
const wxString svnRevision(_T("13644"));
const wxString svnDate(_T("YYYY-MM-DD hh:mm:ss")); // update manually the date/time using this format
}
#endif
Rebuild the the whole workspace. Basically, you may right-click in the CodeBlocks Workspace wx3.2.x (64 bit) root node and select Rebuild workspace.
Run the .\codeblocks\src\update32_64.bat file.
The release build is stored in .\codeblocks\src\output32_64 (output32 for 32-bit).
Note: The wxMSW libraries are automatically copied from devel32_64 (devel32 for 32-bit), so you don't have to manually copy these libraries.
After building the Code::Blocks release, you need to build the package that will be embedded in the Code::Blocks Patcher for DreamSDK.
The next step is now outside of this repository: you have to copy all packages generated into the Code::Blocks Patcher for DreamSDK repository, in the following directory: .\codeblocks-patcher\src\engine\embedded\packages\. You may now build/rebuild the Code::Blocks Patcher for DreamSDK project starting from this point.
Et voilà !
Sometimes, the breakpoints are never reached. Please verify you made a Debug build of Code::Blocks by checking the cb_release_type global variable: it should be set to -g -O0 in order to activate debug symbols.
This message is sometimes shown when starting the debug build of Code::Blocks. It caused by missing image files in the .\codeblocks\src\devel\share\CodeBlocks\images\ directory.
To solve this issue, you just have to run the .\codeblocks\src\update32_64.bat file, this will copy the missing files to the devel32_64 and output32_64 directories.
| Back | FazBrowse Home | New Git URL |