Skip to content
Avindra Goolcharan edited this page Jun 7, 2021 · 11 revisions

Building

You need cmake (and the development packages for Qt)

ℹ️ If you are familiar with the CMake build environment, go ahead and use it directly.

As a reminder, here's is the basic form of the idiomatic cmake build: mkdir -p build && cd build && cmake .. && make


A Makefile exists which can drive CMake to get the fastest possible build with sane defaults. Here is the suggested usage:

To build the project, run make. An executable will be built somewhere in the build folder.

You can play the build with make play.

If you want to change code, I suggest: make clean && make build && make play after making changes.

Development in C++

Developing C++ apps with GUI's has become easier over time. There are well-documented and well tested frameworks such as Qt that help make your projects portable.

Historically speaking, in 2010 I chose Qt over wxWidgets because wx was incredibly difficult to set up and was painful to use. Qt was similarly a challenge to set up, but once it was set up, it was easy to use.

Qt was also relicensed to LGPL, which makes it useful for this and many other projects.

📆 2020 Refresh

The moving C++ standard (this project uses C++17) has made C++ a better language, as is the case with all modern programming languages. In 2020, I revisited the project to clean up some of the curmudgeony memcpy calls and other unsafe looking code. I was pretty surprised that C++ can be as expressive as it is with the latest standard. I am impressed with the new features, and I haven't since run into that dreaded "array decay" problem that can lead to dazed and confused refactoring sessions.

References

⚙️ CMake

CMake is often paired with Qt, but for someone who knows only C++, learning another build system is a great chore and often a roadblock. I found the following repos helpful in understanding how to use CMake with Qt:

📗 Qt

⭕ Tic-tac-toe

  • Page 6 (pp. 536) of the linked 31-page paper has the expert algorithm. The rest of the Crowley Siegler paper has related data on Tic-Tac-Toe games.

⚠️ Legacy build info

This project was built using Visual Studio 2008, and set up using the statically linked 32-bit libraries for Qt 4. The final Visual Studio 2008 codebase can be located using Git.

Nowadays, the build only runs on Linux w/ Qt5, but porting it back to Windows shouldn't be hard (few more lines in CMakeLists, referenced repos have good examples for Windows exes including icons).