Menu

Compilation instructions

Colin Leach

Compilation Instructions

Graphics server

You will need a copy of the Qt application framework installed. Linux users may already have it (especially if using KDE) or can get the deb or rpm from the usual repositories. Others, including Windows users, can get it free (for non-commercial users) from http://qt.nokia.com/downloads/
Only version 4.7 has been tested. Versions older than 4.2 will certainly fail, and 4.2-4.4 are unpredictable. I have no reason to expect problems with 4.5-4.6 but can offer no guarantees.

Compiling the graphics server is (in the usual Qt way) a two-step process:
In subdirectory gserv/ the command
qmake-qt4 gserv.pro -r -spec linux-g++
will create a custom Makefile, then typing
make
will compile and link it with gcc.

Alternatively (as I always do), open gserv.pro in QtCreator and use that most impressive IDE to build the project (Ctrl-B should be enough). If you can't find the executable afterwards, look in ../gserv-build-desktop because it likes to avoid mixing source files with builds.

The gserv executable (called gserv.exe on Windows) is the only file you need for assignments. Either move it to somewhere convenient, or create a link to it.

Object library

In subdirectory cs106lib/ running make should create the cs106lib.a file. That can either be copied to each project directory along with the header files, or you can put it somewhere central and give gcc an absolute or relative path to it.

I'm no expert on Makefiles, but something like this seems to work (with the lib file one level up from your project files):

~~~~~~~~~~~
CC = g++
DEBUG = -g # or -g3 -gdwarf2 -o0 for maximum value using gdb
CFLAGS = -Wall -c $(DEBUG)
LFLAGS = -Wall $(DEBUG)

PROG = myprog # changed for each project
LIB = ../cs106lib.a # relative path to library file
OBJS = $(PROG).o # add any other *.o files needed, e.g. maze.o

all : $(PROG) # plus any other stuff you need, e.g. etags

$(PROG) : $(OBJS)
$(CC) $(LFLAGS) $(OBJS) $(LIB) -o $(PROG)
~~~~~~~~~~~~~~

Test code

These various items assume that cs106lib.a already exists, at relative path ../CS106/
You will need to edit the Makefile if the location is different.


Related

Wiki: CS106 Libraries
Wiki: Main features

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.