rexim

Building Dn-FamiTracker on Linux

rexim - 2026-10-07

Track: Face Your Destiny by nu11

I recently needed to cross-compile 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.

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'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.

MSVC in Wine

Dn-FamiTracker heavily depends on MSVC. It even uses MFC as its major UI framework. Luckily there is an awesome project mstorsjo/msvc-wine which can help to run all this Microsoft craziness in Wine.

The first step is to install Wine. It's usually available in the majority of Linux distros. Just use your package manage to install it.

The second step is to clone mstorsjo/msvc-wine somewhere (which implies that you have Git installed, it's also available in the majority of Linux distros)

$ git clone https://github.com/mstorsjo/msvc-wine.git
$ cd msvc-wine

Problem: No MFC

At the time of writing this blog post the latest commit was 514f8ea. 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. 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.

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:

$ wget https://rexim.github.io/files/msvc-wine-mfc.patch
$ git am msvc-wine-mfc.patch

I strongly recommend to read all the patches we are downloading and applying in this blog post to understand what they are doing exactly.

Problem: Corrupted RC Files

One of the things 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.

But for some reason this specific part of it 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 might be due to incorrect encoding of the RC files.

My 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:

$ wget https://rexim.github.io/files/msvc-wine-fixinclude.patch
$ git am msvc-wine-fixinclude.patch

This made Dn-FamiTracker compile successfully in the end.

MSVC in Wine Installation

$ ./vsdownload.py --language en --with-mfc --dest ~/my_msvc/opt/msvc

... agree to the terms ...

$ ./install.sh ~/my_msvc/opt/msvc
$ export PATH=~/my_msvc/opt/msvc/bin/x64:$PATH

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.

$ cd ..

Dn-FamiTracker

At 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.

$ git clone \
      --recursive \
      --branch Dn0.5.3.0 \
      https://github.com/Dn-Programming-Core-Management/Dn-FamiTracker.git
$ cd Dn-FamiTracker

We are going to be using CMake to build the project. Should be available in the majority of Linux distros.

Another important dependency is cc65. 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.

Problem: CMD Scripts on Linux

One of the things the build process of Dn-FamiTracker will try to do is to run 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.

$ wget https://rexim.github.io/files/dn-famitracker-linux-support.patch
$ git am dn-famitracker-linux-support.patch

Building Dn-FamiTracker

$ mkdir build
$ cd build
$ CC=cl CXX=cl cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_SYSTEM_NAME=Windows
$ make

After the build is done you can try to run the executable in wine

$ wine Dn-FamiTracker.exe

© 2026 Alexey Kutepov