{"id":731,"date":"2026-10-24T17:02:43","date_gmt":"2026-10-24T15:02:43","guid":{"rendered":"https:\/\/wp.oktay.com\/?p=731"},"modified":"2026-10-24T17:31:21","modified_gmt":"2026-10-24T15:31:21","slug":"how-to-build-codeblocks-svn-14057-with-gcc-16-2-0-and-wxwidgets-3-3-4-and-fix-user-project-templates","status":"publish","type":"post","link":"https:\/\/wp.oktay.com\/?p=731","title":{"rendered":"How to Build Code::Blocks SVN 14057 with GCC 16.2.0 and wxWidgets 3.3.4 \u2014 and Fix User Project Templates"},"content":{"rendered":"\n<h1 class=\"wp-block-heading\"><\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">This guide documents the steps I used to build Code::Blocks SVN revision 14057 on Windows and fix a bug that caused user-defined project templates to create directories instead of files.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The goal is to have a working development environment that can be reproduced later without having to rediscover all the configuration details.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/wp.oktay.com\/wp-content\/uploads\/2026\/10\/CB_Screenshot_SVN14057.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"981\" height=\"812\" src=\"https:\/\/wp.oktay.com\/wp-content\/uploads\/2026\/10\/CB_Screenshot_SVN14057.jpg\" alt=\"\" class=\"wp-image-739\" srcset=\"https:\/\/wp.oktay.com\/wp-content\/uploads\/2026\/10\/CB_Screenshot_SVN14057.jpg 981w, https:\/\/wp.oktay.com\/wp-content\/uploads\/2026\/10\/CB_Screenshot_SVN14057-300x248.jpg 300w, https:\/\/wp.oktay.com\/wp-content\/uploads\/2026\/10\/CB_Screenshot_SVN14057-767x635.jpg 767w\" sizes=\"auto, (max-width: 981px) 100vw, 981px\" \/><\/a><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">1. The Problem: User Project Templates Create Directories Instead of Files<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">When creating a new project from a user-defined template, Code::Blocks did not copy the template files correctly.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example, instead of creating:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>MyProject\/\n\u251c\u2500\u2500 main.cpp\n\u2514\u2500\u2500 MyProject.cbp<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">it created directories named after the files:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>MyProject\/\n\u251c\u2500\u2500 main.cpp\/\n\u2514\u2500\u2500 MyProject.cbp\/<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/wp.oktay.com\/wp-content\/uploads\/2026\/10\/cb_not_fixed_Screenshot-2026-10-24-130733.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"788\" height=\"597\" src=\"https:\/\/wp.oktay.com\/wp-content\/uploads\/2026\/10\/cb_not_fixed_Screenshot-2026-10-24-130733.jpg\" alt=\"\" class=\"wp-image-740\" srcset=\"https:\/\/wp.oktay.com\/wp-content\/uploads\/2026\/10\/cb_not_fixed_Screenshot-2026-10-24-130733.jpg 788w, https:\/\/wp.oktay.com\/wp-content\/uploads\/2026\/10\/cb_not_fixed_Screenshot-2026-10-24-130733-300x227.jpg 300w, https:\/\/wp.oktay.com\/wp-content\/uploads\/2026\/10\/cb_not_fixed_Screenshot-2026-10-24-130733-767x581.jpg 767w\" sizes=\"auto, (max-width: 788px) 100vw, 788px\" \/><\/a><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/wp.oktay.com\/wp-content\/uploads\/2026\/10\/CB_Screenshot-err-2026-10-20-010126.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"457\" height=\"152\" src=\"https:\/\/wp.oktay.com\/wp-content\/uploads\/2026\/10\/CB_Screenshot-err-2026-10-20-010126.jpg\" alt=\"\" class=\"wp-image-741\" srcset=\"https:\/\/wp.oktay.com\/wp-content\/uploads\/2026\/10\/CB_Screenshot-err-2026-10-20-010126.jpg 457w, https:\/\/wp.oktay.com\/wp-content\/uploads\/2026\/10\/CB_Screenshot-err-2026-10-20-010126-300x100.jpg 300w\" sizes=\"auto, (max-width: 457px) 100vw, 457px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Rebuilding Code::Blocks alone did not fix the problem. The cause was in the SDK source code responsible for creating projects from user templates.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The relevant source file is:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>src\/sdk\/templatemanager.cpp<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The function to inspect is:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>TemplateManager::NewProjectFromUserTemplate()<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">We will return to this bug after setting up the build environment.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">2. Download the Required Software<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">2.1 GCC 16.2.0 and MinGW-w64<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Download GCC from the WinLibs project:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/github.com\/niXman\/mingw-builds-binaries\/releases\/download\/16.2.0-rt_v14-rev1\/x86_64-16.2.0-release-posix-seh-ucrt-rt_v14-rev1.7z\">https:\/\/github.com\/niXman\/mingw-builds-binaries\/releases\/download\/16.2.0-rt_v14-rev1\/x86_64-16.2.0-release-posix-seh-ucrt-rt_v14-rev1.7z<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For the configuration used here, select the 64-bit GCC 16.2.0 toolchain with:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>UCRT runtime<\/li>\n\n\n\n<li>POSIX threads<\/li>\n\n\n\n<li>SEH exception handling<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The corresponding WinLibs archive was extracted to:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>D:\\mingw\\gcc16<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The compiler executables are in:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>D:\\mingw\\gcc16\\bin<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You do not need a conventional Windows installer. Extract the archive into the desired directory.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2.2 wxWidgets 3.3.4<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Official download page:<\/p>\n\n\n\n<figure class=\"wp-block-embed\"><div class=\"wp-block-embed__wrapper\">\nhttps:\/\/wxwidgets.org\/downloads\n<\/div><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">For a source build, download the Windows source archive for wxWidgets 3.3.4. The official release information is also available here:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/github.com\/wxWidgets\/wxWidgets\/releases\/tag\/v3.3.4\">https:\/\/github.com\/wxWidgets\/wxWidgets\/releases\/tag\/v3.3.4<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/github.com\/wxWidgets\/wxWidgets\/releases\/download\/v3.3.4\/wxMSW-3.3.4_gcc1620_x64_Dev.7z?utm_source=chatgpt.com\">wxMSW-3.3.4_gcc1620_x64_Dev.7z<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Important:<\/strong> Do not use GitHub&#8217;s automatically generated &#8220;Source code&#8221; archive for a source build if the wxWidgets release instructions specify the dedicated Windows source archive. The dedicated archive includes the necessary sources and submodules.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Extract wxWidgets so that the resulting source directory is:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>D:\\wx\\3.3.4<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">2.3 Code::Blocks SVN source code<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The Code::Blocks SVN repository is available here:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"http:\/\/svn.code.sf.net\/p\/codeblocks\/code\/trunk\/\">http:\/\/svn.code.sf.net\/p\/codeblocks\/code\/trunk\/<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The source directory used in this guide is:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>C:\\CodeBlocks\\14057\\src<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This guide refers to SVN revision 14057. If you use a different revision, the source code and build instructions may differ.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">3. Verify the Compiler Installation<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Open a Windows Command Prompt.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Temporarily add the compiler directory to <code>PATH<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>set PATH=D:\\mingw\\gcc16\\bin;%PATH%<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Check the installed versions:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>g++ --version\ngcc --version\nmingw32-make --version<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The compiler should report GCC 16.2.0.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If Windows reports that a command cannot be found, check the extracted directory structure. The executables must exist in:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>D:\\mingw\\gcc16\\bin<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Make sure that Code::Blocks uses this same compiler installation.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">4. Build wxWidgets 3.3.4<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">4.1 Open the correct directory<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The GCC makefile is named:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>makefile.gcc<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">In a Command Prompt, navigate to the directory containing it. In a typical wxWidgets source tree, this is:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd \/d D:\\wx\\3.3.4\\build\\msw<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Check that <code>makefile.gcc<\/code> exists before proceeding. If the source archive uses a different directory layout, adjust the path accordingly.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">4.2 Use the correct make command<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The command that worked in this environment was:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mingw32-make -f makefile.gcc -j8 SHELL=cmd.exe SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The options are:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><th>Option<\/th><th>Meaning<\/th><\/tr><tr><td><code>-f makefile.gcc<\/code><\/td><td>Use the GCC\/MinGW makefile.<\/td><\/tr><tr><td><code>-j8<\/code><\/td><td>Allow up to eight parallel build jobs.<\/td><\/tr><tr><td><code>SHELL=cmd.exe<\/code><\/td><td>Explicitly use the Windows command interpreter.<\/td><\/tr><tr><td><code>SHARED=1<\/code><\/td><td>Build shared libraries.<\/td><\/tr><tr><td><code>MONOLITHIC=1<\/code><\/td><td>Build the monolithic wxWidgets library.<\/td><\/tr><tr><td><code>BUILD=release<\/code><\/td><td>Build the release configuration.<\/td><\/tr><tr><td><code>UNICODE=1<\/code><\/td><td>Enable Unicode support.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">4.3 Why <code>SHELL=cmd.exe<\/code> matters<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The build encountered shell-related problems when GNU Make executed commands.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Explicitly specifying:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SHELL=cmd.exe<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">resolved the problem in this environment.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This is an important detail to remember when reproducing the build on Windows. If make commands fail unexpectedly, check which shell GNU Make is using before investigating unrelated compiler errors.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">4.4 Fix the Windows SDK declaration issue<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">During compilation, an error occurred involving:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SHCreateItemFromParsingName<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The declaration was gated by the <code>_WIN32_IE<\/code> version setting in the Windows SDK headers.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The configured value was too low:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>_WIN32_IE=0x0603<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The setting used to resolve this particular error was:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>_WIN32_IE=0x0700<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">After changing the setting, the build proceeded.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Do not change this macro blindly in every project.<\/strong> Check the relevant Windows SDK header and the actual compiler definitions first. This adjustment was specific to the declaration encountered during this build.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">5. Configure Code::Blocks<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">5.1 Check the compiler<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">In Code::Blocks, open:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Settings \u2192 Compiler \u2192 Toolchain executables<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Check that the selected compiler points to:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>D:\\mingw\\gcc16\\bin<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The compiler, linker and other toolchain executables should belong to the same installation.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">5.2 Check the wxWidgets global variables<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Open:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Settings \u2192 Global variables<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The existing configuration used a global variable named:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>wx33_64<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Check its base directory and all related paths.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The chosen wxWidgets source\/build directory is:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>D:\\wx\\3.3.4<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Avoid mixing paths from different installations, for example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>D:\\wx\\3.3.4\nD:\\wx\\3.3.4-gcc16<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The compiler include paths, library paths and wxWidgets configuration must all refer to the intended build.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">5.3 Fix the missing wxWidgets library<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The following linker error occurred:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ld.exe: cannot find -lwxmsw33u: No such file or directory\ncollect2.exe: error: ld returned 1 exit status<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The required import library was located in:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>D:\\wx\\3.3.4\\lib\\gcc_dll<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The linker had been given a different library directory.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Correct the settings under the project&#8217;s:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Build options \u2192 Search directories \u2192 Linker<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Make sure the active target can find:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>D:\\wx\\3.3.4\\lib\\gcc_dll<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The exact directory depends on the library layout produced by your build.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Remember that a DLL-based build requires the import library during linking. The presence of a DLL alone is not sufficient.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">After correcting the paths, clean and rebuild the affected target.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">6. Fix the User Template Bug<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">6.1 Open the source file<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Open:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>C:\\CodeBlocks\\14057\\src\\sdk\\templatemanager.cpp<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Locate:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>TemplateManager::NewProjectFromUserTemplate()<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Inspect the code that creates the destination directories and copies the template files.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">6.2 Understand the cause<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The relevant code used a destination path containing the complete file name.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>C:\\Projects\\MyProject\\main.cpp<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The problematic logic was equivalent to:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>if (!CreateDirRecursively(dst))\n    Manager::Get()-&gt;GetLogManager()-&gt;DebugLog(\n        _T(\"Failed creating directory for \") + dst);\n\nif (wxCopyFile(src, dst, true))\n{\n    \/\/ Continue processing the copied file.\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The problem is that <code>dst<\/code> represents the file destination, not just the directory.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Passing this complete path to a directory-creation function can create a directory named <code>main.cpp<\/code>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">6.3 Correct the code<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Replace the problematic block with:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>wxFileName dstName(dst);\n\nif (!CreateDirRecursively(dstName.GetPath()))\n{\n    Manager::Get()-&gt;GetLogManager()-&gt;DebugLog(\n        _T(\"Failed creating directory for \") + dstName.GetPath());\n}\n\nif (wxCopyFile(src, dst, true))\n{\n    \/\/ Continue processing the copied file.\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The key change is:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>dstName.GetPath()<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This extracts the parent directory from the destination file path.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Destination file:\nC:\\Projects\\MyProject\\main.cpp\n\nParent directory:\nC:\\Projects\\MyProject<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The directory-creation function now creates only the parent directory, and <code>wxCopyFile()<\/code> copies the actual file.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Check the surrounding function before applying the change. Also inspect other <code>CreateDirRecursively()<\/code> calls in the same function, but modify only those that incorrectly receive complete file paths.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">6.4 Rebuild and test<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">After editing the source:<\/p>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li>Rebuild the Code::Blocks SDK.<\/li>\n\n\n\n<li>Rebuild the relevant application components.<\/li>\n\n\n\n<li>Start the newly built Code::Blocks executable.<\/li>\n\n\n\n<li>Create a new project from the affected user-defined template.<\/li>\n\n\n\n<li>Check the resulting project directory.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">The expected result is that <code>main.cpp<\/code> and the other template files are created as files rather than directories.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">7. Save the Fix as an SVN Patch<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Before submitting the change, inspect the working copy.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Open a Command Prompt:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd \/d C:\\CodeBlocks\\14057\\src\nsvn status<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Check that the intended source file appears as modified:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>M       sdk\/templatemanager.cpp<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Create a patch on the desktop:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>svn diff sdk\\templatemanager.cpp &gt; \"%USERPROFILE%\\Desktop\\templatemanager.patch\"<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Review the patch before submitting it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you have repository write access, update your working copy, resolve any conflicts and test the change again before committing.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>svn update\nsvn diff sdk\\templatemanager.cpp\nsvn commit sdk\\templatemanager.cpp -m \"Fix user template file copying\"<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If you do not have write access, submit the patch through the project&#8217;s accepted contribution process instead.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">8. Quick Reference: Commands and Paths<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Compiler<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>D:\\mingw\\gcc16\\bin<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">wxWidgets<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>D:\\wx\\3.3.4<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Code::Blocks source<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>C:\\CodeBlocks\\14057\\src<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Verify GCC<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>g++ --version\ngcc --version\nmingw32-make --version<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Build wxWidgets<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Run from the directory containing <code>makefile.gcc<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mingw32-make -f makefile.gcc -j8 SHELL=cmd.exe SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Find the template implementation<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>src\/sdk\/templatemanager.cpp<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Check SVN changes<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>cd \/d C:\\CodeBlocks\\14057\\src\nsvn status<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Create the patch<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>svn diff sdk\\templatemanager.cpp &gt; \"%USERPROFILE%\\Desktop\\templatemanager.patch\"<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Final Notes<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The most important lesson from this exercise is that a successful build and a correct application are two different things.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The GCC and wxWidgets setup required careful configuration, especially the explicit Windows shell and consistent library paths. But the original template failure was a source-code logic bug: a complete file path was being used where only a directory path should have been supplied.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Correcting that path allowed Code::Blocks to create the directory structure and copy the template files correctly.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Keep this guide together with the patch file. If the same problem occurs again, you can reproduce the build, locate the relevant source function and apply the fix without repeating the entire investigation.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This guide documents the steps I used to build Code::Blocks SVN revision 14057 on Windows and fix a bug that caused user-defined project templates to create directories instead of files. The goal is to have a working development environment that can be reproduced later without having to rediscover all the configuration details. 1. The Problem:&hellip; <a class=\"more-link\" href=\"https:\/\/wp.oktay.com\/?p=731\">Continue reading <span class=\"screen-reader-text\">How to Build Code::Blocks SVN 14057 with GCC 16.2.0 and wxWidgets 3.3.4 \u2014 and Fix User Project Templates<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-731","post","type-post","status-publish","format-standard","hentry","category-bash","entry"],"_links":{"self":[{"href":"https:\/\/wp.oktay.com\/index.php?rest_route=\/wp\/v2\/posts\/731","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wp.oktay.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wp.oktay.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wp.oktay.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wp.oktay.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=731"}],"version-history":[{"count":6,"href":"https:\/\/wp.oktay.com\/index.php?rest_route=\/wp\/v2\/posts\/731\/revisions"}],"predecessor-version":[{"id":749,"href":"https:\/\/wp.oktay.com\/index.php?rest_route=\/wp\/v2\/posts\/731\/revisions\/749"}],"wp:attachment":[{"href":"https:\/\/wp.oktay.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=731"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wp.oktay.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=731"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wp.oktay.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=731"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}