Comments

Log in with itch.io to leave a comment.

(+1)

Heya, trying to get your game running in an Ubuntu VM. I installed libx11-dev, but it's complaining about undefined references to XOpenDisplay, etc. Is there something else I need to install to get it building?

(1 edit)

Well that's embarrassing... I'm a pretty bad game dev.

By VM, are you doing it on a proper VM or WSL? The latter doesn't always work with X11.

Can you post the entire error?
(I suck at this. Sorry.)

I see other people made it easy with running it on the web... well...

All good! I'm probably just missing a library or have a path wrong or something. It's a VirtualBox VM running Ubuntu 20.04 LTS. I installed `build-essential` and `libx11-dev`. Here's what I get when I run `make`:


(1 edit)

According to what I found, compiling with this command should work: make "LDFLAGS=-lX11 -lm -L/usr/lib/x86_64-linux-gnu/" full-clean all

I'm not sure though, since I'm on Manjaro and it puts the libraries in a different place.
No, actually.

Run it manually, it should work:

rm -f main.o gfx.o game.o worldgen.o battle.o game

rm -f config.h

cp config.def.h config.h

cc -c -o main.o -std=c89 -Wall -pedantic -D_XOPEN_SOURCE=600 -g -Wno-deprecated-declarations main.c

cc -c -o gfx.o -std=c89 -Wall -pedantic -D_XOPEN_SOURCE=600 -g -Wno-deprecated-declarations gfx.c

cc -c -o game.o -std=c89 -Wall -pedantic -D_XOPEN_SOURCE=600 -g -Wno-deprecated-declarations game.c

cc -c -o worldgen.o -std=c89 -Wall -pedantic -D_XOPEN_SOURCE=600 -g -Wno-deprecated-declarations worldgen.c

cc -c -o battle.o -std=c89 -Wall -pedantic -D_XOPEN_SOURCE=600 -g -Wno-deprecated-declarations battle.c

cc -o game main.o gfx.o game.o worldgen.o battle.o -lX11 -lm

I think it's working for those manual commands because the library args come after the object file args. When I move `${LD_FLAGS}` after `${OBJ}` in the `game` target in the Makefile, it builds. See also https://github.com/jumper149/blugon/issues/22.

I've got it running now, thanks!