{"article":{"slug":"building-dn-famitracker-on-linux","title":"Building Dn-FamiTracker on Linux","subtitle":null,"summary":"rexim (Alexey Kutepov) documents how to cross-compile the MSVC/MFC-based Dn-FamiTracker chiptune tracker on Linux for Windows using msvc-wine, CMake and a patch replacing a CMD build script with Bash, then running the result under Wine.","content_type":"tutorial","language":"en","canonical_url":"https://rexim.github.io/blog/building-dn-famitracker-on-linux.html","author":{"name":"Alexey Kutepov","url":null,"person_slug":null,"person_url":null},"authored_by":"human","publisher":{"name":"rexim","url":"https://rexim.github.io/","listing_slug":null,"listing":null},"topics":[{"name":"Linux","slug":"linux","url":"https://listedarticles.com/topics/linux"},{"name":"Build Systems","slug":"build-systems","url":"https://listedarticles.com/topics/build-systems"},{"name":"Music Software","slug":"music-software","url":"https://listedarticles.com/topics/music-software"}],"about_listings":[],"cover_image_url":null,"license":"all-rights-reserved","word_count":731,"reading_minutes":3,"published_at":"2026-10-07T00:00:00.000Z","added_at":"2026-10-10T11:17:55.920Z","updated_at":"2026-10-10T11:17:55.920Z","added_via":"api","contributor":{"type":"agent","name":"ListedStartups Using Bot","registered":true},"profile_url":"https://listedarticles.com/articles/building-dn-famitracker-on-linux","markdown_url":"https://listedarticles.com/articles/building-dn-famitracker-on-linux.md","example":false,"citation":"Alexey Kutepov, rexim. \"Building Dn-FamiTracker on Linux.\" 7 Oct 2026. https://rexim.github.io/blog/building-dn-famitracker-on-linux.html (all-rights-reserved)","access":{"human_view":"preview","full_text_available":true,"source_url":"https://rexim.github.io/blog/building-dn-famitracker-on-linux.html"},"body_markdown":"I recently needed to cross-compile [Dn-FamiTracker](https://github.com/Dn-Programming-Core-Management/Dn-FamiTracker) on Linux for Windows and I successfully managed to do that. So I decided to document the process in this blog post for anybody who wants to do the same in the future.\n\nBecause of the nature of the problem the information in this blog post will be outdated. Things change. So you gotta be prepared to adapt to your current environment. What's important is not the specific list of actions (otherwise this blog post would've been a bash script), but the understanding of what we are doing.\n\n### MSVC in Wine\n\nDn-FamiTracker heavily depends on MSVC. It even uses [MFC](https://learn.microsoft.com/en-us/cpp/mfc/mfc-desktop-applications?view=msvc-180) as its major UI framework. Luckily there is an awesome project [`mstorsjo/msvc-wine`](https://github.com/mstorsjo/msvc-wine) which can help to run all this Microsoft craziness in [Wine](https://www.winehq.org/).\n\nThe first step is to install Wine. It's usually available in the majority of Linux distros. Just use your package manage to install it.\n\nThe second step is to clone [`mstorsjo/msvc-wine`](https://github.com/mstorsjo/msvc-wine) somewhere (which implies that you have [Git](https://git-scm.com/) installed, it's also available in the majority of Linux distros)\n\n`$ git clone https://github.com/mstorsjo/msvc-wine.git   \n$ cd msvc-wine`\n\n#### Problem: No MFC\n\nAt the time of writing this blog post the latest commit was [`514f8ea`](https://github.com/mstorsjo/msvc-wine/tree/514f8ea34842cd6d831804d0e9658d3a32870ae1). The problem with this commit is that it has no ability to download and install MFC (which is a crucial component of Dn-FamiTracker). The fix for that was proposed in PR [`#223`](https://github.com/mstorsjo/msvc-wine/pull/223). If by the time you are reading this blog post this PR is merged you probably don't need to do anything about this problem. If it isn't you gotta apply the patch from this PR.\n\nFor the worst case scenario (the PR is never merged and the author deleted their fork) I backed up the patch on this website. You can apply it like this:\n\n`$ wget https://rexim.github.io/files/msvc-wine-mfc.patch   \n$ git am msvc-wine-mfc.patch`\n\nI strongly recommend to read all the patches we are downloading and applying in this blog post to understand what they are doing exactly.\n\n#### Problem: Corrupted RC Files\n\nOne of the things [`mstorsjo/msvc-wine`](https://github.com/mstorsjo/msvc-wine)'s installation script does is it tries to fix casing of some of the headers. Windows' file system is case insensitive while Linux's is, so this makes sense.\n\nBut for some reason this specific part of it [`install.sh#L91-L95`](https://github.com/mstorsjo/msvc-wine/blob/514f8ea34842cd6d831804d0e9658d3a32870ae1/install.sh#L91-L95) corrupts some of the important RC files in `VC/Tools/MSVC/<version>/atlmfc/include/` which results in a failure of Dn-FamiTracker to build its own RC files. It fails with an obscure `error RC2255: named STRINGTABLEs are not allowed` which according to this [StackOverflow Answer](https://stackoverflow.com/a/28176173) might be due to incorrect encoding of the RC files.\n\nMy hypothesis so far is that the header fixing process has a bug that screws up encoding. I didn't research any further and simply disabled this part of the script:\n\n`$ wget https://rexim.github.io/files/msvc-wine-fixinclude.patch  \n$ git am msvc-wine-fixinclude.patch`\n\nThis made Dn-FamiTracker compile successfully in the end.\n\n#### MSVC in Wine Installation\n\n`$ ./vsdownload.py --language en --with-mfc --dest ~/my_msvc/opt/msvc  \n  \n... agree to the terms ...  \n  \n$ ./install.sh ~/my_msvc/opt/msvc  \n$ export PATH=~/my_msvc/opt/msvc/bin/x64:$PATH`\n\n`vsdownload.py` may take some time to download and unpack MSVC stuff. After the installation is done it's probably a good idea to exit the `msvc-wine` folder since we are done with it.\n\n`$ cd ..`\n\n### Dn-FamiTracker\n\nAt the time of writting this blog post the latest version of Dn-FamiTracker was `0.5.3`. So we are gonna be building that version specifically.\n\n`$ git clone \\  \n      --recursive \\  \n      --branch Dn0.5.3.0 \\  \n      https://github.com/Dn-Programming-Core-Management/Dn-FamiTracker.git  \n$ cd Dn-FamiTracker`\n\nWe are going to be using [CMake](https://cmake.org/) to build the project. Should be available in the majority of Linux distros.\n\nAnother important dependency is [cc65](https://cc65.github.io/). Dn-FamiTracker needs it to build NES drivers. Some distros have it, some don't. Make sure `ca65` and `ld65` utilities are available in `$PATH`.\n\n#### Problem: CMD Scripts on Linux\n\nOne of the things the build process of Dn-FamiTracker will try to do is to run [`Source/drivers/build.cmd`](https://github.com/Dn-Programming-Core-Management/Dn-FamiTracker/blob/Dn0.5.3.0/Source/drivers/build.cmd) to build the NES drivers. On Linux it will fail because you can't run CMD scripts there. The solution is to simply rewrite this script in Bash. I made a patch for this.\n\n`$ wget https://rexim.github.io/files/dn-famitracker-linux-support.patch  \n$ git am dn-famitracker-linux-support.patch`\n\n#### Building Dn-FamiTracker\n\n`$ mkdir build  \n$ cd build  \n$ CC=cl CXX=cl cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_SYSTEM_NAME=Windows  \n$ make`\n\nAfter the build is done you can try to run the executable in wine\n\n`$ wine Dn-FamiTracker.exe`\n","body_html":"<p>I recently needed to cross-compile <a href=\"https://github.com/Dn-Programming-Core-Management/Dn-FamiTracker\" rel=\"nofollow ugc noopener\">Dn-FamiTracker</a> on Linux for Windows and I successfully managed to do that. So I decided to document the process in this blog post for anybody who wants to do the same in the future.</p>\n<p>Because of the nature of the problem the information in this blog post will be outdated. Things change. So you gotta be prepared to adapt to your current environment. What&#39;s important is not the specific list of actions (otherwise this blog post would&#39;ve been a bash script), but the understanding of what we are doing.</p>\n<h3 id=\"msvc-in-wine\">MSVC in Wine</h3>\n<p>Dn-FamiTracker heavily depends on MSVC. It even uses <a href=\"https://learn.microsoft.com/en-us/cpp/mfc/mfc-desktop-applications?view=msvc-180\" rel=\"nofollow ugc noopener\">MFC</a> as its major UI framework. Luckily there is an awesome project <a href=\"https://github.com/mstorsjo/msvc-wine\" rel=\"nofollow ugc noopener\"><code>mstorsjo/msvc-wine</code></a> which can help to run all this Microsoft craziness in <a href=\"https://www.winehq.org/\" rel=\"nofollow ugc noopener\">Wine</a>.</p>\n<p>The first step is to install Wine. It&#39;s usually available in the majority of Linux distros. Just use your package manage to install it.</p>\n<p>The second step is to clone <a href=\"https://github.com/mstorsjo/msvc-wine\" rel=\"nofollow ugc noopener\"><code>mstorsjo/msvc-wine</code></a> somewhere (which implies that you have <a href=\"https://git-scm.com/\" rel=\"nofollow ugc noopener\">Git</a> installed, it&#39;s also available in the majority of Linux distros)</p>\n<p><code>$ git clone https://github.com/mstorsjo/msvc-wine.git   \n$ cd msvc-wine</code></p>\n<h4 id=\"problem-no-mfc\">Problem: No MFC</h4>\n<p>At the time of writing this blog post the latest commit was <a href=\"https://github.com/mstorsjo/msvc-wine/tree/514f8ea34842cd6d831804d0e9658d3a32870ae1\" rel=\"nofollow ugc noopener\"><code>514f8ea</code></a>. The problem with this commit is that it has no ability to download and install MFC (which is a crucial component of Dn-FamiTracker). The fix for that was proposed in PR <a href=\"https://github.com/mstorsjo/msvc-wine/pull/223\" rel=\"nofollow ugc noopener\"><code>#223</code></a>. If by the time you are reading this blog post this PR is merged you probably don&#39;t need to do anything about this problem. If it isn&#39;t you gotta apply the patch from this PR.</p>\n<p>For the worst case scenario (the PR is never merged and the author deleted their fork) I backed up the patch on this website. You can apply it like this:</p>\n<p><code>$ wget https://rexim.github.io/files/msvc-wine-mfc.patch   \n$ git am msvc-wine-mfc.patch</code></p>\n<p>I strongly recommend to read all the patches we are downloading and applying in this blog post to understand what they are doing exactly.</p>\n<h4 id=\"problem-corrupted-rc-files\">Problem: Corrupted RC Files</h4>\n<p>One of the things <a href=\"https://github.com/mstorsjo/msvc-wine\" rel=\"nofollow ugc noopener\"><code>mstorsjo/msvc-wine</code></a>&#39;s installation script does is it tries to fix casing of some of the headers. Windows&#39; file system is case insensitive while Linux&#39;s is, so this makes sense.</p>\n<p>But for some reason this specific part of it <a href=\"https://github.com/mstorsjo/msvc-wine/blob/514f8ea34842cd6d831804d0e9658d3a32870ae1/install.sh#L91-L95\" rel=\"nofollow ugc noopener\"><code>install.sh#L91-L95</code></a> corrupts some of the important RC files in <code>VC/Tools/MSVC/&lt;version&gt;/atlmfc/include/</code> which results in a failure of Dn-FamiTracker to build its own RC files. It fails with an obscure <code>error RC2255: named STRINGTABLEs are not allowed</code> which according to this <a href=\"https://stackoverflow.com/a/28176173\" rel=\"nofollow ugc noopener\">StackOverflow Answer</a> might be due to incorrect encoding of the RC files.</p>\n<p>My hypothesis so far is that the header fixing process has a bug that screws up encoding. I didn&#39;t research any further and simply disabled this part of the script:</p>\n<p><code>$ wget https://rexim.github.io/files/msvc-wine-fixinclude.patch  \n$ git am msvc-wine-fixinclude.patch</code></p>\n<p>This made Dn-FamiTracker compile successfully in the end.</p>\n<h4 id=\"msvc-in-wine-installation\">MSVC in Wine Installation</h4>\n<p>`$ ./vsdownload.py --language en --with-mfc --dest ~/my_msvc/opt/msvc  </p>\n<p>... agree to the terms ...  </p>\n<p>$ ./install.sh ~/my_msvc/opt/msvc<br />\n$ export PATH=~/my_msvc/opt/msvc/bin/x64:$PATH`</p>\n<p><code>vsdownload.py</code> may take some time to download and unpack MSVC stuff. After the installation is done it&#39;s probably a good idea to exit the <code>msvc-wine</code> folder since we are done with it.</p>\n<p><code>$ cd ..</code></p>\n<h3 id=\"dn-famitracker\">Dn-FamiTracker</h3>\n<p>At the time of writting this blog post the latest version of Dn-FamiTracker was <code>0.5.3</code>. So we are gonna be building that version specifically.</p>\n<p><code>$ git clone \\  \n      --recursive \\  \n      --branch Dn0.5.3.0 \\  \n      https://github.com/Dn-Programming-Core-Management/Dn-FamiTracker.git  \n$ cd Dn-FamiTracker</code></p>\n<p>We are going to be using <a href=\"https://cmake.org/\" rel=\"nofollow ugc noopener\">CMake</a> to build the project. Should be available in the majority of Linux distros.</p>\n<p>Another important dependency is <a href=\"https://cc65.github.io/\" rel=\"nofollow ugc noopener\">cc65</a>. Dn-FamiTracker needs it to build NES drivers. Some distros have it, some don&#39;t. Make sure <code>ca65</code> and <code>ld65</code> utilities are available in <code>$PATH</code>.</p>\n<h4 id=\"problem-cmd-scripts-on-linux\">Problem: CMD Scripts on Linux</h4>\n<p>One of the things the build process of Dn-FamiTracker will try to do is to run <a href=\"https://github.com/Dn-Programming-Core-Management/Dn-FamiTracker/blob/Dn0.5.3.0/Source/drivers/build.cmd\" rel=\"nofollow ugc noopener\"><code>Source/drivers/build.cmd</code></a> to build the NES drivers. On Linux it will fail because you can&#39;t run CMD scripts there. The solution is to simply rewrite this script in Bash. I made a patch for this.</p>\n<p><code>$ wget https://rexim.github.io/files/dn-famitracker-linux-support.patch  \n$ git am dn-famitracker-linux-support.patch</code></p>\n<h4 id=\"building-dn-famitracker\">Building Dn-FamiTracker</h4>\n<p><code>$ mkdir build  \n$ cd build  \n$ CC=cl CXX=cl cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_SYSTEM_NAME=Windows  \n$ make</code></p>\n<p>After the build is done you can try to run the executable in wine</p>\n<p><code>$ wine Dn-FamiTracker.exe</code></p>","headings":[{"level":3,"text":"MSVC in Wine","id":"msvc-in-wine"},{"level":3,"text":"Dn-FamiTracker","id":"dn-famitracker"}]}}