Not logged inGosu Forums
Forum back to Help Search Register Login
Up Topic Gosu / Gosu Exchange / Gosu and automake
- - By mstahl Date 2016-05-21 00:21
I'm having trouble getting Gosu to link properly into my project, which uses automake to generate makefiles.

I checked out gosu to /ext/gosu in my project folder, and followed the instructions to build it. I built it successfully and it installed a file. Is it even possible to statically compile gosu into a project?

I've been unsuccessful at pointing automake to either a systemwide gosu installation or this vendored in one in /ext. I've tried setting LDFLAGS to -L./ext/gosu -lgosu and every combination thereof to no avail. Sorry if this is a super n00bish question; I haven't programmed C++ in years and automake is a whole new thing to me.

If someone could even put the simple Gosu C++ tutorial code into context with a file structure and automake and everything, that would be extremely helpful.

Thanks in advance y'all.
Parent - - By jlnr (dev) Date 2016-05-21 08:42
Hm, I actually thought the CMake setup would build a static library, but that doesn't seem to be the case. Sorry!

I know nothing about autoconf, but you should be able to use a system-wide Gosu installation in every unixy build system by passing pkg-config --cflags gosu and pkg-config --libs gosu to the compiler and linker, respectively.
Parent - - By mstahl Date 2016-05-22 21:46
Huh. That worked! Today I learned pkg-config is a thing. Thanks.

Is a system-wide installation of gosu considered to be best practice? How can I distribute the gosu dynamic libraries with my project when I ship it?
Parent - By jlnr (dev) Date 2016-05-23 10:13
To be honest, I'm not sure. Most people (including me) only seem to be using Ruby/Gosu on Linux, not the C++ version.

How are games on Linux usually distributed? I guess I should finally install Steam in my Linux VM...

The cleanest way (to me) would be to build a .deb archive for both Gosu and your game, for which there is a shell script in the cmake/ folder that I haven't really tested. That should at least cover all Debian derivates.
Up Topic Gosu / Gosu Exchange / Gosu and automake

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill