{"id":80,"date":"2021-06-08T10:29:14","date_gmt":"2021-06-08T10:29:14","guid":{"rendered":"http:\/\/athenswonder.com\/?p=80"},"modified":"2021-06-08T10:45:16","modified_gmt":"2021-06-08T10:45:16","slug":"how-to-install-codeblock-nightly-build-with-latest-gcc-compiler-32-bit-and-64-bit","status":"publish","type":"post","link":"https:\/\/athenswonder.com\/?p=80","title":{"rendered":"How to install Codeblock nightly build with latest GCC Compiler 32 bit and 64 bit"},"content":{"rendered":"\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/nexon7.files.wordpress.com\/2013\/09\/cb.jpg?w=470\" alt=\"cb\" class=\"wp-image-850\"\/><\/figure>\n\n\n\n<p>Nightly builds have new and better features then the stable releases which are needed. It is better to use nightly build, but check comments in forum if a new, nightly build has bugs, in which case wait for another one.<\/p>\n\n\n\n<p>\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2013<br><strong>Install Codeblocks Nightly Build \u2013<\/strong><br>\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2013<br>search \u201ccodeblocks nightly\u201d in google<br>click on build you want to download like \u2013<br>The 06 August 2013 build is out<\/p>\n\n\n\n<p>Example zip or 7z file names in bracket changes with various releases.<br>How to use a nightly build \u2013 codeblocks forum post<br>download \u2013<br>1) CB nightly, (CB_20130806_rev9246_win32.7z)<br>2) mingwm10.dll, when no MingW installed on your system, (mingwm10_gcc471-TDM.7z)<br>3) wxmsw28u_gcc_cb.dll, unicode windows wxWidget dll for Code::Blocks, (wxmsw28u_gcc_cb_wx2812_gcc471-TDM.7z)<br>4) exchndl.dll, exception handler dll (for better crash reports), (exchndl_gcc471-TDM.7z)<br>from build download page.<\/p>\n\n\n\n<p>Final steps :<\/p>\n\n\n\n<p>1) unzip the CB nightly in some directory<br>2) unzip all dll\u2019s : requirement : they need to be in your PATH, most easiest is to unzip&nbsp;both of them into the same directory where you unzipped the nightly, so they reside next to the codeblocks.exe .<\/p>\n\n\n\n<p>\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2013<br><strong>Install GCC Compiler 32 bit and 64 bit TDM-GCC<\/strong><br>\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2013<\/p>\n\n\n\n<p><strong>Download MinGW-w64<\/strong><\/p>\n\n\n\n<p>GCC 7 (latest) (<a href=\"http:\/\/mingw-w64.org\/doku.php\" target=\"_blank\" rel=\"noreferrer noopener\">GCC for Windows 64 &amp; 32 bits [mingw-w64]<\/a>) or GCC 6 (stable). Use&nbsp;<a href=\"https:\/\/sourceforge.net\/projects\/mingw-w64\/files\/Toolchains%20targetting%20Win64\/Personal%20Builds\/mingw-builds\/7.1.0\/threads-win32\/seh\/x86_64-7.1.0-release-win32-seh-rt_v5-rev2.7z\" target=\"_blank\" rel=\"noreferrer noopener\">x86_64-win32-seh<\/a>&nbsp;(64 bit, SEH exceptions, win32 threads), for using std::threads with it you can use mingw-std-threads (<a href=\"https:\/\/github.com\/meganz\/mingw-std-threads\" target=\"_blank\" rel=\"noreferrer noopener\">meganz\/mingw-std-threads<\/a>) with it. or you can use&nbsp;<a href=\"https:\/\/sourceforge.net\/projects\/mingw-w64\/files\/Toolchains%20targetting%20Win64\/Personal%20Builds\/mingw-builds\/7.1.0\/threads-posix\/seh\/x86_64-7.1.0-release-posix-seh-rt_v5-rev2.7z\" target=\"_blank\" rel=\"noreferrer noopener\">x86_64-posix-seh<\/a>&nbsp;for using pthreads (unix threads) and std:threads built on pthreads but you will need to distribute winpthreads-1.dll with your exe.<\/p>\n\n\n\n<p>extract or install to \u2013<br>For example all files inside \u201cx86_64-7.1.0-release-win32-seh-rt_v5-rev2.7z\u201d go to \u201cE:\\osl\\codeblocksn\\codeblocks\u201d folder directly.<\/p>\n\n\n\n<p><strong>Download TDM-GCC<\/strong><br>search \u2013 \u201cTDM-GCC\u201d in google<br><a href=\"http:\/\/tdm-gcc.tdragon.net\/\">http:\/\/tdm-gcc.tdragon.net\/<\/a><br>download 32bit and 64bit versions (Bundle Installer) \u2013 install in some directory (outside codeblocks directory)<br>while installing \u2013<br>Uncheck checkbox \u201cCheck for updated files on the TDM-GCC server\u201d<br>In next screen<br>select \u201cComponents \u2013<br>select \u201cgcc\u201d, or expand it and select \u201copenmp\u201d<br>select \u201cgdb\u201d<br>Meaning select all compnents for both 32 bit and 64 bit TDM-GCC, so that everything is installed<\/p>\n\n\n\n<p>extract or install to \u2013<br>For example all files inside \u201cCB_20130806_rev9246_win32.7z\u201d go to&nbsp;\u201cE:\\osl\\codeblocksn\\codeblocks\u201d folder directly.<br>Example install path \u2013<br>E:\\osl\\codeblocksn\\codeblocks (CB_20130806_rev9246_win32.7z), (mingwm10_gcc471-TDM.7z), (wxmsw28u_gcc_cb_wx2812_gcc471-TDM.7z), (exchndl_gcc471-TDM.7z)<br>E:\\osl\\codeblocksn\\MinGW32 (tdm-gcc-4.7.1-2.7z)<br>E:\\osl\\codeblocksn\\MinGW64 (tdm64-gcc-4.7.1-3.7z)<\/p>\n\n\n\n<p><strong>clang<\/strong><\/p>\n\n\n\n<p>You can even setup clang(<a href=\"https:\/\/clang.llvm.org\/get_started.html\" target=\"_blank\" rel=\"noreferrer noopener\">Clang \u2013 Getting Started<\/a>) compiler with CodeBlocks.<\/p>\n\n\n\n<p>\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2013<br><strong>Codeblocks settings for New GCC Compilers<\/strong><br>\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2013<br>(*** settings are only need to be modified generally but check all)<br>(set these settings) \u2013 browse to MinGW64 directory or, just copy the name of executables from this text file and paste in appropriate boxes in settings page.<br>After installing start codeblocks \u2013<br>codeblocks \u2013<\/p>\n\n\n\n<p><a href=\"https:\/\/nexon7.files.wordpress.com\/2013\/09\/cb_tdm-gcc_mingw32_settings.png\"><\/a>codeblocks \u2013<br>32 bit<br>\u2014\u2014\u2014\u2014\u2013<br>Settings \u2013 Compiler \u2013<br>Selected Compiler \u2013 GNU GCC Compiler \u2013 ([copy], if you want to make another compiler but is not required, for 32 bit, just modify path and check c++ compiler which is wrongly<br>named to \u201cmingw32-g++.exe\u201d instead of \u201cmingw32-c++.exe\u201d)<br>Toolchain executables \u2013<br>*** Compiler\u2019s installation directory \u2013 E:\\osl\\codeblocksn\\MinGW32 (your path here)<br>these are set, just check \u2013<br>browse to MinGW32 directory \u2013<br>(set these settings)<br>C compiler \u2013 mingw32-gcc.exe<br>*** C++ compiler \u2013 mingw32-c++.exe<br>Linker for dynamic libs \u2013 mingw32-g++.exe<br>Linker for static libs \u2013 ar.exe<br>Debugger \u2013 GDB\/CDB debugger : Default<br>Resource Compiler \u2013 windres.exe<br>Make program \u2013 mingw32-make.exe<\/p>\n\n\n\n<p><a href=\"https:\/\/nexon7.files.wordpress.com\/2013\/09\/cb_tdm-gcc_mingw64_settings.png\"><\/a>codeblocks \u2013<br>64 bit<br>\u2014\u2014\u2014\u2014\u2013<br>Settings \u2013 Compiler \u2013<br>*** Selected Compiler \u2013 GNU GCC Compiler \u2013 [copy]<br>*** Give Name \u2013 GNU GCC Compiler x64<br>Toolchain executables \u2013<br>*** Compiler\u2019s installation directory \u2013 E:\\osl\\codeblocksn\\MinGW64 (your path here)<br>browse to MinGW64 directory \u2013<br>(set these settings)<br>*** C compiler \u2013 x86_64-w64-mingw32-gcc.exe<br>*** C++ compiler \u2013 x86_64-w64-mingw32-c++.exe<br>*** Linker for dynamic libs \u2013 x86_64-w64-mingw32-g++.exe<br>Linker for static libs \u2013 ar.exe<br>Debugger \u2013 GDB\/CDB debugger : Default<br>Resource Compiler \u2013 windres.exe<br>Make program \u2013 mingw32-make.exe<\/p>\n\n\n\n<p>*** [Set as default] (the 64 bit compiler or 32 bit if you want that)<\/p>\n\n\n\n<p>\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2013<br><strong>Codeblocks settings for ease of use<\/strong><br>\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2013<\/p>\n\n\n\n<p><strong>Keyboard Shortcuts \u2013<\/strong><br>\u2014\u2014\u2014\u2014\u2014\u2014\u2013<br>Settings \u2013 Editor \u2013 Keyboard Shortcuts \u2013<\/p>\n\n\n\n<p>File \u2013 Save Everything \u2013 Ctrl + Shift + S<\/p>\n\n\n\n<p>Menu bar \u2013 Build \u2013<br>Build \u2013 Ctrl + F9<br>Run \u2013 Ctrl + F10<br>*** Build and run \u2013 F9, *** F5<br>Rebuid \u2013 Ctrl + F11<br>*** Build workspace \u2013 F6<br>*** Rebuild workspace \u2013 F7<\/p>\n\n\n\n<p>These settings will help a lot if you work in both Visual Studio and Codeblocks side by side<br><strong>Syntax Highlighting like Visual Studio \u2013<\/strong><br>\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014-<br>Settings \u2013 Editor \u2013 Syntax highlighting<br>Comment (normal), Comment line (normal) \u2013 select dark green<br>Keyword, User Keyword \u2013 light dark blue<br>String, Preprocessor \u2013 maroon<br>Selection \u2013 light blue<\/p>\n\n\n\n<p>Drag Project Management box in editor to right hand side.<\/p>\n\n\n\n<p><strong>Keep Codeblocks settings \u2013<\/strong><br>\u2014\u2014\u2014\u2014\u2014\u2014\u2014<br>Codeblocks settings (what you just did) are stored in&nbsp;\u201cC:\\Users\\(user_name)\\AppData\\Roaming\u201d<br>When you use a new nightly build by deleting previous folders and extracting new zip or 7z files,<br>if you are asked to update default settings select no (all the time) so as to keep compiler settings,<br>or set them manually like above if you selected yes.<\/p>\n\n\n\n<p>\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2013<br><strong>Codeblocks Programming and project setting related tips<\/strong><br>\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2013<\/p>\n\n\n\n<p><strong>Save Workspace like Solution files \u2013<\/strong><br>\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014<br>File \u2013 New \u2013 Project<br>Then<br>File \u2013 Save workspace as&nbsp;(save where your project file is, you can add other project files in this workspace also)<br>All projects are saved in default workspace. By this you can save own workspace which is equal to solution file in Visual Studio.<\/p>\n\n\n\n<p><strong>UNICODE<\/strong><br>\u2014\u2014\u2014\u2014\u2013<br>#define UNICODE \/\/for Windows API functions<br>#define _UNICODE \/\/for C runtime functions<br>in source code using compiler #ifdef condition<br>or define in<br>\u201cProject build options \u2013 Compiler settings \u2013 #defines\u201d<br>Example \u2013<br>WIN32<br>_WIN64 (added manually for only 64 bit configurations, same in Visual Studio also in \u201cProject Properties \u2013 C\/C++ \u2013 preprocessor\u201d options)<br>UNICODE<br>_UNICODE<br>_WINDOWS<br>_CRT_SECURE_NO_DEPRECATE<br>__GNUWIN32__<\/p>\n\n\n\n<p>including static libs<br>\u2014\u2014\u2014\u2014\u2014\u2014\u2014<br>#pragma comment(lib, \u201cOpenGL32.lib\u201d)<br>is for visual studio<br>#pragma does not work in codeblocks for gcc<\/p>\n\n\n\n<p>for adding static lib like directx9 \u201cd3d.lib\u201d<br>(currently does not work while adding from project settings)<br>(Found this by comparing own project file with the default d3d9 project generated by codeblocks)<\/p>\n\n\n\n<p>Open project file, \u201cproject_name.cbp\u201d<br>go to \u2013<br>&lt;Linker&gt;<br>&lt;Add library=\u201dd3d9\u2033 \/&gt;<br>&lt;\/Linker&gt;<\/p>\n\n\n\n<p>It will look something like this<br>&lt;Linker&gt;<br>&lt;Add library=\u201dwinmm\u201d \/&gt;<br>&lt;Add library=\u201dopengl32\u2033 \/&gt;<br>&lt;Add library=\u201dgdi32\u2033 \/&gt;<br>&lt;Add library=\u201dd3d9\u2033 \/&gt;<br>&lt;\/Linker&gt;<br>&lt;Unit filename=\u201dwin_api_basic_dx9.cpp\u201d \/&gt;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Nightly builds have new and better features then the stable releases which are needed. It is better to<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"_links":{"self":[{"href":"https:\/\/athenswonder.com\/index.php?rest_route=\/wp\/v2\/posts\/80"}],"collection":[{"href":"https:\/\/athenswonder.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/athenswonder.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/athenswonder.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/athenswonder.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=80"}],"version-history":[{"count":1,"href":"https:\/\/athenswonder.com\/index.php?rest_route=\/wp\/v2\/posts\/80\/revisions"}],"predecessor-version":[{"id":81,"href":"https:\/\/athenswonder.com\/index.php?rest_route=\/wp\/v2\/posts\/80\/revisions\/81"}],"wp:attachment":[{"href":"https:\/\/athenswonder.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=80"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/athenswonder.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=80"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/athenswonder.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=80"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}