<?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>bugs | Learn C Games Programming Blog</title>
	<atom:link href="https://learncgames.com/category/bugs/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>Sun, 25 Jan 2026 13:41:57 +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>bugs | 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>The perils of updates</title>
		<link>https://learncgames.com/the-perils-of-updates/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=the-perils-of-updates</link>
		
		<dc:creator><![CDATA[David]]></dc:creator>
		<pubDate>Sun, 25 Jan 2026 13:40:29 +0000</pubDate>
				<category><![CDATA[bugs]]></category>
		<category><![CDATA[Flutter]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[snap]]></category>
		<guid isPermaLink="false">https://learncgames.com/?p=3493</guid>

					<description><![CDATA[<p>So I&#8217;ve been working on my game and to save time build the web project as a Linux app. It compiles it and runs it quicker than doing it with Chrome.  Until yesterday. After doing the usual sudo apt update and then upgrade, and snap refresh.I had updated Flutter (and Dart)  and afterwards, upgraded all [&#8230;]</p>
The post <a href="https://learncgames.com/the-perils-of-updates/">The perils of updates</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-3494" src="https://learncgames.com/wp-content/uploads/2026/01/linux-flutter-build-error.png" alt="Target dart_build failed: Error: Failed to find any of [ld.lld, ld] in LocalDirectory: '/snap/flutter/149/usr/lib/llvm-10/bin' " width="1085" height="98" srcset="https://learncgames.com/wp-content/uploads/2026/01/linux-flutter-build-error.png 1085w, https://learncgames.com/wp-content/uploads/2026/01/linux-flutter-build-error-300x27.png 300w, https://learncgames.com/wp-content/uploads/2026/01/linux-flutter-build-error-1024x92.png 1024w, https://learncgames.com/wp-content/uploads/2026/01/linux-flutter-build-error-768x69.png 768w" sizes="(max-width: 1085px) 100vw, 1085px" />So I&#8217;ve been working on my game and to save time build the web project as a Linux app. It compiles it and runs it quicker than doing it with Chrome.  Until yesterday.</p>
<p>After doing the usual <em>sudo apt update</em> and then <em>upgrade</em>, and <em>snap refresh</em>.I had updated Flutter (and Dart)  and afterwards, upgraded all of the pubspec.yaml and finally ran <em>Flutter Doctor</em>.  It output this</p>
<pre><code class="language-dart" data-line="">Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.38.7, on Ubuntu 24.04.3 LTS 6.14.0-37-generic, locale en_US.UTF-8)
[!] Android toolchain - develop for Android devices (Android SDK version 36.1.0)
    ✗ cmdline-tools component is missing.
      Try installing or updating Android Studio.
      Alternatively, download the tools from https://developer.android.com/studio#command-line-tools-only and make sure to set the ANDROID_HOME environment variable.
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/to/linux-android-setup for more details.
[✓] Chrome - develop for the web
[✓] Linux toolchain - develop for Linux desktop
[✓] Connected device (2 available)
[✓] Network resources

! Doctor found issues in 1 category.</code></pre>
<p>I&#8217;m not worried about Android so Linux and Chrome were fine; everything is up to date.  Until I tried to run the app (as Linux) and got the message at the top. It says</p>
<pre>ERROR: Target dart_build failed: Error: Failed to find any of [ld.lld, ld] in LocalDirectory: 
'/snap/flutter/149/usr/lib/llvm-10/bin'</pre>
<p>I can still run it as a Chrome web app so it&#8217;s not the end of the world; more a speed bump than a road block but still annoying. I looked up the error but there was nothing really helpful. Installing lld did not fix it.</p>
<p>I asked an AI (Chrome what I could do and it have me three alternatives).</p>
<ol>
<li>Install a symbolic link to lld but that failed as the area is read only. Even with sudo.</li>
<li>Refresh from a different snap channel but even with a full reboot after doing that it made no difference.</li>
<li>Suggests uninstalling Flutter from snap and install it manually, so that&#8217;s what I guess I have to do.</li>
</ol>
<p>What a faff!</p>The post <a href="https://learncgames.com/the-perils-of-updates/">The perils of updates</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">3493</post-id>	</item>
		<item>
		<title>Fun with Flutter</title>
		<link>https://learncgames.com/fun-with-flutter/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=fun-with-flutter</link>
		
		<dc:creator><![CDATA[David]]></dc:creator>
		<pubDate>Sun, 14 Sep 2025 11:02:23 +0000</pubDate>
				<category><![CDATA[bugs]]></category>
		<category><![CDATA[Flutter]]></category>
		<category><![CDATA[compile issues]]></category>
		<guid isPermaLink="false">https://learncgames.com/?p=3462</guid>

					<description><![CDATA[<p>So I upgraded Flutter to 3.35 and tried building an app for the Web. It failed with a weird error about the js package being deprecated. Errors a bit like this: Target dart2js failed: ProcessException: Process exited abnormally with exit code 1: Error: Couldn&#8217;t resolve the package &#8216;libphonenumber_web&#8217; in &#8216;package:libphonenumber_web/libphonenumber_web.dart&#8217;. .dart_tool/flutter_build/6872c759b3585597f59b4a698a13ca94/web_plugin_registrant.dart:9:8: Error: Not found: &#8216;package:libphonenumber_web/libphonenumber_web.dart&#8217; [&#8230;]</p>
The post <a href="https://learncgames.com/fun-with-flutter/">Fun with Flutter</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;:5,&quot;href&quot;:&quot;https:\/\/blog.flutter.dev\/whats-new-in-flutter-3-35-c58ef72e3766&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;},{&quot;id&quot;:6,&quot;href&quot;:&quot;https:\/\/docs.flutter.dev\/platform-integration\/web\/wasm&quot;,&quot;archived_href&quot;:&quot;http:\/\/web-wp.archive.org\/web\/20251217223430\/https:\/\/docs.flutter.dev\/platform-integration\/web\/wasm&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2026-02-06 10:24:24&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-09 23:16:36&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-13 13:32:15&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-16 21:49:05&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-20 06:50:25&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-23 22:40:23&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-27 07:27:51&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-02 09:40:03&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-05 22:07:30&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-09 01:19:40&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-12 02:29:27&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-15 11:41:34&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-18 12:43:56&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-21 15:14:52&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-24 15:19:16&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-27 17:41:17&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-30 19:05:43&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-04-03 04:42:38&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-06 12:34:39&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-09 13:04:09&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-12 20:07:27&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-16 02:56:02&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-19 08:49:10&quot;,&quot;http_code&quot;:206}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-04-19 08:49:10&quot;,&quot;http_code&quot;:206},&quot;process&quot;:&quot;done&quot;}]'></div>
<p>So I <a title="Link to what's new in Flutter 3.35" href="https://blog.flutter.dev/whats-new-in-flutter-3-35-c58ef72e3766" target="_blank" rel="noopener">upgraded Flutter to 3.35</a> and tried building an app for the Web. It failed with a weird error about the <em>js</em> package being deprecated. Errors a bit like this:</p>
<p><em>Target dart2js failed: ProcessException: Process exited abnormally with exit code 1:</em><br />
<em>Error: Couldn&#8217;t resolve the package &#8216;libphonenumber_web&#8217; in &#8216;package:libphonenumber_web/libphonenumber_web.dart&#8217;.</em><br />
<em>.dart_tool/flutter_build/6872c759b3585597f59b4a698a13ca94/web_plugin_registrant.dart:9:8:</em><br />
<em>Error: Not found: &#8216;package:libphonenumber_web/libphonenumber_web.dart&#8217;</em><br />
<em>import &#8216;package:libphonenumber_web/libphonenumber_web.dart&#8217;;</em></p>
<p>I&#8217;d been experimenting with <em>flutter_login</em> package and it was in the projects pubspec.yaml.  I found this out by using this command:</p>
<pre>flutter pub deps</pre>
<p>Which provides a full and detailed tree of all package dependencies. Like this but 260 lines in total!</p>
<p><em>turfwar 1.0.0+1</em><br />
<em>|&#8211; badges 3.1.2</em><br />
<em>| &#8216;&#8211; flutter&#8230;</em><br />
<em>|&#8211; cupertino_icons 1.0.8</em><br />
<em>|&#8211; flutter 0.0.0</em><br />
<em>| |&#8211; characters 1.4.0</em><br />
<em>| |&#8211; collection 1.19.1</em><br />
<em>| |&#8211; material_color_utilities 0.11.1</em><br />
<em>| | &#8216;&#8211; collection&#8230;</em><br />
<em>| |&#8211; meta 1.16.0</em><br />
<em>| |&#8211; sky_engine 0.0.0</em><br />
<em>| &#8216;&#8211; vector_math 2.2.0</em><br />
<em>|&#8211; flutter_lints 6.0.0</em><br />
<em>| &#8216;&#8211; lints 6.0.0</em><br />
<em>|&#8211; flutter_test 0.0.0</em></p>
<p><em>js</em> was used by <em>libphonenumber</em> which was part of <em>flutter_login</em>.  However despite removing that from pubspec.yaml and removing the package files, the <em>flutter build web</em> command was still complaining about it.</p>
<p>The trick to solving that is just to delete the <em>.dart_tool </em>folder. It&#8217;s regenerated by the flutter build command so is safe to delete.</p>
<p><img decoding="async" class="alignleft size-full wp-image-3463" src="https://learncgames.com/wp-content/uploads/2025/09/flutter_project.png" alt="Flutter project screenshot" width="468" height="223" srcset="https://learncgames.com/wp-content/uploads/2025/09/flutter_project.png 468w, https://learncgames.com/wp-content/uploads/2025/09/flutter_project-300x143.png 300w" sizes="(max-width: 468px) 100vw, 468px" /></p>
<p>There&#8217;s a new feature now, you can add <em>&#8211;wasm</em> on the end of the <em>flutter build web</em> command to have it use wasm. More on this official <a title="Link to flutter web with wasm page" href="https://docs.flutter.dev/platform-integration/web/wasm" target="_blank" rel="noopener">flutter wasm page</a> which includes a link to a neat demo project called <strong>wonderous </strong>that is worth a look; the source to that is available on GitHub as well..</p>The post <a href="https://learncgames.com/fun-with-flutter/">Fun with Flutter</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">3462</post-id>	</item>
		<item>
		<title>Great mysteries &#8211; number 1</title>
		<link>https://learncgames.com/great-mysteries-number-1/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=great-mysteries-number-1</link>
		
		<dc:creator><![CDATA[David]]></dc:creator>
		<pubDate>Thu, 28 Aug 2025 08:37:45 +0000</pubDate>
				<category><![CDATA[bugs]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[Hyper-V]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<guid isPermaLink="false">https://learncgames.com/?p=3453</guid>

					<description><![CDATA[<p>I run Ubuntu in a hyper-V session.  It works very well and handy for getting screenshots. I&#8217;ve been using a 24.04 LTS for a while and decided I needed another one to test CyberPanel. i already have Webmin on my main one so wanted a clean Ubuntu so as not to mess Webmin.  It took [&#8230;]</p>
The post <a href="https://learncgames.com/great-mysteries-number-1/">Great mysteries – number 1</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-large wp-image-3454" src="https://learncgames.com/wp-content/uploads/2025/08/hyper-v_issue-1024x579.png" alt="Hyper-v that refuses to become fullscreen!" width="1024" height="579" srcset="https://learncgames.com/wp-content/uploads/2025/08/hyper-v_issue-1024x579.png 1024w, https://learncgames.com/wp-content/uploads/2025/08/hyper-v_issue-300x170.png 300w, https://learncgames.com/wp-content/uploads/2025/08/hyper-v_issue-768x434.png 768w, https://learncgames.com/wp-content/uploads/2025/08/hyper-v_issue-1536x869.png 1536w, https://learncgames.com/wp-content/uploads/2025/08/hyper-v_issue.png 1910w" sizes="(max-width: 1024px) 100vw, 1024px" />I run Ubuntu in a hyper-V session.  It works very well and handy for getting screenshots. I&#8217;ve been using a 24.04 LTS for a while and decided I needed another one to test CyberPanel. i already have Webmin on my main one so wanted a clean Ubuntu so as not to mess Webmin.  It took ten minutes to setup then another 20 minutes to install 300+ updates.</p>
<p>Then I edited Grub to give me a fullscreen- 1920 x 1080.  You just edit /etc/default/grub with an editor run under sudo. I use Gedit but nano will do. Just change the line to this:</p>
<pre>GRUB_CMDLINE_LINUX_DEFAULT="quiet splash video=hyperv_fb:1920x1080"</pre>
<p>followed by</p>
<pre>sudo update-grub</pre>
<p>and that should be it. Only it didn&#8217;t work in my new Ubuntu 24.04 LTS VM. I installed ifconfig from net-tools, connected to it from my Windows PC and copied grub across. I did the same with my older 24.04 LTS VM and compared the two grub files. Both identical yet one works fullscreen and the newer one doesn&#8217;t. Any ideas?</p>The post <a href="https://learncgames.com/great-mysteries-number-1/">Great mysteries – number 1</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">3453</post-id>	</item>
		<item>
		<title>Rust on Windows &#8211; problem with sdl2.lib</title>
		<link>https://learncgames.com/rust-on-windows-problem-with-sdl2-lib/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=rust-on-windows-problem-with-sdl2-lib</link>
		
		<dc:creator><![CDATA[David]]></dc:creator>
		<pubDate>Sun, 06 Apr 2025 12:59:46 +0000</pubDate>
				<category><![CDATA[bugs]]></category>
		<category><![CDATA[Rust]]></category>
		<category><![CDATA[SDL]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[compile error]]></category>
		<category><![CDATA[fix]]></category>
		<category><![CDATA[SDL2]]></category>
		<guid isPermaLink="false">https://learncgames.com/?p=3364</guid>

					<description><![CDATA[<p>I&#8217;m currently unable to compile Rust programs that use SDL2 on Windows. No problems on Ubuntu or Raspberry Pi OS, just Windows 11. Although it says cannot open input file SDL2.lib, I think the problem is a parameter passed into Link.exe. The text from the image above is listed below- I&#8217;ve broken it to make [&#8230;]</p>
The post <a href="https://learncgames.com/rust-on-windows-problem-with-sdl2-lib/">Rust on Windows – problem with sdl2.lib</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></description>
										<content:encoded><![CDATA[<p>I&#8217;m currently unable to compile Rust programs that use SDL2 on Windows. No problems on Ubuntu or Raspberry Pi OS, just Windows 11.<br />
<img loading="lazy" decoding="async" class="alignleft size-large wp-image-3365" src="https://learncgames.com/wp-content/uploads/2025/04/compiling_sdl2_on_windows-1024x174.png" alt="Compiling an SDL2 app (in Rust) on Windows" width="1024" height="174" srcset="https://learncgames.com/wp-content/uploads/2025/04/compiling_sdl2_on_windows-1024x174.png 1024w, https://learncgames.com/wp-content/uploads/2025/04/compiling_sdl2_on_windows-300x51.png 300w, https://learncgames.com/wp-content/uploads/2025/04/compiling_sdl2_on_windows-768x130.png 768w, https://learncgames.com/wp-content/uploads/2025/04/compiling_sdl2_on_windows.png 1213w" sizes="auto, (max-width: 1024px) 100vw, 1024px" />Although it says cannot open input file SDL2.lib, I think the problem is a parameter passed into Link.exe.</p>
<p>The text from the image above is listed below- I&#8217;ve broken it to make it readable as it&#8217;s displayed preformatted and unmodified it is all on a single very wide line!</p>
<pre> = note: "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.43.34808\\bin\\HostX64\\x64\\link.exe" 
"/NOLOGO" "C:\\Users\\dhbol\\AppData\\Local\\Temp\\rustcA1PhoK\\symbols.o" "&lt;70 object files omitted&gt;" 
"D:\\development\\rustapps\\choice\\target\\debug\\deps/{libsdl2-f8d94d30d19bed49.rlib,libsdl2_sys-325e30d8e9547ff4.rlib,
libbitflags-d15393d08e2f31fc.rlib,liblazy_static-c28c0e13093a4168.rlib,liblibc-851e0bf801239f69.rlib}.rlib" 
"&lt;sysroot&gt;\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib/{libstd-*,libpanic_unwind-*,libwindows_targets-*,
librustc_demangle-*,libstd_detect-*,libhashbrown-*,librustc_std_workspace_alloc-*,libunwind-*,libcfg_if-*,liballoc-*,
librustc_std_workspace_core-*,libcore-*,libcompiler_builtins-*}.rlib" "SDL2.lib" "SDL2_image.lib" "SDL2_ttf.lib" 
"legacy_stdio_definitions.lib" "kernel32.lib" "kernel32.lib" "advapi32.lib" "ntdll.lib" "userenv.lib" "ws2_32.lib" 
"dbghelp.lib" "/defaultlib:msvcrt" "/NXCOMPAT" "/OUT:D:\\development\\rustapps\\choice\\target\\debug\\deps\\choice.exe" 
"/OPT:REF,NOICF" "/DEBUG" "/PDBALTPATH:%_PDB%" "/NATVIS:&lt;sysroot&gt;\\lib\\rustlib\\etc\\intrinsic.natvis" 
"/NATVIS:&lt;sysroot&gt;\\lib\\rustlib\\etc\\liballoc.natvis" "/NATVIS:&lt;sysroot&gt;\\lib\\rustlib\\etc\\libcore.natvis" 
"/NATVIS:&lt;sysroot&gt;\\lib\\rustlib\\etc\\libstd.natvis"
= note: some arguments are omitted. use `--verbose` to show all linker arguments
= note: LINK : fatal error LNK1181: cannot open input file 'SDL2.lib'␍</pre>
<p>But if you try running part of it like the first line<br />
&#8220;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.43.34808\\bin\\HostX64\\x64\\link.exe&#8221;<br />
&#8220;/NOLOGO&#8221; &#8220;C:\\Users\\dhbol\\AppData\\Local\\Temp\\rustcA1PhoK\\symbols.o&#8221;</p>
<p>Well the path to link..exe is correct, but there&#8217;s no  rustcA1PhoK\symbols.o in that temp folder. Any suggestions welcomed&#8230;</p>
<h2>I just solved it.</h2>
<p>I&#8217;ve left this in, in case anyone else has this problem.</p>
<p>You need to add an environment variable LIB with the address of the SDL .lib files including ttf, image and mixer. Make sure they&#8217;re all in this folder:</p>
<p>C:\Users\<strong>dhbol</strong>\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib</p>
<p>The bold part of the path will be different on you PC.</p>
<p>In File Explorer, right-click on <strong>This PC </strong>then click Properties on the popup menu.</p>
<p><img loading="lazy" decoding="async" class="alignleft size-full wp-image-3372" src="https://learncgames.com/wp-content/uploads/2025/04/this_pc.png" alt="File Explorer - This PC,." width="170" height="70" /></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>It&#8217;ll open Settings &#8211; About, and you need to click <strong>Advanced system settings</strong>.</p>
<p><img loading="lazy" decoding="async" class="alignleft size-medium wp-image-3374" src="https://learncgames.com/wp-content/uploads/2025/04/settings_about-300x154.png" alt="settings_about" width="300" height="154" srcset="https://learncgames.com/wp-content/uploads/2025/04/settings_about-300x154.png 300w, https://learncgames.com/wp-content/uploads/2025/04/settings_about.png 600w" sizes="auto, (max-width: 300px) 100vw, 300px" /></p>
<p>This opens System Properties and on that you click <strong>Environment variables</strong>.</p>
<p><img loading="lazy" decoding="async" class="alignleft size-medium wp-image-3375" src="https://learncgames.com/wp-content/uploads/2025/04/System_properties-264x300.png" alt="System properties on Windows" width="264" height="300" srcset="https://learncgames.com/wp-content/uploads/2025/04/System_properties-264x300.png 264w, https://learncgames.com/wp-content/uploads/2025/04/System_properties.png 412w" sizes="auto, (max-width: 264px) 100vw, 264px" /></p>
<p><img loading="lazy" decoding="async" class="alignleft wp-image-3376 size-full" src="https://learncgames.com/wp-content/uploads/2025/04/environment_variables.png" alt="Environment variables popup on Windows" width="646" height="585" srcset="https://learncgames.com/wp-content/uploads/2025/04/environment_variables.png 646w, https://learncgames.com/wp-content/uploads/2025/04/environment_variables-300x272.png 300w" sizes="auto, (max-width: 646px) 100vw, 646px" /></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Now just click New and add Lib and that path It should look something like mine. Now reopen Visual Studio and your SDL2 Rust app should now build and run.</p>The post <a href="https://learncgames.com/rust-on-windows-problem-with-sdl2-lib/">Rust on Windows – problem with sdl2.lib</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">3364</post-id>	</item>
		<item>
		<title>Interesting bug with controllermap</title>
		<link>https://learncgames.com/interesting-bug-with-controllermap/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=interesting-bug-with-controllermap</link>
		
		<dc:creator><![CDATA[David]]></dc:creator>
		<pubDate>Sun, 23 Mar 2025 14:35:44 +0000</pubDate>
				<category><![CDATA[bugs]]></category>
		<category><![CDATA[raspberry-pi]]></category>
		<category><![CDATA[SDL]]></category>
		<category><![CDATA[utility]]></category>
		<guid isPermaLink="false">https://learncgames.com/?p=3356</guid>

					<description><![CDATA[<p>So I&#8217;ve been playing with a Rust program that uses the config string generated by controllermap. It shows all the keys and the text of a particular button turns green when you press it and it shows PRESSED/RELEASED. But it got A and B buttons mixed up and also X and Y. I&#8217;d press A, [&#8230;]</p>
The post <a href="https://learncgames.com/interesting-bug-with-controllermap/">Interesting bug with controllermap</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 wp-image-3357" src="https://learncgames.com/wp-content/uploads/2025/03/test.png" alt="Running a Rust program to show gamepad controls" width="500" height="390" srcset="https://learncgames.com/wp-content/uploads/2025/03/test.png 801w, https://learncgames.com/wp-content/uploads/2025/03/test-300x234.png 300w, https://learncgames.com/wp-content/uploads/2025/03/test-768x598.png 768w" sizes="auto, (max-width: 500px) 100vw, 500px" /></p>
<p>So I&#8217;ve been playing with a Rust program that uses the config string generated by <a title="Link to blog post about controllermap" href="https://learncgames.com/new-tutorial-posted-how-to-build-controllermap-in-linux/" target="_blank" rel="noopener">controllermap</a>. It shows all the keys and the text of a particular button turns green when you press it and it shows PRESSED/RELEASED.</p>
<p>But it got A and B buttons mixed up and also X and Y. I&#8217;d press A, it highlighted B etc.</p>
<p>I checked my code, it wasn&#8217;t there. I ran controllermap again and it generated a similar config string.</p>
<p>I then went back to the Pi version of Asteroids, put it on a Pi, started debugging it, pressed the fire button and it hit the line of code for the A button. D&#8217;oh.</p>
<p>The only conclusion I can come up with is that controllermap gets it wrong for my gamepad. I had somehow missed it when I added gamepad control for the Asteroid Pi.</p>
<p>It&#8217;s quite easy to fix.  This is what the full text in gamepad.txt look like.</p>
<pre>030000001008000001e5000010010000,usb gamepad,platform:Linux,crc:417e,<strong>a:b2,b:b1,x:b3,y:b0</strong>,back:b8,start:b9,leftshoulder:b4,rightshoulder:b5,leftx:a0,lefty:a1,</pre>
<p>but we&#8217;re only interesed in the button mappings for a,b, x and y which are in bold.</p>
<p>a:b2,b:b1,x:b3,y:b0,</p>
<p>Just swap the a b mappings and the x and y so it looks like</p>
<pre>a:b1,b:b2,x:b0,y,b3</pre>
<p>Then save the file and it now works correctly.</p>
<p>&nbsp;</p>The post <a href="https://learncgames.com/interesting-bug-with-controllermap/">Interesting bug with controllermap</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">3356</post-id>	</item>
		<item>
		<title>Yet another fix</title>
		<link>https://learncgames.com/yet-another-fix/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=yet-another-fix</link>
		
		<dc:creator><![CDATA[David]]></dc:creator>
		<pubDate>Mon, 10 Mar 2025 00:05:24 +0000</pubDate>
				<category><![CDATA[bugs]]></category>
		<category><![CDATA[Visual Studio Code]]></category>
		<category><![CDATA[bug fix]]></category>
		<guid isPermaLink="false">https://learncgames.com/?p=3335</guid>

					<description><![CDATA[<p>But no AI generated image this time. The problem seems to be with Electron which is the technology that drives VS Code. Normally I use code or code . when I&#8217;ve opened a terminal and done a cd to the folder containing the project. What fiuxes the VS Code crash with Error 5 is adding [&#8230;]</p>
The post <a href="https://learncgames.com/yet-another-fix/">Yet another fix</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;:21,&quot;href&quot;:&quot;https:\/\/github.com\/microsoft\/vscode\/issues\/242742&quot;,&quot;archived_href&quot;:&quot;http:\/\/web-wp.archive.org\/web\/20250805032038\/https:\/\/github.com\/microsoft\/vscode\/issues\/242742&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2026-02-06 10:46:46&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-10 16:17:05&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-14 11:56:31&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-18 15:19:50&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-27 11:02:56&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-05 16:13:18&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-12 21:44:41&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-15 21:48:20&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-20 18:40:04&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-24 13:03:14&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-31 19:02:00&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-04 23:32:21&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-08 23:48:46&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-12 19:15:10&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-16 02:56:20&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-19 08:52:01&quot;,&quot;http_code&quot;:206}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-04-19 08:52:01&quot;,&quot;http_code&quot;:206},&quot;process&quot;:&quot;done&quot;}]'></div>
<p>But no AI generated image this time.</p>
<p>The problem seems to be with Electron which is the technology that drives VS Code.</p>
<p>Normally I use code or code . when I&#8217;ve opened a terminal and done a cd to the folder containing the project.</p>
<p>What fiuxes the VS Code crash with Error 5 is adding this on the end of the command</p>
<pre>--js-flags="--nodecommit_pooled_pages"</pre>
<p>so use either of these.</p>
<pre>code --js-flags="--nodecommit_pooled_pages" or 

code . --js-flags="--nodecommit_pooled_pages"</pre>
<p>I&#8217;ve tested it with my Pi 4 and it has been rock solid. The bug report and the fix are <a title="Link to bug report on GitHub" href="https://github.com/microsoft/vscode/issues/242742" target="_blank" rel="noopener">here</a> on GitHub.</p>The post <a href="https://learncgames.com/yet-another-fix/">Yet another fix</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">3335</post-id>	</item>
		<item>
		<title>So I bought a Raspberry PI 5 and VS Code crashes!</title>
		<link>https://learncgames.com/so-i-bought-a-raspberry-pi-5-and-vs-code-crashes/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=so-i-bought-a-raspberry-pi-5-and-vs-code-crashes</link>
					<comments>https://learncgames.com/so-i-bought-a-raspberry-pi-5-and-vs-code-crashes/#comments</comments>
		
		<dc:creator><![CDATA[David]]></dc:creator>
		<pubDate>Sun, 09 Mar 2025 00:05:21 +0000</pubDate>
				<category><![CDATA[bugs]]></category>
		<category><![CDATA[Rust]]></category>
		<category><![CDATA[Visual Studio Code]]></category>
		<category><![CDATA[crash]]></category>
		<guid isPermaLink="false">https://learncgames.com/?p=3330</guid>

					<description><![CDATA[<p>And the first thing I did after assembling it, was install VS Code and Rust.  And irritatingly, there&#8217;s some kind of a bug with the current version of VS Code. 1.97. Open a project- say for a Rust application and view the source code. After a few seconds or so it crashes with a The [&#8230;]</p>
The post <a href="https://learncgames.com/so-i-bought-a-raspberry-pi-5-and-vs-code-crashes/">So I bought a Raspberry PI 5 and VS Code crashes!</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-3332" src="https://learncgames.com/wp-content/uploads/2025/03/crash.png" alt="Crash on VS Code running on a Reaspberry Pi 5." width="606" height="208" srcset="https://learncgames.com/wp-content/uploads/2025/03/crash.png 606w, https://learncgames.com/wp-content/uploads/2025/03/crash-300x103.png 300w" sizes="auto, (max-width: 606px) 100vw, 606px" /></p>
<p>And the first thing I did after assembling it, was install VS Code and Rust.  And irritatingly, there&#8217;s some kind of a bug with the current version of VS Code. 1.97.</p>
<p>Open a project- say for a Rust application and view the source code. After a few seconds or so it crashes with a <strong>The window terminated unexpectedly (reason: &#8216;crashed&#8217;, code 5).</strong></p>
<p>I also updated my Raspberry Pi 4B, installed Rust and got the same crash with it.</p>
<p>Thankfully Raspis come with <strong>grim</strong> which lets you do screenshots on Wayland.</p>
<p>Want to know if your system is running Wayland? From a terminal run this command:</p>
<p>echo &#8220;$XDG_SESSION_TYPE&#8221;</p>
<p>And you&#8217;ll either get <em>wayland</em> or <em>x11</em>.</p>
<p>So I hope the VS Code issue gets fixed soon.</p>The post <a href="https://learncgames.com/so-i-bought-a-raspberry-pi-5-and-vs-code-crashes/">So I bought a Raspberry PI 5 and VS Code crashes!</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></content:encoded>
					
					<wfw:commentRss>https://learncgames.com/so-i-bought-a-raspberry-pi-5-and-vs-code-crashes/feed/</wfw:commentRss>
			<slash:comments>6</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">3330</post-id>	</item>
		<item>
		<title>So I found the fix</title>
		<link>https://learncgames.com/so-i-found-the-fix/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=so-i-found-the-fix</link>
		
		<dc:creator><![CDATA[David]]></dc:creator>
		<pubDate>Sun, 23 Feb 2025 20:03:51 +0000</pubDate>
				<category><![CDATA[bugs]]></category>
		<category><![CDATA[Rust]]></category>
		<category><![CDATA[SDL]]></category>
		<category><![CDATA[Tips]]></category>
		<guid isPermaLink="false">https://learncgames.com/?p=3312</guid>

					<description><![CDATA[<p>Well actually I asked Microsoft&#8217;s CoPilot AI and it sorted it! This is what you need in the dependencies section in cargo.toml [dependencies] sdl2-sys = &#34;*&#34; sdl2 = { version = &#34;0.37&#34;, features = [&#34;image&#34;,&#34;ttf&#34;] } It compiled with no problems after saving that.</p>
The post <a href="https://learncgames.com/so-i-found-the-fix/">So I found the fix</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-3314" src="https://learncgames.com/wp-content/uploads/2025/02/its-fixed.png" alt="It's fixed text on a technology background" width="752" height="436" srcset="https://learncgames.com/wp-content/uploads/2025/02/its-fixed.png 752w, https://learncgames.com/wp-content/uploads/2025/02/its-fixed-300x174.png 300w" sizes="auto, (max-width: 752px) 100vw, 752px" />Well actually I asked Microsoft&#8217;s CoPilot AI and it sorted it!</p>
<p>This is what you need in the dependencies section in cargo.toml</p>
<pre><code class="language-yaml" data-line="">[dependencies]
sdl2-sys = &quot;*&quot;
sdl2 = { version = &quot;0.37&quot;, features = [&quot;image&quot;,&quot;ttf&quot;] }</code></pre>
<p>It compiled with no problems after saving that.</p>The post <a href="https://learncgames.com/so-i-found-the-fix/">So I found the fix</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">3312</post-id>	</item>
		<item>
		<title>A slight problem with SDL2 and Rust</title>
		<link>https://learncgames.com/a-slight-problem-with-sdl2-and-rust/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=a-slight-problem-with-sdl2-and-rust</link>
		
		<dc:creator><![CDATA[David]]></dc:creator>
		<pubDate>Sat, 22 Feb 2025 00:05:18 +0000</pubDate>
				<category><![CDATA[bugs]]></category>
		<category><![CDATA[Rust]]></category>
		<category><![CDATA[SDL]]></category>
		<guid isPermaLink="false">https://learncgames.com/?p=3308</guid>

					<description><![CDATA[<p>This is on Ubuntu 24.04 LTS. I&#8217;ve installed the dev versions of SDL2, including images and TTF.  You can read how to install them in this tutorial. Once that&#8217;s done you add them to the rust project with commands like this cargo add sdl2 You can see these instruction in the relevant crates pages. For [&#8230;]</p>
The post <a href="https://learncgames.com/a-slight-problem-with-sdl2-and-rust/">A slight problem with SDL2 and Rust</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;:22,&quot;href&quot;:&quot;https:\/\/crates.io\/crates\/sdl2&quot;,&quot;archived_href&quot;:&quot;http:\/\/web-wp.archive.org\/web\/20251226013606\/https:\/\/crates.io\/crates\/sdl2&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2026-02-06 10:46:48&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-02-09 20:08:03&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-02-12 22:35:49&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-02-18 23:31:02&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-02-22 05:49:46&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-02-26 17:30:52&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-03-03 01:04:19&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-03-09 09:34:25&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-03-12 21:08:00&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-03-16 05:48:52&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-03-19 09:46:55&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-03-22 20:58:11&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-03-30 12:24:14&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-04-03 05:13:08&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-04-08 07:07:54&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-04-12 23:19:51&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-04-16 05:22:10&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-04-19 08:52:04&quot;,&quot;http_code&quot;:404}],&quot;broken&quot;:true,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-04-19 08:52:04&quot;,&quot;http_code&quot;:404},&quot;process&quot;:&quot;done&quot;},{&quot;id&quot;:23,&quot;href&quot;:&quot;https:\/\/crates.io\/crates\/sdl2_image&quot;,&quot;archived_href&quot;:&quot;http:\/\/web-wp.archive.org\/web\/20241114201358\/https:\/\/crates.io\/crates\/sdl2_image&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2026-02-06 10:46:50&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-02-09 20:08:02&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-02-12 22:35:49&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-02-18 23:31:02&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-02-22 05:49:46&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-02-26 17:30:52&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-03-03 01:04:19&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-03-09 09:34:25&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-03-12 21:07:59&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-03-16 05:48:52&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-03-19 09:46:55&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-03-22 20:58:12&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-03-30 12:24:12&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-04-03 05:13:09&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-04-08 07:07:52&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-04-13 06:32:44&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-04-17 05:36:48&quot;,&quot;http_code&quot;:503}],&quot;broken&quot;:true,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-04-17 05:36:48&quot;,&quot;http_code&quot;:503},&quot;process&quot;:&quot;done&quot;},{&quot;id&quot;:24,&quot;href&quot;:&quot;https:\/\/crates.io\/crates\/sdl2_ttf&quot;,&quot;archived_href&quot;:&quot;http:\/\/web-wp.archive.org\/web\/20241114201545\/https:\/\/crates.io\/crates\/sdl2_ttf&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2026-02-06 10:46:51&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-02-09 20:08:02&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-02-12 22:35:49&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-02-18 23:31:02&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-02-22 05:49:46&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-02-26 17:30:52&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-03-03 01:04:20&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-03-09 09:34:25&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-03-12 21:08:00&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-03-16 05:48:52&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-03-19 09:46:55&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-03-22 20:58:11&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-03-30 12:24:12&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-04-03 05:13:09&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-04-08 07:07:57&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-04-12 23:19:42&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-04-16 05:22:11&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-04-19 08:52:04&quot;,&quot;http_code&quot;:404}],&quot;broken&quot;:true,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-04-19 08:52:04&quot;,&quot;http_code&quot;:404},&quot;process&quot;:&quot;done&quot;}]'></div>
<p><img loading="lazy" decoding="async" class="alignleft size-full wp-image-3309" src="https://learncgames.com/wp-content/uploads/2025/02/error.png" alt="VS Code Rust SDL Copikle problem" width="996" height="396" srcset="https://learncgames.com/wp-content/uploads/2025/02/error.png 996w, https://learncgames.com/wp-content/uploads/2025/02/error-300x119.png 300w, https://learncgames.com/wp-content/uploads/2025/02/error-768x305.png 768w" sizes="auto, (max-width: 996px) 100vw, 996px" />This is on Ubuntu 24.04 LTS. I&#8217;ve installed the dev versions of SDL2, including images and TTF.  You can read how to install them in <a title="Link to How to install SDL on Linux" href="https://learncgames.com/tutorials/how-to-install-sdl-on-linux/" target="_blank" rel="noopener">this tutoria</a>l.</p>
<p>Once that&#8217;s done you add them to the rust project with commands like this</p>
<pre>cargo add sdl2</pre>
<p>You can see these instruction in the relevant crates pages. For instance <a title="Link to SDL2 Crate" href="https://crates.io/crates/sdl2" target="_blank" rel="noopener">SDL2 crate</a>, <a title="Linbk to SDL2 Image Crate" href="https://crates.io/crates/sdl2_image" target="_blank" rel="noopener">SDL2 Image</a> and <a title="Link to SDL2 TTF crate" href="https://crates.io/crates/sdl2_ttf" target="_blank" rel="noopener">SDL2 TTF</a>.</p>
<p>So far so good. The cargo add added the crates into cargo.toml as expected but when I compiled it. Not a compile error as such but a version of dll hell.</p>
<p>The text in that image says:</p>
<pre><em>Updating crates.io index</em>
<em>error: failed to select a version for `sdl2-sys`.</em>
<em>... required by package `sdl2_image v0.25.0`</em>
<em>... which satisfies dependency `sdl2_image = "^0.25.0"` of package `sdl1 v0.1.0 (/home/david/rust/sdl1)`</em>
<em>versions that meet the requirements `^0.25.0` are: 0.25.0</em>

<em>the package `sdl2-sys` links to the native library `SDL2`, but it conflicts with a previous package which links to `SDL2` as well:</em>
<em>package `sdl2-sys v0.37.0`</em>
<em>... which satisfies dependency `sdl2-sys = "^0.37.0"` of package `sdl1 v0.1.0 (/home/david/rust/sdl1)`</em>
<em>Only one package in the dependency graph may specify the same links value. This helps ensure that only one copy of a native library is linked in the final binary. Try to adjust your dependencies so that only one package uses the `links = "SDL2"` value. For more information, see https://doc.rust-lang.org/cargo/reference/resolver.html#links.</em>

<em>failed to select a version for `sdl2-sys` which could resolve this conflict</em></pre>
<p>The problem appears to be a clash between sdl-sys and sdl2-ttf or sdl2-image. If anyone knows a fix&#8230;</p>
<p>&nbsp;</p>The post <a href="https://learncgames.com/a-slight-problem-with-sdl2-and-rust/">A slight problem with SDL2 and Rust</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">3308</post-id>	</item>
		<item>
		<title>Yet another curious bug</title>
		<link>https://learncgames.com/yet-another-curious-bug/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=yet-another-curious-bug</link>
		
		<dc:creator><![CDATA[David]]></dc:creator>
		<pubDate>Sun, 26 Mar 2023 23:00:37 +0000</pubDate>
				<category><![CDATA[bugs]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[Game]]></category>
		<category><![CDATA[game]]></category>
		<guid isPermaLink="false">https://learncgames.com/?p=3225</guid>

					<description><![CDATA[<p>I&#8217;m aware that C is notorious for unexpected behaviour (UB). Let me describe this bug: My second game in C + SDL for my newest eBook is Match Three and compiled with Clang-11 on my Raspberry Pi 4B. I&#8217;m getting a weird bug that doesn&#8217;t occur when I compile it on Windows under MSVC; the [&#8230;]</p>
The post <a href="https://learncgames.com/yet-another-curious-bug/">Yet another curious bug</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-medium wp-image-3227" src="https://learncgames.com/wp-content/uploads/2023/03/matchthree-bug-300x233.png" alt="MatchThree latest version with a bug" width="300" height="233" srcset="https://learncgames.com/wp-content/uploads/2023/03/matchthree-bug-300x233.png 300w, https://learncgames.com/wp-content/uploads/2023/03/matchthree-bug-1024x796.png 1024w, https://learncgames.com/wp-content/uploads/2023/03/matchthree-bug-768x597.png 768w, https://learncgames.com/wp-content/uploads/2023/03/matchthree-bug.png 1036w" sizes="auto, (max-width: 300px) 100vw, 300px" />I&#8217;m aware that C is notorious for unexpected behaviour (UB). Let me describe this bug:</p>
<div data-reddit-rtjson="{&quot;entityMap&quot;:{},&quot;blocks&quot;:[{&quot;key&quot;:&quot;dbbsn&quot;,&quot;text&quot;:&quot;I'm creating a game in C + SDL for an eBook in C and compiled it with Clang-11 on my Raspberry Pi 4B. I'm getting a weird bug that doesn't occur when I compile it on Windows under MSVC; the only differences are the paths to SDL and the sn._s calls but there aren't many of those. Also I compiled it with clang-14 on Ubuntu 22.04 LTS on a Hyper-VM and that behaves properly. &quot;,&quot;type&quot;:&quot;unstyled&quot;,&quot;depth&quot;:0,&quot;inlineStyleRanges&quot;:[],&quot;entityRanges&quot;:[],&quot;data&quot;:{}},{&quot;key&quot;:&quot;34s6i&quot;,&quot;text&quot;:&quot;The weird bug is this. The game is a MatchThree game with 10 x 10 pieces. A 2D array of structs. One field is a field called size. It's 0 normally but if &gt; 0 then it is dec'd and the piece is drawn rotated by 8 degrees. When it reaches 0 the piece is removed. &quot;,&quot;type&quot;:&quot;unstyled&quot;,&quot;depth&quot;:0,&quot;inlineStyleRanges&quot;:[],&quot;entityRanges&quot;:[],&quot;data&quot;:{}}]}">
<div class="" data-block="true" data-editor="35ef0f" data-offset-key="35ef0f_initial-0-0">
<div class="public-DraftStyleDefault-block public-DraftStyleDefault-ltr" data-offset-key="35ef0f_initial-0-0"><span data-offset-key="35ef0f_initial-0-0">My second game in C + SDL for my newest eBook is Match Three and compiled with Clang-11 on my Raspberry Pi 4B. I&#8217;m getting a weird bug that doesn&#8217;t occur when I compile it on Windows under MSVC; the only differences between the source code on the PI and Windows are the paths to SDL and the sn._s calls but there aren&#8217;t many of those. Also I compiled it with clang-14 on Ubuntu 22.04 LTS on a Hyper-VM and that behaves properly.</span></div>
</div>
<p>&nbsp;</p>
<div data-offset-key="35ef0f_initial-0-0"></div>
<div class="" data-block="true" data-editor="35ef0f" data-offset-key="4u8u6-0-0">
<div class="public-DraftStyleDefault-block public-DraftStyleDefault-ltr" data-offset-key="4u8u6-0-0"><span data-offset-key="4u8u6-0-0">Each piece is held a struct in a 10 x 10 array. One field is  called size. It&#8217;s 0 normally but if it is set to a value, typically  64 then it counts down, one per frame and the piece is drawn rotated by 8 degrees each frame. When it reaches 0 the piece is removed. This is my &#8220;down the plughole&#8221; way of removing pieces. It takes exactly 64/60 seconds to vanish. I use the size field to draw it when size is non-zero so it shrinks as it rotates It&#8217;s a nice effect.</span></div>
</div>
</div>
<p>&nbsp;</p>
<div data-offset-key="4u8u6-0-0"></div>
<div data-offset-key="4u8u6-0-0"></div>
<div data-offset-key="4u8u6-0-0">The bug though is that when it starts up, several pieces start rotating and keep rotating. The size field stays at 63. There&#8217;s no code that explains this behaviour and it only happens on the Raspberry Pi, not on Windows or on Ubuntu. Is it a compiler bug or some weird UB on the PI version. It&#8217;s an interesting bug and I&#8217;ve only wasted a week of evenings on it so far!</div>
<p></p>The post <a href="https://learncgames.com/yet-another-curious-bug/">Yet another curious bug</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">3225</post-id>	</item>
	</channel>
</rss>
