phoenix::Tutorial - Compilation

You will need a C++0x-compatible compiler, such as GCC 4.6 or later. That is what I will use for this tutorial.

Windows

Windows compilation also requires a Manifest file in order to use the new theme engines provided by Windows XP and Windows Vista. I have included one that targets all processors, and you can use MinGW's windres to compile it.

windres ../windows/phoenix.rc phoenix-resource.o
mingw32-g++ -std=gnu++0x -I.. -O3 -fomit-frame-pointer -c phoenix.cpp -DPHOENIX_WINDOWS
...
mingw32-g++ -mwindows -s ... phoenix.o phoenix-resource.o -lkernel32 -luser32 -lgdi32 -ladvapi32 -lcomctl32 -lcomdlg32 -lshell32 -lole32

GTK+

For GTK+, we use pkg-config to make things a little easier. We also need X11.so, for help with window geometry support.

g++-4.6 -std=gnu++0x -I.. -O3 -fomit-frame-pointer -c phoenix.cpp -DPHOENIX_GTK `pkg-config --cflags gtk+-2.0`
...
g++-4.6 -s ... phoenix.o `pkg-config --libs gtk+-2.0` -lX11

Qt

Qt is similar to GTK+, but we also must use moc in order to bind to Qt's signals and slots for callbacks.

moc -i -o qt/qt.moc qt/qt.moc.hpp
g++-4.6 -std=gnu++0x -I.. -O3 -fomit-frame-pointer -c phoenix.cpp `pkg-config --cflags QtCore QtGui` -DPHOENIX_QT
...
g++-4.6 -s ... phoenix.o `pkg-config --libs QtCore QtGui`