Project: Starfighter 2.0

Project: Starfighter 2.0

Postby onpon4 » 05 Jul 2019, 22:08

It just occurred to me, maybe it would be worthwhile sharing this here.

Just yesterday, I made a major release of Project: Starfighter, version 2.0. At the same time, I moved the project from Savannah to GitHub; website has been moved to here:

https://pr-starfighter.github.io

And the release announcement for version 2.0 is here:

https://github.com/pr-starfighter/starf ... s/tag/v2.0

This is something I've been working on for the past few months or so, and it includes a whole bunch of changes, but most notably:

* Full conversion from C++ to C
* Unicode and gettext translation support
* Much improved emulation of the v1.1 experience for Classic difficulty
* Resizable windows and automatic aspect ratio adjustment
User avatar
onpon4
 
Posts: 528
Joined: 13 Mar 2014, 18:38

Re: Project: Starfighter 2.0

Postby fluffrabbit » 06 Jul 2019, 01:03

Cool, I had some fun with this game a month ago. My only complaints were that fullscreen didn't work properly (presumably that's fixed now) and the difficulty was too high (because I'm an idiot who always plays on hard mode). I guess I have nothing more to complain about.

Full conversion from C++ to C

I am curious about this decision. While I am porting some of my code to C for fear of the dogpile that C++ is becoming, doing that for an entire game, and one which you did not originally author if I'm not mistaken, I think requires some explanation.

While you're flagellating yourself, you may want to consider improving the build system as well.

* Autoconf
* Automake
* pkg-config

Presumably those were the original build tools, but what a pain. So far I only use plain old makefiles in my own projects, though CMake is considered acceptable by most.
fluffrabbit
 
Posts: 570
Joined: 11 Apr 2019, 11:17

Re: Project: Starfighter 2.0

Postby onpon4 » 06 Jul 2019, 03:32

I converted it to C, quite simply, because I don't like C++ and work toward that was already started with version 1.2 (which removed classes; I wasn't involved in that release, but it was the first third-party maintenance of the game and is where most graphics and sounds were replaced).

Autotools is actually something I added, and I like it. Starfighter originally used a hand-written Makefile. Using Autotools means you don't need to worry about doing everything right for things like portability. I actually had a couple of people trying to package Starfighter for Linux distros approach me with patches to the old makefile because some thing that seemed innocuous was messing up their packaging effort. No one else has had that problem ever since the switch to Autotools as far as I know.

fullscreen didn't work properly (presumably that's fixed now)

I did change the method for fullscreen, so it should work better now than it used to.

and the difficulty was too high (because I'm an idiot who always plays on hard mode).

Yes, you're meant to play in Normal mode or possibly even Easy mode. Hard mode is, legitimately, designed to be hard, for expert players. Even I usually play on Normal mode. :) But hey, at least you didn't jump straight to Nightmare difficulty.
User avatar
onpon4
 
Posts: 528
Joined: 13 Mar 2014, 18:38

Re: Project: Starfighter 2.0

Postby fluffrabbit » 06 Jul 2019, 03:49

So, Autotools rather than CMake? Also, why pkg-config? I have legitimately never understood the philosophy behind those tools.

Yes, you're meant to play in Normal mode or possibly even Easy mode.

I think I'm more of an Easy Mode player.
fluffrabbit
 
Posts: 570
Joined: 11 Apr 2019, 11:17

Re: Project: Starfighter 2.0

Postby onpon4 » 06 Jul 2019, 05:01

pkg-config makes it easier to do what you need to do to get SDL to work properly (specifically the -I argument and -lSDL).

As for Autotools, I chose it over e.g. CMake for no particular reason other than dogmatism, but I see no compelling reason to switch to cmake now that it's (almost) working. (The "almost" is because something I did apparently broke make install's ability to install data files; I need to look into that tomorrow.)
User avatar
onpon4
 
Posts: 528
Joined: 13 Mar 2014, 18:38

Re: Project: Starfighter 2.0

Postby fluffrabbit » 06 Jul 2019, 05:18

Ugh. SDL config tools. What's wrong with -lSDL2?

I'm doing everything in-tree for now, haven't gotten around to separate data packages, so I don't know how tools affect that.
fluffrabbit
 
Posts: 570
Joined: 11 Apr 2019, 11:17

Re: Project: Starfighter 2.0

Postby Lyberta » 06 Jul 2019, 05:55

There is one big reason not to use autotools - they are developed by GNU project.
User avatar
Lyberta
 
Posts: 643
Joined: 19 Jun 2013, 10:45

Re: Project: Starfighter 2.0

Postby fluffrabbit » 06 Jul 2019, 06:05

Lyberta {l Wrote}:There is one big reason not to use autotools - they are developed by GNU project.

So you don't use GCC?
fluffrabbit
 
Posts: 570
Joined: 11 Apr 2019, 11:17

Re: Project: Starfighter 2.0

Postby Lyberta » 06 Jul 2019, 06:13

fluffrabbit {l Wrote}:So you don't use GCC?


Can't migrate yet.
User avatar
Lyberta
 
Posts: 643
Joined: 19 Jun 2013, 10:45

Re: Project: Starfighter 2.0

Postby fluffrabbit » 06 Jul 2019, 06:21

Lyberta {l Wrote}:
fluffrabbit {l Wrote}:So you don't use GCC?


Can't migrate yet.

Unless you're doing something really specific, CXX=clang++ should be all you need.
fluffrabbit
 
Posts: 570
Joined: 11 Apr 2019, 11:17

Re: Project: Starfighter 2.0

Postby onpon4 » 06 Jul 2019, 12:49

What's wrong with -lSDL2?

You also need to use the -I argument (note, it's probably rendering in your browser the same as lower-case "L", but it's not that; it's an upper-case "i"). It's necessary for cross-platform compatibility and varies depending on the system. On Linux systems the typical case is "-I/usr/include/SDL2" IIRC, but I might be misremembering.

pkg-config figures that out for you so you don't need to worry about it.
User avatar
onpon4
 
Posts: 528
Joined: 13 Mar 2014, 18:38

Re: Project: Starfighter 2.0

Postby smcameron » 06 Jul 2019, 17:11

Full conversion from C++ to C

Ha! Now there's something you don't see everyday!

Not a huge fan of autoconf myself for this reason:
(and nowadays, there isn't *quite* the ridiculous proliferation of wildly different unices that there were in the '80s that made autoconf so necessary, though I suppose there are still enough.)
{l Code}: {l Select All Code}
scameron@wombat ~/github/pr-starfighter/starfighter $ autoconf
configure.ac:11: error: possibly undefined macro: AM_INIT_AUTOMAKE
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
configure.ac:68: error: possibly undefined macro: AM_CONDITIONAL
scameron@wombat ~/github/pr-starfighter/starfighter $ ls
autom4te.cache  configure.ac  data  LICENSES  mac          misc   README.txt  src             win32build.sh
configure       COPYING       gfx   locale    Makefile.am  music  sound       starfighter.sh
scameron@wombat ~/github/pr-starfighter/starfighter $ ./configure
./configure: line 2115: syntax error near unexpected token `foreign'
./configure: line 2115: `AM_INIT_AUTOMAKE(foreign -Wall -Werror)'
scameron@wombat ~/github/pr-starfighter/starfighter $


Hmm, usually, "autoconfiscated" programs have a source distribution (output of "make dist") which includes a pre-built configure script to avoid the above nonsense... and poking around a bit more, I see *there is* such a source distribution: https://github.com/pr-starfighter/starf ... src.tar.gz Nice.

However, it fails to build for me:
{l Code}: {l Select All Code}
/usr/bin/ld: starfighter-game.o: undefined reference to symbol 'sincosf@@GLIBC_2.2.5'
/lib/x86_64-linux-gnu/libm.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Makefile:423: recipe for target 'starfighter' failed
make[2]: *** [starfighter] Error 1
make[2]: Leaving directory '/home/scameron/starfighter-2.0-src/src'
Makefile:445: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/scameron/starfighter-2.0-src'
Makefile:341: recipe for target 'all' failed
make: *** [all] Error 2


sincosf, eh? (I also tried "make CFLAGS='-O2 -D_GNU_SOURCE'" and that didn't help).

{l Code}: {l Select All Code}
scameron@wombat ~/starfighter-2.0-src $ find . -type f -print | xargs grep sincosf
Binary file ./src/starfighter-intermission.o matches
Binary file ./src/starfighter-game.o matches


Well that's odd. sincosf() only shows up in object files? Is there a macro that builds up sincosf() somehow? Pulled in from some object code built into those object files somehow?

FWIW, some info about my OS:

{l Code}: {l Select All Code}
scameron@wombat ~/starfighter-2.0-src $ uname -a
Linux wombat 4.4.180 #1 SMP PREEMPT Mon May 27 10:18:52 EDT 2019 x86_64 x86_64 x86_64 GNU/Linux
scameron@wombat ~/starfighter-2.0-src $ cat /etc/os-release
NAME="Linux Mint"
VERSION="18.1 (Serena)"
ID=linuxmint
ID_LIKE=ubuntu
PRETTY_NAME="Linux Mint 18.1"
VERSION_ID="18.1"
HOME_URL="http://www.linuxmint.com/"
SUPPORT_URL="http://forums.linuxmint.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/linuxmint/"
VERSION_CODENAME=serena
UBUNTU_CODENAME=xenial


Maybe missing a "-lm" somewhere that needs it? Hmm, out of ideas of things to try for now.
smcameron
 
Posts: 308
Joined: 29 Oct 2010, 23:44

Re: Project: Starfighter 2.0

Postby fluffrabbit » 06 Jul 2019, 19:33

Great stuff on autotools above. I won't comment on it as my brain is operating at half impulse right now.

Tomodachi, when you #include <SDL2/SDL.h>, your system search path is being used. If you want to static link, you copy the SDL headers into your project's include folder, as a directory called SDL2. This is standard.
fluffrabbit
 
Posts: 570
Joined: 11 Apr 2019, 11:17

Re: Project: Starfighter 2.0

Postby onpon4 » 06 Jul 2019, 22:34

The build system, incidentally, is broken, but only at the "make install" point; that one's my fault, though I haven't figured out exactly what I did wrong.

Building for run-in-place works fine. The way you're supposed to build for run-in-place is:

export SF_RUN_IN_PLACE=1
./configure
make

You're never supposed to call "autoconf". If you need to generate the configure script, the command for that is "autoreconf". I use the -vif options with that.

As for the error at build-time you mentioned, it sounds like a dependency issue, but without full context I can't say for sure.
User avatar
onpon4
 
Posts: 528
Joined: 13 Mar 2014, 18:38

Re: Project: Starfighter 2.0

Postby smcameron » 07 Jul 2019, 01:14

You're never supposed to call "autoconf". If you need to generate the configure script, the command for that is "autoreconf". I use the -vif options with that.

Thanks, I can never remember that.

This seemed to work to build the configure script. Didn't know about "-vif", which seems to avoid this ever present headache, so thanks for that:
{l Code}: {l Select All Code}
scameron@wombat ~/github/pr-starfighter/starfighter $ autoreconf
configure.ac:17: error: required file './compile' not found
configure.ac:17:   'automake --add-missing' can install 'compile'
configure.ac:11: error: required file './install-sh' not found
configure.ac:11:   'automake --add-missing' can install 'install-sh'
configure.ac:11: error: required file './missing' not found
configure.ac:11:   'automake --add-missing' can install 'missing'
src/Makefile.am: error: required file './depcomp' not found
src/Makefile.am:   'automake --add-missing' can install 'depcomp'
autoreconf: automake failed with exit status: 1


However, it still can't find sincosf(). Which seems to be in my math lib. This works:

{l Code}: {l Select All Code}
scameron@wombat ~ $ cat test_sincosf.c
#define _GNU_SOURCE         /* See feature_test_macros(7) */
#include <math.h>
#include <stdio.h>

int main(int argc, char *argv[])
{
   float angle = M_PI;
   float s, c;

   sincosf(angle, &s, &c);
   printf("%f, %f\n", s, c);
   return 0;
}
scameron@wombat ~ $ gcc -o test_sincosf test_sincosf.c -lm
scameron@wombat ~ $ ./test_sincosf
-0.000000, -1.000000
scameron@wombat ~ $
.

(although why is sin(M_PI) == negative zero?)

If I leave off the "-lm":
{l Code}: {l Select All Code}
scameron@wombat ~ $ gcc -o test_sincosf test_sincosf.c
/tmp/cc9jDPAz.o: In function `main':
test_sincosf.c:(.text+0x45): undefined reference to `sincosf'
collect2: error: ld returned 1 exit status


So I'm inclined to think a "-lm" is missing somewhere in the build, although the message is different, as previously it mentioned a specific glibc version.
Last edited by smcameron on 07 Jul 2019, 01:20, edited 1 time in total.
smcameron
 
Posts: 308
Joined: 29 Oct 2010, 23:44

Re: Project: Starfighter 2.0

Postby onpon4 » 07 Jul 2019, 01:20

What's the full output of ./configure though? I assume that's where the error occurs? Usually the configure script will give a hint as to what is wrong in its output.

Regarding -lm, that's included explicitly because, yes, it's required. It's part of starfighter_CFLAGS, along with the auto-generated SDL and Pango flags.
Last edited by onpon4 on 07 Jul 2019, 01:21, edited 1 time in total.
User avatar
onpon4
 
Posts: 528
Joined: 13 Mar 2014, 18:38

Re: Project: Starfighter 2.0

Postby smcameron » 07 Jul 2019, 01:21

Output of configure follows (it seemed to work):
{l Code}: {l Select All Code}
scameron@wombat ~/github/pr-starfighter/starfighter $ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for SDL... yes
Note: SDL_ttf not found; Unicode will not be supported.
Note: SDL_mixer not found; audio will not be supported.
checking for PANGO... yes
Using built-in screen width default
Using built-in screen height default
Preparing a run-in-place build
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking ctype.h usability... yes
checking ctype.h presence... yes
checking for ctype.h... yes
checking errno.h usability... yes
checking errno.h presence... yes
checking for errno.h... yes
checking libintl.h usability... yes
checking libintl.h presence... yes
checking for libintl.h... yes
checking locale.h usability... yes
checking locale.h presence... yes
checking for locale.h... yes
checking stdio.h usability... yes
checking stdio.h presence... yes
checking for stdio.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking time.h usability... yes
checking time.h presence... yes
checking for time.h... yes
checking math.h usability... yes
checking math.h presence... yes
checking for math.h... yes
checking pwd.h usability... yes
checking pwd.h presence... yes
checking for pwd.h... yes
checking for sys/stat.h... (cached) yes
checking for unistd.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking for atexit... yes
checking for mkdir... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating misc/Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands


Oh, it does say:
{l Code}: {l Select All Code}
Note: SDL_ttf not found; Unicode will not be supported.
Note: SDL_mixer not found; audio will not be supported.

(but does not indicate this should be fatal.)

Edit:
Tried:
{l Code}: {l Select All Code}
sudo apt-get install libsdl2-ttf-dev
sudo apt-get install libsdl2-mixer-dev

which made configure happier, but still won't link. However, now it's:
{l Code}: {l Select All Code}
usr/bin/ld: starfighter-audio.o: undefined reference to symbol 'atanf@@GLIBC_2.2.5'
/lib/x86_64-linux-gnu/libm.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Makefile:423: recipe for target 'starfighter' failed
make[2]: *** [starfighter] Error 1
make[2]: Leaving directory '/home/scameron/github/pr-starfighter/starfighter/src'
Makefile:468: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/scameron/github/pr-starfighter/starfighter'
Makefile:343: recipe for target 'all' failed
make: *** [all] Error 2


atanf() rather than sincosf().
Last edited by smcameron on 07 Jul 2019, 01:27, edited 1 time in total.
smcameron
 
Posts: 308
Joined: 29 Oct 2010, 23:44

Re: Project: Starfighter 2.0

Postby onpon4 » 07 Jul 2019, 01:24

I note tthat SDL_ttf and SDL_mixer are not found (needed for Unicode and sound support), but those are optional so that shouldn't be the issue. Everything else looks good.

So how about the output to make?
User avatar
onpon4
 
Posts: 528
Joined: 13 Mar 2014, 18:38

Re: Project: Starfighter 2.0

Postby smcameron » 07 Jul 2019, 01:28

Here's the complete output from make clean; make, after installing the missing sdl packages.
{l Code}: {l Select All Code}
scameron@wombat ~/github/pr-starfighter/starfighter $ make clean
Making clean in src
make[1]: Entering directory '/home/scameron/github/pr-starfighter/starfighter/src'
test -z "starfighter" || rm -f starfighter
rm -f *.o
make[1]: Leaving directory '/home/scameron/github/pr-starfighter/starfighter/src'
Making clean in misc
make[1]: Entering directory '/home/scameron/github/pr-starfighter/starfighter/misc'
make[1]: Nothing to be done for 'clean'.
make[1]: Leaving directory '/home/scameron/github/pr-starfighter/starfighter/misc'
make[1]: Entering directory '/home/scameron/github/pr-starfighter/starfighter'
make[1]: Nothing to be done for 'clean-am'.
make[1]: Leaving directory '/home/scameron/github/pr-starfighter/starfighter'
scameron@wombat ~/github/pr-starfighter/starfighter $ make
make  all-recursive
make[1]: Entering directory '/home/scameron/github/pr-starfighter/starfighter'
Making all in src
make[2]: Entering directory '/home/scameron/github/pr-starfighter/starfighter/src'
gcc -DHAVE_CONFIG_H -I. -I..  -DVERSION=\"2.0\" -Wall  -D_REENTRANT -I/usr/include/SDL2 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -lm -g -O2 -MT starfighter-Starfighter.o -MD -MP -MF .deps/starfighter-Starfighter.Tpo -c -o starfighter-Starfighter.o `test -f 'Starfighter.c' || echo './'`Starfighter.c
mv -f .deps/starfighter-Starfighter.Tpo .deps/starfighter-Starfighter.Po
gcc -DHAVE_CONFIG_H -I. -I..  -DVERSION=\"2.0\" -Wall  -D_REENTRANT -I/usr/include/SDL2 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -lm -g -O2 -MT starfighter-alien.o -MD -MP -MF .deps/starfighter-alien.Tpo -c -o starfighter-alien.o `test -f 'alien.c' || echo './'`alien.c
mv -f .deps/starfighter-alien.Tpo .deps/starfighter-alien.Po
gcc -DHAVE_CONFIG_H -I. -I..  -DVERSION=\"2.0\" -Wall  -D_REENTRANT -I/usr/include/SDL2 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -lm -g -O2 -MT starfighter-audio.o -MD -MP -MF .deps/starfighter-audio.Tpo -c -o starfighter-audio.o `test -f 'audio.c' || echo './'`audio.c
mv -f .deps/starfighter-audio.Tpo .deps/starfighter-audio.Po
gcc -DHAVE_CONFIG_H -I. -I..  -DVERSION=\"2.0\" -Wall  -D_REENTRANT -I/usr/include/SDL2 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -lm -g -O2 -MT starfighter-bullet.o -MD -MP -MF .deps/starfighter-bullet.Tpo -c -o starfighter-bullet.o `test -f 'bullet.c' || echo './'`bullet.c
mv -f .deps/starfighter-bullet.Tpo .deps/starfighter-bullet.Po
gcc -DHAVE_CONFIG_H -I. -I..  -DVERSION=\"2.0\" -Wall  -D_REENTRANT -I/usr/include/SDL2 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -lm -g -O2 -MT starfighter-cargo.o -MD -MP -MF .deps/starfighter-cargo.Tpo -c -o starfighter-cargo.o `test -f 'cargo.c' || echo './'`cargo.c
mv -f .deps/starfighter-cargo.Tpo .deps/starfighter-cargo.Po
gcc -DHAVE_CONFIG_H -I. -I..  -DVERSION=\"2.0\" -Wall  -D_REENTRANT -I/usr/include/SDL2 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -lm -g -O2 -MT starfighter-collectable.o -MD -MP -MF .deps/starfighter-collectable.Tpo -c -o starfighter-collectable.o `test -f 'collectable.c' || echo './'`collectable.c
mv -f .deps/starfighter-collectable.Tpo .deps/starfighter-collectable.Po
gcc -DHAVE_CONFIG_H -I. -I..  -DVERSION=\"2.0\" -Wall  -D_REENTRANT -I/usr/include/SDL2 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -lm -g -O2 -MT starfighter-colors.o -MD -MP -MF .deps/starfighter-colors.Tpo -c -o starfighter-colors.o `test -f 'colors.c' || echo './'`colors.c
mv -f .deps/starfighter-colors.Tpo .deps/starfighter-colors.Po
gcc -DHAVE_CONFIG_H -I. -I..  -DVERSION=\"2.0\" -Wall  -D_REENTRANT -I/usr/include/SDL2 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -lm -g -O2 -MT starfighter-cutscene.o -MD -MP -MF .deps/starfighter-cutscene.Tpo -c -o starfighter-cutscene.o `test -f 'cutscene.c' || echo './'`cutscene.c
mv -f .deps/starfighter-cutscene.Tpo .deps/starfighter-cutscene.Po
gcc -DHAVE_CONFIG_H -I. -I..  -DVERSION=\"2.0\" -Wall  -D_REENTRANT -I/usr/include/SDL2 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -lm -g -O2 -MT starfighter-defs.o -MD -MP -MF .deps/starfighter-defs.Tpo -c -o starfighter-defs.o `test -f 'defs.c' || echo './'`defs.c
mv -f .deps/starfighter-defs.Tpo .deps/starfighter-defs.Po
gcc -DHAVE_CONFIG_H -I. -I..  -DVERSION=\"2.0\" -Wall  -D_REENTRANT -I/usr/include/SDL2 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -lm -g -O2 -MT starfighter-engine.o -MD -MP -MF .deps/starfighter-engine.Tpo -c -o starfighter-engine.o `test -f 'engine.c' || echo './'`engine.c
mv -f .deps/starfighter-engine.Tpo .deps/starfighter-engine.Po
gcc -DHAVE_CONFIG_H -I. -I..  -DVERSION=\"2.0\" -Wall  -D_REENTRANT -I/usr/include/SDL2 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -lm -g -O2 -MT starfighter-event.o -MD -MP -MF .deps/starfighter-event.Tpo -c -o starfighter-event.o `test -f 'event.c' || echo './'`event.c
mv -f .deps/starfighter-event.Tpo .deps/starfighter-event.Po
gcc -DHAVE_CONFIG_H -I. -I..  -DVERSION=\"2.0\" -Wall  -D_REENTRANT -I/usr/include/SDL2 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -lm -g -O2 -MT starfighter-explosion.o -MD -MP -MF .deps/starfighter-explosion.Tpo -c -o starfighter-explosion.o `test -f 'explosion.c' || echo './'`explosion.c
mv -f .deps/starfighter-explosion.Tpo .deps/starfighter-explosion.Po
gcc -DHAVE_CONFIG_H -I. -I..  -DVERSION=\"2.0\" -Wall  -D_REENTRANT -I/usr/include/SDL2 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -lm -g -O2 -MT starfighter-game.o -MD -MP -MF .deps/starfighter-game.Tpo -c -o starfighter-game.o `test -f 'game.c' || echo './'`game.c
mv -f .deps/starfighter-game.Tpo .deps/starfighter-game.Po
gcc -DHAVE_CONFIG_H -I. -I..  -DVERSION=\"2.0\" -Wall  -D_REENTRANT -I/usr/include/SDL2 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -lm -g -O2 -MT starfighter-gfx.o -MD -MP -MF .deps/starfighter-gfx.Tpo -c -o starfighter-gfx.o `test -f 'gfx.c' || echo './'`gfx.c
mv -f .deps/starfighter-gfx.Tpo .deps/starfighter-gfx.Po
gcc -DHAVE_CONFIG_H -I. -I..  -DVERSION=\"2.0\" -Wall  -D_REENTRANT -I/usr/include/SDL2 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -lm -g -O2 -MT starfighter-info.o -MD -MP -MF .deps/starfighter-info.Tpo -c -o starfighter-info.o `test -f 'info.c' || echo './'`info.c
mv -f .deps/starfighter-info.Tpo .deps/starfighter-info.Po
gcc -DHAVE_CONFIG_H -I. -I..  -DVERSION=\"2.0\" -Wall  -D_REENTRANT -I/usr/include/SDL2 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -lm -g -O2 -MT starfighter-intermission.o -MD -MP -MF .deps/starfighter-intermission.Tpo -c -o starfighter-intermission.o `test -f 'intermission.c' || echo './'`intermission.c
mv -f .deps/starfighter-intermission.Tpo .deps/starfighter-intermission.Po
gcc -DHAVE_CONFIG_H -I. -I..  -DVERSION=\"2.0\" -Wall  -D_REENTRANT -I/usr/include/SDL2 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -lm -g -O2 -MT starfighter-mission.o -MD -MP -MF .deps/starfighter-mission.Tpo -c -o starfighter-mission.o `test -f 'mission.c' || echo './'`mission.c
mv -f .deps/starfighter-mission.Tpo .deps/starfighter-mission.Po
gcc -DHAVE_CONFIG_H -I. -I..  -DVERSION=\"2.0\" -Wall  -D_REENTRANT -I/usr/include/SDL2 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -lm -g -O2 -MT starfighter-player.o -MD -MP -MF .deps/starfighter-player.Tpo -c -o starfighter-player.o `test -f 'player.c' || echo './'`player.c
mv -f .deps/starfighter-player.Tpo .deps/starfighter-player.Po
gcc -DHAVE_CONFIG_H -I. -I..  -DVERSION=\"2.0\" -Wall  -D_REENTRANT -I/usr/include/SDL2 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -lm -g -O2 -MT starfighter-radio.o -MD -MP -MF .deps/starfighter-radio.Tpo -c -o starfighter-radio.o `test -f 'radio.c' || echo './'`radio.c
mv -f .deps/starfighter-radio.Tpo .deps/starfighter-radio.Po
gcc -DHAVE_CONFIG_H -I. -I..  -DVERSION=\"2.0\" -Wall  -D_REENTRANT -I/usr/include/SDL2 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -lm -g -O2 -MT starfighter-renderer.o -MD -MP -MF .deps/starfighter-renderer.Tpo -c -o starfighter-renderer.o `test -f 'renderer.c' || echo './'`renderer.c
mv -f .deps/starfighter-renderer.Tpo .deps/starfighter-renderer.Po
gcc -DHAVE_CONFIG_H -I. -I..  -DVERSION=\"2.0\" -Wall  -D_REENTRANT -I/usr/include/SDL2 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -lm -g -O2 -MT starfighter-save.o -MD -MP -MF .deps/starfighter-save.Tpo -c -o starfighter-save.o `test -f 'save.c' || echo './'`save.c
mv -f .deps/starfighter-save.Tpo .deps/starfighter-save.Po
gcc -DHAVE_CONFIG_H -I. -I..  -DVERSION=\"2.0\" -Wall  -D_REENTRANT -I/usr/include/SDL2 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -lm -g -O2 -MT starfighter-screen.o -MD -MP -MF .deps/starfighter-screen.Tpo -c -o starfighter-screen.o `test -f 'screen.c' || echo './'`screen.c
mv -f .deps/starfighter-screen.Tpo .deps/starfighter-screen.Po
gcc -DHAVE_CONFIG_H -I. -I..  -DVERSION=\"2.0\" -Wall  -D_REENTRANT -I/usr/include/SDL2 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -lm -g -O2 -MT starfighter-ship.o -MD -MP -MF .deps/starfighter-ship.Tpo -c -o starfighter-ship.o `test -f 'ship.c' || echo './'`ship.c
mv -f .deps/starfighter-ship.Tpo .deps/starfighter-ship.Po
gcc -DHAVE_CONFIG_H -I. -I..  -DVERSION=\"2.0\" -Wall  -D_REENTRANT -I/usr/include/SDL2 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -lm -g -O2 -MT starfighter-shop.o -MD -MP -MF .deps/starfighter-shop.Tpo -c -o starfighter-shop.o `test -f 'shop.c' || echo './'`shop.c
mv -f .deps/starfighter-shop.Tpo .deps/starfighter-shop.Po
gcc -DHAVE_CONFIG_H -I. -I..  -DVERSION=\"2.0\" -Wall  -D_REENTRANT -I/usr/include/SDL2 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -lm -g -O2 -MT starfighter-title.o -MD -MP -MF .deps/starfighter-title.Tpo -c -o starfighter-title.o `test -f 'title.c' || echo './'`title.c
mv -f .deps/starfighter-title.Tpo .deps/starfighter-title.Po
gcc -DHAVE_CONFIG_H -I. -I..  -DVERSION=\"2.0\" -Wall  -D_REENTRANT -I/usr/include/SDL2 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -lm -g -O2 -MT starfighter-weapons.o -MD -MP -MF .deps/starfighter-weapons.Tpo -c -o starfighter-weapons.o `test -f 'weapons.c' || echo './'`weapons.c
mv -f .deps/starfighter-weapons.Tpo .deps/starfighter-weapons.Po
gcc -DHAVE_CONFIG_H -I. -I..  -DVERSION=\"2.0\" -Wall  -D_REENTRANT -I/usr/include/SDL2 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -lm -g -O2 -MT starfighter-window.o -MD -MP -MF .deps/starfighter-window.Tpo -c -o starfighter-window.o `test -f 'window.c' || echo './'`window.c
mv -f .deps/starfighter-window.Tpo .deps/starfighter-window.Po
gcc -D_REENTRANT -I/usr/include/SDL2 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -lm -g -O2   -o starfighter starfighter-Starfighter.o starfighter-alien.o starfighter-audio.o starfighter-bullet.o starfighter-cargo.o starfighter-collectable.o starfighter-colors.o starfighter-cutscene.o starfighter-defs.o starfighter-engine.o starfighter-event.o starfighter-explosion.o starfighter-game.o starfighter-gfx.o starfighter-info.o starfighter-intermission.o starfighter-mission.o starfighter-player.o starfighter-radio.o starfighter-renderer.o starfighter-save.o starfighter-screen.o starfighter-ship.o starfighter-shop.o starfighter-title.o starfighter-weapons.o starfighter-window.o -lSDL2_image -lSDL2_mixer -lSDL2_ttf -lSDL2 -lpango-1.0 -lgobject-2.0 -lglib-2.0
/usr/bin/ld: starfighter-audio.o: undefined reference to symbol 'atanf@@GLIBC_2.2.5'
/lib/x86_64-linux-gnu/libm.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Makefile:423: recipe for target 'starfighter' failed
make[2]: *** [starfighter] Error 1
make[2]: Leaving directory '/home/scameron/github/pr-starfighter/starfighter/src'
Makefile:468: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/scameron/github/pr-starfighter/starfighter'
Makefile:343: recipe for target 'all' failed
make: *** [all] Error 2


Maybe the -lm needs to be later in the linker options? (just a guess).
smcameron
 
Posts: 308
Joined: 29 Oct 2010, 23:44

Re: Project: Starfighter 2.0

Postby smcameron » 07 Jul 2019, 01:35

Ok, this made it work:
{l Code}: {l Select All Code}
diff --git a/configure.ac b/configure.ac
index 03213fd..ffed0cc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -11,6 +11,7 @@ AC_INIT([Project: Starfighter], [2.0], [onpon4@riseup.net], [starfighter])
 AM_INIT_AUTOMAKE([foreign -Wall -Werror])
 AC_CONFIG_SRCDIR([src/Starfighter.c])
 AC_CONFIG_HEADERS([config.h])
+AC_SEARCH_LIBS([atanf], [m])
 PKG_PROG_PKG_CONFIG
 
 # Checks for programs.
smcameron
 
Posts: 308
Joined: 29 Oct 2010, 23:44

Re: Project: Starfighter 2.0

Postby smcameron » 07 Jul 2019, 01:42

Ha! A lot of those sound effects sound terrifically familiar! Glad I installed the missing SDL components or I never would have noticed. What are the odds. Small world.
smcameron
 
Posts: 308
Joined: 29 Oct 2010, 23:44

Re: Project: Starfighter 2.0

Postby Lyberta » 07 Jul 2019, 06:16

fluffrabbit {l Wrote}:Unless you're doing something really specific, CXX=clang++ should be all you need.


Clang doesn't support concepts at least. Not sure about other features.
User avatar
Lyberta
 
Posts: 643
Joined: 19 Jun 2013, 10:45

Re: Project: Starfighter 2.0

Postby fluffrabbit » 07 Jul 2019, 07:03

Lyberta {l Wrote}:
fluffrabbit {l Wrote}:Unless you're doing something really specific, CXX=clang++ should be all you need.


Clang doesn't support concepts at least. Not sure about other features.

It's not 2020 yet. All you have to do is wait. At least you're not trying to cross-compile or something.
fluffrabbit
 
Posts: 570
Joined: 11 Apr 2019, 11:17

Re: Project: Starfighter 2.0

Postby Lyberta » 07 Jul 2019, 12:22

fluffrabbit {l Wrote}:It's not 2020 yet. All you have to do is wait. At least you're not trying to cross-compile or something.


I've been using c++20 for over a year now and I've been using concepts since GCC 6 (TS version) so for about 3 years now.
User avatar
Lyberta
 
Posts: 643
Joined: 19 Jun 2013, 10:45

Re: Project: Starfighter 2.0

Postby onpon4 » 07 Jul 2019, 20:48

Just a quick update: I fixed the make install issue mentioned previously. Turns out I broke a conditional somewhere along the way, or maybe the conditional never worked at all. Anyway, it's fixed now, so the ./configure && make && make install procedure works as normal again now (source release downloads have been updated).
User avatar
onpon4
 
Posts: 528
Joined: 13 Mar 2014, 18:38

Who is online

Users browsing this forum: No registered users and 1 guest