I installed MinGW today, making me finally able to build C++ projects on my Windows machine. I’m always quite surprised by the lack of support for C++ development on Windows – you have MinGW, and you have Visual Studio. If you don’t like the GNU design philosophies and don’t want to pay ridiculous amounts of money for Visual Studio – well, that’s too bad.
So I went with the GNU approach. But first, a little background.
There are some things in my life that come back to my mind every few years. I come up with something, try to do it, maybe advance a little, and then for some reason decide it’s not feasible at the moment and forget about it for another few years.
If you’ve been following this blog for a while, you might be thinking: “Hey Shai, you’re a programmer. You like open-source games. You even started contributing translations to an open-source project. Why don’t you ever contribute code to any project?”
That a good question, hypothetical reader. And here is the answer:
What you’re seeing here is about one half of the makefile of SuperTux, but it could just as well be from pretty much any big open source project. A makefile, in case you’ve never had the (debatable) pleasure of developing on Unix-like systems, is a file that describes an automated build process so that the build can happen with one simple command.
The problem? It doesn’t work.
Well, to be fair – I’m sure it works for some people. Software does get made on Linux, so I’m sure someone is able to make those things work. But in my 5 years or so of using Linux, I can safely say that of all the open source projects I tried to build from source (and I tried many), maybe 30% worked with a single command [1]. And now, having made the ultimate sin and gone back to using Windows? Good luck. Most projects I’ve seen either don’t consider Windows at all, or assume you’re using Visual Studio. And when someone does give a non-Visual Studio build process – well, try to read the SuperTux Windows build instructions[2] and see if after the first 200 paragraphs you still have the motivation to fix that little bug you saw.
And the strange thing is, I don’t understand why it has to be like that. I’ve programmed in C, Java, and even a little C++ before – I had source files in one place, destination files in another place, libraries in a third place and that’s it – compile, link and run. Maybe it’s a matter of the compatibility? Make things work on as many machines as possible? I doubt if that explains it.
Until about a year ago I worked (professionally) on a huge project – over 50 coders, several sub-projects that had to be connected to a final one, it was web-based so it came with a huge mess of Java files, web pages, JSP and whatever. To build the project, we had an Ant file smaller than what they have in the most basic C++ projects, and it was all in human-readable XML full of comments about what each part does. Not that it wasn’t a huge mess, but every piece of the mess was added for a specific, documented reason. It also failed quite often – when something important in the project changed, when someone new tried to run it, when Jupiter aligned improperly with Mars. But even without being an Ant expert, you could open the file and see what was going on there, and search for the problem.
Just to be clear – I’m not saying those projects are doing something bad, and some other way is necessarily better. What I’m saying is that for me, and I’m guessing it’s also for many other people who are not crazy about Unix design philosophies, this is a significant barrier from getting into projects like these.
So, in conclusion – I now have a C++ compiler, but I don’t know if I’m going to do anything with it. Maybe I’ll study the inner workings of makefiles and build processes until things will actually work, or maybe I’ll just keep working in Java and live in a parallel universe to most of the open source world. Either way, one thing is certain – I used Linux before and I might use it again, but I’m definitely not a subscriber to the Linux philosophy.
[1] Or two, or three – makefile also has a little brother called autoconf, and I think there was something additional sometimes.
[2] Which, by the way, starts with a “warnings” section, including the fact that it might destroy your computer and you should do it on a virtual machine.





