forked from obfuscated/codeblocks_sf
-
Notifications
You must be signed in to change notification settings - Fork 3
build_windows_mingw64
bluehazzard edited this page Jun 4, 2019
·
4 revisions
- Download: https://netix.dl.sourceforge.net/project/mingw-w64/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/installer/mingw-w64-install.exe
- Install the mingw64 compiler in a folder without spaces or other non ASCII characters
- Select
Architecture:x86_64
andException:seh
in the installer
- Download: https://github.com/wxWidgets/wxWidgets/releases/download/v3.1.2/wxWidgets-3.1.2.7z
- Extract it to a folder with write privilege and no spaces or other non ASCII characters
- Download latest source from here: https://sourceforge.net/p/codeblocks/code/HEAD/tarball
- Extract it to a folder with write privilege and no spaces or other non ASCII characters
- Download a nightly build or a release version from the official codeblocks side and install it (for nightly you simply have to extract it)
- Open a cmd window by pressing the
+R on the keyboard. In the opening window you enter
cmd
and press enter - In the opening black window you type
set PATH=%PATH%;pathToCompilerBindFolder
where you have to replacepathToCompilerBindFolder
with the path to thebin
folder of your installed compiler. For example if you have installed mingw64 toC:\mingw64
then the command will look like this:set PATH=%PATH%;C:\mingw64
press enter. You can check if everything worked by typingecho %PATH%
and pressing enter. There should be shown a lot paths and at the end there should be the path to your compiler. - Go to the extraction direcotry of the wxWidgets source code by using the cd command. For example if you have extracted wxWidgets to
g:\wxWidgets
then typecd g:\wxWidgets\build\msw
- You should be in the msw build folder of wxWidgets. Now you can build wxWidgets by typing:
mingw32-make.exe -fmakefile.gcc BUILD=debug MONOLTIHIC=1 SHARED=1
and pressing enter. This can take quite some time to finish. Go drink a coffee :). If you have a multicore machine you can add-jn
where n is the number of your cores to speed up the process. So if you have 4 cpu cores the command line should be:mingw32-make.exe -j4 -fmakefile.gcc BUILD=debug MONOLTIHIC=1 SHARED=1
NOTE: this will build the debug version of wxWidgets. It takes some more space, but allows to give good feedback to the forum.
- If you want to build the latest wxWidgets trunk: Download the source from github by making a swallow clone:
git clone --depth 1 https://github.com/wxWidgets/wxWidgets.git
- init submodules:
git submodule update --init
- copy the file
include/wx/msw/setup0.h
toinclude/wx/msw/setup.h
- You should be in the msw build folder of wxWidgets.
- we build wxWidgets in two steps by typing:
-
mingw32-make.exe -fmakefile.gcc BUILD=debug MONOLTIHIC=1 SHARED=1 setup_h
and pressing enter and then -
mingw32-make.exe -fmakefile.gcc BUILD=debug MONOLTIHIC=1 SHARED=1
and again enter. This can take quite some time to finish. Go drink a coffee :). If you have a multicore machine you can add-jn
where n is the number of your cores to speed up the process. So if you have 4 cpu cores the command line should be:mingw32-make.exe -j4 -fmakefile.gcc BUILD=debug MONOLTIHIC=1 SHARED=1
NOTE: this will build the debug version of wxWidgets. It takes some more space, but allows to give good feedback to the forum.
First we have to add our new compiler to codeblocks
- Start codeblocks
- Settings->Compiler
- Select
GNU GCC Compiler
from the drop down - Hit copy -> Enter
GNU GCC Compiler mingw648
-> Ok -> Ok - In the tabs go to
Toolchain executables
you probably have to use the right arrow button to make all tabs visible - in Compiler's installation directory enter the path to your compiler installation (
C:\mingw64
in your top example) - In
Program Files
: fill in the right names for example forC Compiler: x86_64-w64-mingw32-gcc.exe
- Close the dialog with OK
- Open the
CodeBlocks_wx31_64.workspace
file - Now a dialog about global variables will open (if not you can open it with
Settings->Global
Variables)- In the list on the left select
cb_release_type
-> in the middle enter-g
in the base field - In the list on the left select
wx31_64
-> enter the path to the wxWidgets installation (g:\wxWidgets
in our case) - Close the dialog
- In the list on the left select
- Now we have to change the compiler of the workspace, because codeblocks expects the default
GNU GCC Compiler
but we use theGNU GCC Compiler mingw648
- Open the Project option manipulator plugin:
Plugins->Project Options manipulator
- Scan within: workspace
- Replace compiler
- Option/Var -> hit the ... button and select
GNU GCC Compiler
- Replace with -> hit the ... button and select
GNU GCC Compiler mingw648
- Ok
- Save the projects
- Because we use the debug build of wxWidgets we have to change the configuration of Codeblocks again with the
Plugins->Project Options manipulator
plugin:- Scan within: workspace
- Change option
- Option/Var ->
WX_SUFFIX
- Scope: Custom Var ->
ud
- Ok
- Save the projects
- Now start compiling with
Build->Build workspace