<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Code::Blocks | Learn C Games Programming Blog</title>
	<atom:link href="https://learncgames.com/category/codeblocks/feed/" rel="self" type="application/rss+xml" />
	<link>https://learncgames.com</link>
	<description>A blog about C, programming games and my ebook(s).</description>
	<lastBuildDate>Wed, 06 May 2020 09:26:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://learncgames.com/wp-content/uploads/2020/03/cropped-favicon-32x32.png</url>
	<title>Code::Blocks | Learn C Games Programming Blog</title>
	<link>https://learncgames.com</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">181446779</site>	<item>
		<title>Code::Blocks revisited</title>
		<link>https://learncgames.com/codeblocks-revisited/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=codeblocks-revisited</link>
		
		<dc:creator><![CDATA[David]]></dc:creator>
		<pubDate>Sun, 17 May 2020 23:00:09 +0000</pubDate>
				<category><![CDATA[Code::Blocks]]></category>
		<category><![CDATA[Debugging]]></category>
		<category><![CDATA[SDL]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<guid isPermaLink="false">https://learncgames.com/?p=627</guid>

					<description><![CDATA[<p>So after yesterday&#8217;s post I also installed Code::Blocks on Ubuntu 20.04 LTS, the recent six monthly Ubuntu release. Guess what, it&#8217;s a much newer version of Code::Blocks that looks slightly different and does include SDL2. Although the demo program it creates is C++ not C (That coloured bar picture is the demo).  I haven&#8217;t used [&#8230;]</p>
The post <a href="https://learncgames.com/codeblocks-revisited/">Code::Blocks revisited</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></description>
										<content:encoded><![CDATA[<p><img fetchpriority="high" decoding="async" class="alignleft size-medium wp-image-630" src="https://learncgames.com/wp-content/uploads/2020/05/codeblocks_SDL2_demo-300x243.png" alt="Code::Blocks SDL2 demo" width="300" height="243" srcset="https://learncgames.com/wp-content/uploads/2020/05/codeblocks_SDL2_demo-300x243.png 300w, https://learncgames.com/wp-content/uploads/2020/05/codeblocks_SDL2_demo.png 640w" sizes="(max-width: 300px) 100vw, 300px" />So after yesterday&#8217;s post I also installed Code::Blocks on Ubuntu 20.04 LTS, the recent six monthly Ubuntu release. Guess what, it&#8217;s a much newer version of Code::Blocks that looks slightly different and does include SDL2. Although the demo program it creates is C++ not C (That coloured bar picture is the demo).  I haven&#8217;t used it enough to see what&#8217;s different between this and version 16.01.</p>
<p>The version of Code::Blocks on the 18.04LTS Ubuntu  was 16.01 and on Ubuntu 20.04 LTS it&#8217;s Code::Blocks 20.03. I keep my Ubuntus up to date but the 18.04 LTS hasn&#8217;t switched to the newer Code::Blocks which surprised me. I&#8217;m guessing that the maintainers of the 18.04 LTS Ubuntu repositories just haven&#8217;t updated their copy of Code::Blocks.</p>
<p>One thing I hadn&#8217;t explored in Code::Blocks is the debugging and this seems a lot more powerful than what you get in Visual Studio Code.   This screenshot below from version 20 shows it is more akin to Visual Studio debugging rather than Visual Studio Code debugging what with CPU registers, stack, memory dump and threads.</p>
<p><img decoding="async" class="alignleft size-medium wp-image-631" src="https://learncgames.com/wp-content/uploads/2020/05/codeblocks_debugging_menu-300x297.png" alt="Code::Blocks Debugging Menu" width="300" height="297" srcset="https://learncgames.com/wp-content/uploads/2020/05/codeblocks_debugging_menu-300x297.png 300w, https://learncgames.com/wp-content/uploads/2020/05/codeblocks_debugging_menu-150x150.png 150w, https://learncgames.com/wp-content/uploads/2020/05/codeblocks_debugging_menu.png 534w" sizes="(max-width: 300px) 100vw, 300px" /></p>
<p>&nbsp;</p>The post <a href="https://learncgames.com/codeblocks-revisited/">Code::Blocks revisited</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">627</post-id>	</item>
		<item>
		<title>So I thought I&#8217;d try Code::Blocks</title>
		<link>https://learncgames.com/so-i-thought-id-try-codeblocks/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=so-i-thought-id-try-codeblocks</link>
		
		<dc:creator><![CDATA[David]]></dc:creator>
		<pubDate>Sat, 16 May 2020 23:00:28 +0000</pubDate>
				<category><![CDATA[Code::Blocks]]></category>
		<category><![CDATA[Game]]></category>
		<category><![CDATA[IDE]]></category>
		<guid isPermaLink="false">https://learncgames.com/?p=622</guid>

					<description><![CDATA[<p>Code::Blocks is an alternative cross-platform open source IDE for C/C++ (and Fortran!). It doesn&#8217;t include a compiler but can work with most of them.  It&#8217;s also written in C++ (you&#8217;d never guess from the name!) and so is fast. Installing is just a sudo apt install codeblocks When you install it, it looks for installed [&#8230;]</p>
The post <a href="https://learncgames.com/so-i-thought-id-try-codeblocks/">So I thought I’d try Code::Blocks</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></description>
										<content:encoded><![CDATA[<div class='__iawmlf-post-loop-links' style='display:none;' data-iawmlf-post-links='[{&quot;id&quot;:725,&quot;href&quot;:&quot;http:\/\/codeblocks.org&quot;,&quot;archived_href&quot;:&quot;http:\/\/web-wp.archive.org\/web\/20260130033312\/https:\/\/www.codeblocks.org\/&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2026-02-06 17:54:47&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-11 00:01:00&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-15 11:47:26&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-23 06:30:19&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-27 11:03:45&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-14 23:14:34&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-26 11:15:57&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-04-02 16:03:10&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-04-09 20:28:32&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-15 16:00:40&quot;,&quot;http_code&quot;:206}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-04-15 16:00:40&quot;,&quot;http_code&quot;:206},&quot;process&quot;:&quot;done&quot;}]'></div>
<p><img decoding="async" class="alignleft size-full wp-image-624" src="https://learncgames.com/wp-content/uploads/2020/05/codeblocks_compiler_options.png" alt="Code::blocks compiler options" width="738" height="295" srcset="https://learncgames.com/wp-content/uploads/2020/05/codeblocks_compiler_options.png 738w, https://learncgames.com/wp-content/uploads/2020/05/codeblocks_compiler_options-300x120.png 300w" sizes="(max-width: 738px) 100vw, 738px" /></p>
<p><a title="Link to Codeblocks website" href="http://codeblocks.org/" target="_blank" rel="noopener noreferrer">Code::Blocks</a> is an alternative cross-platform open source IDE for C/C++ (<em>and Fortran</em>!). It doesn&#8217;t include a compiler but can work with most of them.  It&#8217;s also written in C++ (<em>you&#8217;d never guess from the name!)</em> and so is fast.</p>
<p>Installing is just a</p>
<pre>sudo apt install codeblocks</pre>
<p>When you install it, it looks for installed compilers and gives you the choice of which is the default.</p>
<p>When you create a project there are a few types and one that got me excited was SDL. It creates a skeletal project and it was only when compiling that I realised it was for SDL1, not 2.  It&#8217;s the nature of open source that things take time to remedy. So don&#8217;t bother with it.</p>
<p>Anyway I copied in my source files and clang objected because it couldn&#8217;t find the SDL2 files. The fix isn&#8217;t too difficult. In Code::Blocks, navigate to <em>Project Build Options</em> then in <em>Compiler settings</em> &gt;<em> Other compiler options</em> add these lines</p>
<pre>-lSDL2

-lSDL2_image

-lSDL2_mixer</pre>
<p>and in the<em> Linker settings</em> &gt; <em>Other linker options</em></p>
<pre>-lSDL2

-lSDL2_image

-lSDL2_mixer</pre>
<p>Note those are -l () not i or 1.</p>
<p>After that it compiled and linked ok. The compiled code is in the bin/Debug folder. However to get Asteroids to run you need to copy in the images, sounds, and masks folders and the highscore.txt file. After that it runs fine, but note when you compile it seems to delete everything in the folder.</p>
<p>So overall it wasn&#8217;t a difficult thing to do and I&#8217;m going to install it on a Raspberry Pi and see how that goes. I&#8217;ve already got Visual Studio Code installed on it and working but having a second IDE (both using the same compiler) is no bad thing.</p>The post <a href="https://learncgames.com/so-i-thought-id-try-codeblocks/">So I thought I’d try Code::Blocks</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">622</post-id>	</item>
	</channel>
</rss>
