compilling bocfel with gtkglk

When compiling bocfel with gtkglk, the compiler quits with errors:

lunasspecto@lunasspecto-HP-2000-Notebook-PC ~/Desktop/bocfel-0.6.2 $ sudo make gcc -O -o bocfel blorb.o branch.o dict.o iff.o io.o math.o memory.o objects.o osdep.o process.o random.o screen.o stack.o unicode.o util.o zoom.o zterp.o glkstart.o -Lgtkglk -L/usr/local/lib -lgtkglk -pthread -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgthread-2.0 -lrt -lglib-2.0 -lgconf-2 -lglib-2.0 -lSDL_mixer screen.o: In function `request_char': /home/lunasspecto/Desktop/bocfel-0.6.2/screen.c:1410: undefined reference to `glk_request_char_event_uni' screen.o: In function `request_line': /home/lunasspecto/Desktop/bocfel-0.6.2/screen.c:1418: undefined reference to `glk_request_line_event_uni' screen.o: In function `zerase_line': /home/lunasspecto/Desktop/bocfel-0.6.2/screen.c:935: undefined reference to `glk_put_char_uni' screen.o: In function `cleanup_screen': /home/lunasspecto/Desktop/bocfel-0.6.2/screen.c:411: undefined reference to `glk_put_char_uni' screen.o: In function `put_char_base': /home/lunasspecto/Desktop/bocfel-0.6.2/screen.c:696: undefined reference to `glk_put_char_uni' /home/lunasspecto/Desktop/bocfel-0.6.2/screen.c:710: undefined reference to `glk_put_char_uni' /home/lunasspecto/Desktop/bocfel-0.6.2/screen.c:715: undefined reference to `glk_put_char_uni' screen.o:/home/lunasspecto/Desktop/bocfel-0.6.2/screen.c:1471: more undefined references to `glk_put_char_uni' follow collect2: error: ld returned 1 exit status make: *** [bocfel] Error 1

I’m not sure what to make of this. Any ideas? This is using gtkglk 0.3, which I’ve already built and installed, leaving it all in a directory called “gtkglk” in the bocfel source directory. config.mk has been edited to make gtkglk the target GLK library.

edited to add: I imagine this has something with incompatible versions of the GLK standard regarding unicode I/O? I dunno.

Yeah, it looks like gtkglk is so old that it doesn’t support the Unicode calls. (I’m looking at github.com/abrobston/gtkglk.) That’s pre-2006, to be clear.

Not much you can do, other than work on updating it.

Glk implementations are supposed to define the macro GLK_MODULE_UNICODE only if they support Unicode. Bocfel tests this macro before using the Unicode functions, so it would appear that gtkglk defines the macro but doesn’t actually support Unicode. If it exists, you can try removing the GLK_MODULE_UNICODE define from glk.h and see if that does anything.

Macro is commented out, at least in the version I found.

github.com/abrobston/gtkglk/blo … /src/glk.h

After doing a bit of digging, I’ve found another version of gtkglk, at the IF Archive (ifarchive.org/if-archive/pro … entations/). The version on Github builds properly due to the macros being correct. The version from the Archive, which I presume lunasspecto is using, incorrectly defines GLK_MODULE_UNICODE.

I have indeed been using the IF Archive version of gtkglk. I somehow forgot that I’d also tried the Github version. When I do that, gtkglk builds fine, but the bocfel compilation halts for a different reason:

lunasspecto@lunasspecto-HP-2000-Notebook-PC ~/Desktop/bocfel-0.6.2 $ make gcc -O -Wall -Wshadow -std=c99 -pedantic -g -Igtkglk -DZTERP_GLK -DZTERP_UNIX -c blorb.c gcc -O -Wall -Wshadow -std=c99 -pedantic -g -Igtkglk -DZTERP_GLK -DZTERP_UNIX -c branch.c gcc -O -Wall -Wshadow -std=c99 -pedantic -g -Igtkglk -DZTERP_GLK -DZTERP_UNIX -c dict.c gcc -O -Wall -Wshadow -std=c99 -pedantic -g -Igtkglk -DZTERP_GLK -DZTERP_UNIX -c iff.c gcc -O -Wall -Wshadow -std=c99 -pedantic -g -Igtkglk -DZTERP_GLK -DZTERP_UNIX -c io.c gcc -O -Wall -Wshadow -std=c99 -pedantic -g -Igtkglk -DZTERP_GLK -DZTERP_UNIX -c math.c gcc -O -Wall -Wshadow -std=c99 -pedantic -g -Igtkglk -DZTERP_GLK -DZTERP_UNIX -c memory.c gcc -O -Wall -Wshadow -std=c99 -pedantic -g -Igtkglk -DZTERP_GLK -DZTERP_UNIX -c objects.c gcc -O -Wall -Wshadow -std=c99 -pedantic -g -Igtkglk -DZTERP_GLK -DZTERP_UNIX -c osdep.c gcc -O -Wall -Wshadow -std=c99 -pedantic -g -Igtkglk -DZTERP_GLK -DZTERP_UNIX -c process.c gcc -O -Wall -Wshadow -std=c99 -pedantic -g -Igtkglk -DZTERP_GLK -DZTERP_UNIX -c random.c gcc -O -Wall -Wshadow -std=c99 -pedantic -g -Igtkglk -DZTERP_GLK -DZTERP_UNIX -c screen.c gcc -O -Wall -Wshadow -std=c99 -pedantic -g -Igtkglk -DZTERP_GLK -DZTERP_UNIX -c stack.c gcc -O -Wall -Wshadow -std=c99 -pedantic -g -Igtkglk -DZTERP_GLK -DZTERP_UNIX -c unicode.c gcc -O -Wall -Wshadow -std=c99 -pedantic -g -Igtkglk -DZTERP_GLK -DZTERP_UNIX -c util.c gcc -O -Wall -Wshadow -std=c99 -pedantic -g -Igtkglk -DZTERP_GLK -DZTERP_UNIX -c zoom.c gcc -O -Wall -Wshadow -std=c99 -pedantic -g -Igtkglk -DZTERP_GLK -DZTERP_UNIX -c zterp.c gcc -O -Wall -Wshadow -std=c99 -pedantic -g -Igtkglk -DZTERP_GLK -DZTERP_UNIX -c glkstart.c glkstart.c:25:22: fatal error: glkstart.h: No such file or directory compilation terminated. make: *** [glkstart.o] Error 1
But I just had to put a copy of gtkglk’s glkstart.h in the base directory of gtkglk’s source, and then bocfel compiled alright.

Edit: Unfortunately, editing the default gtkglk styles from the resulting bocfel binary seems to have no effect on the game window: everything continues to be displayed in the default fonts in black text on a white background no matter what I do. Color hints (in, say, Adam Cadre’s “Endless, Nameless” or “Photopia”) don’t work either.

Edit again: Looks like bocfel only supports colors when using garglk or no GLK library at all. Silly me.