4 Hugues Ross - Blog: The Delay Continues, and I Explain it
Hugues Ross

1/24/17

The Delay Continues, and I Explain it

As the title implies, I'm pushing last week's tutorial back another week. I realize that all of these unexplained delays make me look a bit lazy, so I'm going to give you a proper explanation of why this one "almost finished" tutorial segment is taking so long to be released, and why I've spent the last few days pulling my hair out.

Last Monday, I was mostly done with the tutorial. To demonstrate various features of curses, I made a nice little demo application. The code was still a little bit messy, but I figured that as long as I could compile a Windows version of the demo, I wouldn't have any problems.

Unfortunately, there was a small problem. I'm not sure if I've mentioned it here, but I started using Meson for builds instead of writing makefiles. This is good, because Meson works very well. However, I'd never actually tried cross-compiling code with it before, and I was having issues setting it up. In light of this, I pushed the tutorial back so that I would have some time to fix the issue and clean up the code.

Fast-forward to this weekend, when I finally have the time to sit down and figure out my problem. I got the Windows version to compile through Meson, but it would just crash immediately. I spent almost the entirety of my weekend trying various versions of PDCurses and messing with the code, until I finally tried making a stripped-down "hello world" and moving it over to my Windows machine for testing. I should also mention that due to certain circumstances, moving things to my Windows machine takes 5-10 minutes. It's a pain, but I'm working to resolve this over the next week or so.

Anyway, it's at this point that I realize that the PDCurses library really hates cross-compiling. The code is fine, and I manage to get it working by compiling it on my Windows machine. (This seems to be an issue specific to PDCurses. I've had tons of issues like this, but only when using that specific library)

On Monday (yesterday), I've figured out the problem but I still don't actually have a Windows build of the demo. Monday afternoon (after work), I realize that at some point, my fiddling has broken the demo completely on my PC, and it won't work on Linux anymore! Fixing this bug took 3 hours, because it was caused by an innocuous-looking include statement in a random header file.

After dinner I finally transfer my code over to make a Windows build. I set everything up in Code::Blocks for building, get a compiler error, open the relevant file, and Code::Blocks crashes. When I reopen the project, everything is gone. I repeat that song and dance a couple times, and it finally works. Still, the editor is stuttering a ton and making my life a pain.

I finally get the code to build, run it, and...it doesn't work. Fast-forward another 15-30 minutes, and I figure out that the window isn't resizing to fit the content, which screws everything up. When I shrink the content as a test, I come to the horrible realization that my program isn't drawing to an SDL window, it's drawing to the Windows command prompt! I HAD THE WRONG VERSION OF PDCURSES INSTALLED THE WHOLE TIME!

It's 11:00 PM at this point. I now have a Windows build, but it looks like this:

For reference, the build is supposed to look something like this, more or less:
It's at this point that I finally decide to cut my losses and delay things again. It's super late, I'm exhausted, I still don't have an acceptable Windows port, and the code is still not cleaned up, thanks to all of the delays.

So, that's the end of my tale. I'm pretty sure a less stubborn programmer would've simply given up at this point, but that's not my style. I'm going to try and get things sorted out for next week, and I think it'll be fine now that I'm aware of the issues. However, if I can't finish next week, delay again, and still can't finish it by February 6th, I'm putting the project back on hiatus and making a different tutorial series. I've lost a ton of time to some really silly and unexpected issues, and I can't afford to keep slamming my face into a wall forever.

In unrelated news, my personal projects have all been approved. You can expect some more posts about those once this stupid thing is dealt with.

No comments: