DCurrent / openbor

OpenBOR is the ultimate 2D side scrolling engine for beat em' ups, shooters, and more!
http://www.chronocrash.com
BSD 3-Clause "New" or "Revised" License
901 stars 121 forks source link

Build failing on Linux #241

Closed naviabbot closed 2 years ago

naviabbot commented 2 years ago

Using commit e6aec66.

When running build.sh (./build.sh 4 amd64), the following error is displayed.

-------------------------------------------------------
OpenBOR v3.0 Build 7139 (commit hash e6aec66) - http://www.ChronoCrash.com

All rights reserved.
See LICENSE and README within OpenBOR root for details.

Copyright (c) 2004 - 2018 OpenBOR Team
-------------------------------------------------------
-------------------------------------------------------
   Linux amd64 SDK (x86_64-pc-linux-gnu) Environment Loaded!
-------------------------------------------------------

Removing All LINUX Files...
Done!

Compiling LINUX Port: openbor.c...
Compiling LINUX Port: openborscript.c...
Compiling LINUX Port: sdl/control.c...
Compiling LINUX Port: sdl/sblaster.c...
Compiling LINUX Port: sdl/timer.c...
Compiling LINUX Port: sdl/sdlport.c...
Compiling LINUX Port: sdl/video.c...
Compiling LINUX Port: sdl/videocommon.c...
Compiling LINUX Port: sdl/threads.c...
Compiling LINUX Port: sdl/menu.c...
Compiling LINUX Port: sdl/opengl.c...
Compiling LINUX Port: sdl/loadgl.c...
Compiling LINUX Port: source/adpcmlib/adpcm.c...
Compiling LINUX Port: source/gfxlib/2xSaI.c...
Compiling LINUX Port: source/gfxlib/bilinear.c...
Compiling LINUX Port: source/gfxlib/dotmatrix.c...
Compiling LINUX Port: source/gfxlib/gfx.c...
Compiling LINUX Port: source/gfxlib/hq2x.c...
Compiling LINUX Port: source/gfxlib/scale2x.c...
Compiling LINUX Port: source/gfxlib/scanline.c...
Compiling LINUX Port: source/gfxlib/simple2x.c...
Compiling LINUX Port: source/gfxlib/tv2x.c...
Compiling LINUX Port: source/gamelib/draw.c...
Compiling LINUX Port: source/gamelib/draw16.c...
Compiling LINUX Port: source/gamelib/draw32.c...
Compiling LINUX Port: source/gamelib/font.c...
Compiling LINUX Port: source/gamelib/translation.c...
Compiling LINUX Port: source/gamelib/anigif.c...
Compiling LINUX Port: source/gamelib/bitmap.c...
Compiling LINUX Port: source/gamelib/screen.c...
Compiling LINUX Port: source/gamelib/screen16.c...
Compiling LINUX Port: source/gamelib/screen32.c...
Compiling LINUX Port: source/gamelib/loadimg.c...
Compiling LINUX Port: source/gamelib/palette.c...
Compiling LINUX Port: source/gamelib/packfile.c...
Compiling LINUX Port: source/gamelib/filecache.c...
Compiling LINUX Port: source/gamelib/pixelformat.c...
Compiling LINUX Port: source/gamelib/soundmix.c...
Compiling LINUX Port: source/gamelib/spriteq.c...
Compiling LINUX Port: source/gamelib/sprite.c...
Compiling LINUX Port: source/gamelib/spritex8p16.c...
Compiling LINUX Port: source/gamelib/spritex8p32.c...
Compiling LINUX Port: source/gamelib/models.c...
Compiling LINUX Port: source/gamelib/transform.c...
Compiling LINUX Port: source/gamelib/filters.c...
Compiling LINUX Port: source/stringptr.c...
Compiling LINUX Port: source/utils.c...
Compiling LINUX Port: source/stristr.c...
Compiling LINUX Port: source/omath.c...
Compiling LINUX Port: source/scriptlib/StackedSymbolTable.c...
source/utils.c: In function ‘checkAlloc’:
source/utils.c:307:9: error: ‘mallinfo’ is deprecated [-Werror=deprecated-declarations]
  307 |         writeToLogFile("Memory usage at exit: %u\n", mallinfo().arena);
      |         ^~~~~~~~~~~~~~
In file included from source/utils.c:13:
/usr/include/malloc.h:118:24: note: declared here
  118 | extern struct mallinfo mallinfo (void) __THROW __MALLOC_DEPRECATED;
      |                        ^~~~~~~~
cc1: all warnings being treated as errors
make: *** [Makefile:713: source/utils.o] Error 1
make: *** Waiting for unfinished jobs....

Removing All LINUX Files...
Done!

Further more, when running make BUILD_LINUX=1, the following is found:

Compiling LINUX Port: openbor.c...
/bin/sh: line 1: /gcc: No such file or directory
make: *** [Makefile:713: openbor.o] Error 127

gcc --version output:

gcc (GCC) 11.1.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
msmalik681 commented 2 years ago

What distro are you using ?

naviabbot commented 2 years ago

I should have posted that. I'm using Garuda Linux, which itself is a hacked and tweaked up Arch.

msmalik681 commented 2 years ago

I compile with gcc-7 you can see if it is installed with gcc-7 --version if not maybe pacman -S gcc-7 to install not sure of the package name on arch might be gcc7 anyway once you have it edit the makefile like this:

CC = $(LNXDEV)/$(PREFIX)gcc-7

and it should compile fine. tell the truth gcc11 got quite far in the build process we might be better off targeting that version for future builds.

msmalik681 commented 2 years ago

Ok i am going to close this issue down but @naviabbot could you please confirm you got this working.