<?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>Errors | Learn C Games Programming Blog</title>
	<atom:link href="https://learncgames.com/category/errors/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>Fri, 13 Jun 2025 15:05:00 +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>Errors | 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>Ever do a sudo apt update on your Raspberry Pi?</title>
		<link>https://learncgames.com/ever-do-a-sudo-apt-update-on-your-raspberry-pi/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ever-do-a-sudo-apt-update-on-your-raspberry-pi</link>
		
		<dc:creator><![CDATA[David]]></dc:creator>
		<pubDate>Fri, 13 Jun 2025 15:04:05 +0000</pubDate>
				<category><![CDATA[Errors]]></category>
		<category><![CDATA[raspberry-pi]]></category>
		<category><![CDATA[Techniques]]></category>
		<category><![CDATA[hardware clock]]></category>
		<guid isPermaLink="false">https://learncgames.com/?p=3435</guid>

					<description><![CDATA[<p>&#160; &#160; &#160; &#160; And you get this error message?  It says E: Release file for http://archive.raspberrypi.com/debian/dists/bookworm/InRelease is not valid yet (invalid for another 10h 37min 50s). Updates for this repository will not be applied. E: Release file for http://deb.debian.org/debian/dists/bookworm-updates/InRelease is not valid yet (invalid for another 12h 15min 47s). Updates for this repository will [&#8230;]</p>
The post <a href="https://learncgames.com/ever-do-a-sudo-apt-update-on-your-raspberry-pi/">Ever do a sudo apt update on your Raspberry Pi?</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-full wp-image-3436" src="https://learncgames.com/wp-content/uploads/2025/06/update.png" alt="sudo apt update error message" width="681" height="203" srcset="https://learncgames.com/wp-content/uploads/2025/06/update.png 681w, https://learncgames.com/wp-content/uploads/2025/06/update-300x89.png 300w" sizes="(max-width: 681px) 100vw, 681px" /></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>And you get this error message?  It says</p>
<pre>E: Release file for http://archive.raspberrypi.com/debian/dists/bookworm/InRelease is not valid yet 
(invalid for another 10h 37min 50s). Updates for this repository will not be applied.
E: Release file for http://deb.debian.org/debian/dists/bookworm-updates/InRelease is not valid yet 
(invalid for another 12h 15min 47s). Updates for this repository will not be applied.</pre>
<p>If you do</p>
<pre>sudo hwclock -s</pre>
<p>It will fix it. Apparently it&#8217;s to do with the hardware clock having drifted and I&#8217;m guessing this causes an error condition. Still, its an easy fix!</p>
<p>&nbsp;</p>The post <a href="https://learncgames.com/ever-do-a-sudo-apt-update-on-your-raspberry-pi/">Ever do a sudo apt update on your Raspberry Pi?</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">3435</post-id>	</item>
		<item>
		<title>And my Hyper-V Raspi error</title>
		<link>https://learncgames.com/and-my-hyper-v-raspi-error/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=and-my-hyper-v-raspi-error</link>
		
		<dc:creator><![CDATA[David]]></dc:creator>
		<pubDate>Wed, 18 Nov 2020 00:00:06 +0000</pubDate>
				<category><![CDATA[Errors]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[Visual Studio Code]]></category>
		<category><![CDATA[apt]]></category>
		<guid isPermaLink="false">https://learncgames.com/?p=1835</guid>

					<description><![CDATA[<p>Seems to be with Visual Studio Code. I said yesterday that it had got into a funny state. Well I created a new VM and installed the Raspberry Pi OS that runs in a VM and after it updated tried installing VS Code on it. It would have had the same problem had I let [&#8230;]</p>
The post <a href="https://learncgames.com/and-my-hyper-v-raspi-error/">And my Hyper-V Raspi error</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></description>
										<content:encoded><![CDATA[<p><img decoding="async" class="alignleft size-full wp-image-1836" src="https://learncgames.com/wp-content/uploads/2020/11/scary-apt-mesage.png" alt="Scary apt message" width="572" height="163" srcset="https://learncgames.com/wp-content/uploads/2020/11/scary-apt-mesage.png 572w, https://learncgames.com/wp-content/uploads/2020/11/scary-apt-mesage-300x85.png 300w" sizes="(max-width: 572px) 100vw, 572px" />Seems to be with Visual Studio Code. I said yesterday that it had got into a funny state. Well I created a new VM and installed the Raspberry Pi OS that runs in a VM and after it updated tried installing VS Code on it.</p>
<p>It would have had the same problem had I let it. The problem is it when you install VS Code, it has some unmet dependencies and in fixing them it wants to remove 8 essential packages and this breaks apt which then gets in a funny state.</p>
<p>No one wants to see this scary message! So I think I may have to use the Code.headmelted.com version on Hyper-V for a while and see if this gets resolved with the next update of VS Code. Ah the jots of software development&#8230;</p>
<p>&nbsp;</p>The post <a href="https://learncgames.com/and-my-hyper-v-raspi-error/">And my Hyper-V Raspi error</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">1835</post-id>	</item>
		<item>
		<title>Modern C &#8211; a Free Ebook</title>
		<link>https://learncgames.com/modern-c-a-free-ebook/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=modern-c-a-free-ebook</link>
		
		<dc:creator><![CDATA[David]]></dc:creator>
		<pubDate>Tue, 08 Sep 2020 23:00:35 +0000</pubDate>
				<category><![CDATA[C]]></category>
		<category><![CDATA[Errors]]></category>
		<category><![CDATA[free ebook]]></category>
		<guid isPermaLink="false">https://learncgames.com/?p=1360</guid>

					<description><![CDATA[<p>This is the 2nd edition. Author Jens Gustedt has generously allowed a free version to be downloaded from his website. If you like his book which is also published by Manning then you should consider buying a copy. He provides a 35% discount for the print or E book version. I scanned the E-book and [&#8230;]</p>
The post <a href="https://learncgames.com/modern-c-a-free-ebook/">Modern C – a Free Ebook</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;:529,&quot;href&quot;:&quot;https:\/\/modernc.gforge.inria.fr&quot;,&quot;archived_href&quot;:&quot;&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[],&quot;broken&quot;:false,&quot;last_checked&quot;:null,&quot;process&quot;:&quot;done&quot;}]'></div>
<p><img decoding="async" class="alignleft size-full wp-image-1361" src="https://learncgames.com/wp-content/uploads/2020/09/modern-c-ebook.png" alt="Modern C by Jens Gustedt" width="394" height="281" srcset="https://learncgames.com/wp-content/uploads/2020/09/modern-c-ebook.png 394w, https://learncgames.com/wp-content/uploads/2020/09/modern-c-ebook-300x214.png 300w" sizes="(max-width: 394px) 100vw, 394px" />This is the 2nd edition. Author Jens Gustedt has generously allowed a free version to be downloaded from <a title="Link to Jens Gustedt's website" href="https://modernc.gforge.inria.fr/" target="_blank" rel="nofollow noopener noreferrer">his website</a>.</p>
<p>If you like his book which is also published by Manning then you should consider buying a copy. He provides a 35% discount for the print or E book version.</p>
<p>I scanned the E-book and must admit, the bit on  signal handling taught me a lot that I didn&#8217;t know.</p>
<p>The E-book is nearly 300 pages long in 19 chapters.</p>The post <a href="https://learncgames.com/modern-c-a-free-ebook/">Modern C – a Free Ebook</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">1360</post-id>	</item>
		<item>
		<title>1566 Compile errors with just two characters!</title>
		<link>https://learncgames.com/1566-compile-errors-with-just-two-characters/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=1566-compile-errors-with-just-two-characters</link>
		
		<dc:creator><![CDATA[David]]></dc:creator>
		<pubDate>Sun, 10 May 2020 23:00:50 +0000</pubDate>
				<category><![CDATA[bugs]]></category>
		<category><![CDATA[Errors]]></category>
		<category><![CDATA[Source code]]></category>
		<category><![CDATA[syntax]]></category>
		<category><![CDATA[compile errors]]></category>
		<guid isPermaLink="false">https://learncgames.com/?p=560</guid>

					<description><![CDATA[<p>When programmers have to explain why it took longer to get something working,you don&#8217;t often here reasons like this. A simple syntax error error took me an hour to find and fix. Yet it does happen and it happened to me today. Oh sure you feel silly afterwards and it was only a 131 lines [&#8230;]</p>
The post <a href="https://learncgames.com/1566-compile-errors-with-just-two-characters/">1566 Compile errors with just two characters!</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></description>
										<content:encoded><![CDATA[<p><img loading="lazy" decoding="async" class="alignleft size-full wp-image-561" src="https://learncgames.com/wp-content/uploads/2020/04/1566-compile-errors.png" alt="1500 compile errors" width="692" height="295" srcset="https://learncgames.com/wp-content/uploads/2020/04/1566-compile-errors.png 692w, https://learncgames.com/wp-content/uploads/2020/04/1566-compile-errors-300x128.png 300w" sizes="auto, (max-width: 692px) 100vw, 692px" />When programmers have to explain why it took longer to get something working,you don&#8217;t often here reasons like this. A simple syntax error error took me an hour to find and fix. Yet it does happen and it happened to me today.</p>
<p>Oh sure you feel silly afterwards and it was only a 131 lines of C code. The very last of the 1566 compile errors was unexpected end-of-file found on line 132. That was a red herring of sorts. The error actually occurred right at the start of the program.</p>
<p>Here&#8217;s the first 10 lines. It should be quite easy to spot but when you are looking through 130 lines with a hint that it&#8217;s messed up the end of the file, it&#8217;s not so obvious.</p>
<pre><code class="language-c" data-line="">// tictactoe.c
#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;string&gt;
#include &lt;time.h&gt;

int playerIsX, computerFirst, x, y, danger, turn;
char board[3][3];  // holds X, O and space
char playerPiece, computerPiece;</code></pre>
<p>In case you haven&#8217;t spotted it, it&#8217;s the missing .h; it should be string.h not string in that 3rd #include. An obvious-in-hindsight clue is the error listing. The files that are mentioned don&#8217;t have .h on them.  (cctype, cstdint etc. Those are C++ files and string is a C++ header file. Also mention of namespace in the error message is also a big hint.</p>
<p>Still I think that sets a record for the most errors generated in a C compile! The compiler btw was Visual Studio 2019&#8217;s C/C++ compiler.</p>The post <a href="https://learncgames.com/1566-compile-errors-with-just-two-characters/">1566 Compile errors with just two characters!</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">560</post-id>	</item>
		<item>
		<title>Some useful tips for Visual Studio Code</title>
		<link>https://learncgames.com/some-useful-tips-for-visual-studio-code/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=some-useful-tips-for-visual-studio-code</link>
		
		<dc:creator><![CDATA[David]]></dc:creator>
		<pubDate>Thu, 26 Mar 2020 00:00:24 +0000</pubDate>
				<category><![CDATA[Errors]]></category>
		<category><![CDATA[Techniques]]></category>
		<category><![CDATA[Visual Studio Code]]></category>
		<guid isPermaLink="false">https://learncgames.com/?p=230</guid>

					<description><![CDATA[<p>The more I use Visual Studio Code, the more I like it and it is definitely one of the slickest pieces of software running on Linux. But I&#8217;ve found a few minor problem that are easily fixed so before I forget the fixes, here they are: UTF-16 Instead of UTF-8 You copy a file in [&#8230;]</p>
The post <a href="https://learncgames.com/some-useful-tips-for-visual-studio-code/">Some useful tips for Visual Studio Code</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></description>
										<content:encoded><![CDATA[<p>The more I use Visual Studio Code, the more I like it and it is definitely one of the slickest pieces of software running on Linux. But I&#8217;ve found a few minor problem that are easily fixed so before I forget the fixes, here they are:</p>
<h3>UTF-16 Instead of UTF-8</h3>
<p>You copy a file in from somewhere but when you try to compile it you get: <strong>fatal error: UTF-16 (LE) byte order mark detected in &#8216;/home/david/Projects/Asteroids/asteroids.c&#8217;, but encoding is not supported.</strong></p>
<p>Fixing this is quite easy; you just need to change the file type from UTF-16 to UTF-8. Visual Studio Code shows the file details at the bottom:</p>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-231" src="https://learncgames.com/wp-content/uploads/2020/03/filedetails.png" alt="File details for Visual Studio code" width="407" height="20" srcset="https://learncgames.com/wp-content/uploads/2020/03/filedetails.png 407w, https://learncgames.com/wp-content/uploads/2020/03/filedetails-300x15.png 300w" sizes="auto, (max-width: 407px) 100vw, 407px" /></p>
<p>Here you can see it&#8217;s UTF-16 LE. Click on UTF-16 and you&#8217;ll get a popup menu. Click <strong>Save with Encoding</strong> and you&#8217;ll get a list of Encodings. Just pick <strong>UTF-8 </strong>and the problem is solved.</p>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-232" src="https://learncgames.com/wp-content/uploads/2020/03/change-file-type.png" alt="Changing the type of a Visual Studio Code file" width="500" height="123" srcset="https://learncgames.com/wp-content/uploads/2020/03/change-file-type.png 500w, https://learncgames.com/wp-content/uploads/2020/03/change-file-type-300x74.png 300w" sizes="auto, (max-width: 500px) 100vw, 500px" /></p>
<h2>You want to save or copy the C/C++ JSON files</h2>
<p>But you can only do it by copying and pasting when its in the editor. The problem is they are in a hidden folder under the main folder. Visual Studio Code&#8217;s C/C++ extension uses these to hold build, debug etc. configuration details. It&#8217;s handy saving them out with source files but a bit slow doing it individually via the editor.</p>
<p>Visual Studio Code uses the main folder (I call mine Projects) and the four JSON files are in ~/Projects/.vscode</p>
<p>On Linux any folder that starts with a . is hidden.</p>
<p>If you use File Explorer, you can tell it to show hidden folders and files by clicking the top button (highlighted) then ticking the <em>Show Hidden Files</em> box. The three folders that were hidden including .vscode are now visible and you can browse, view, copy files etc.</p>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-234" src="https://learncgames.com/wp-content/uploads/2020/03/hidden-files-file-explorer.png" alt="Showing the hidden Files setting" width="664" height="305" srcset="https://learncgames.com/wp-content/uploads/2020/03/hidden-files-file-explorer.png 664w, https://learncgames.com/wp-content/uploads/2020/03/hidden-files-file-explorer-300x138.png 300w" sizes="auto, (max-width: 664px) 100vw, 664px" /></p>The post <a href="https://learncgames.com/some-useful-tips-for-visual-studio-code/">Some useful tips for Visual Studio Code</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">230</post-id>	</item>
	</channel>
</rss>
