whitedragon0000 / OpenBOR_PLUS

OpenBOR PLUS is the ultimate 2D side scrolling engine for beat em' ups, shooters, and more! This version has all official features plus new features!
http://www.chronocrash.com
BSD 3-Clause "New" or "Revised" License
49 stars 8 forks source link

Linux x86 Compile fails #106

Closed 2play closed 5 months ago

2play commented 5 months ago

Hello @whitedragon0000 I have tried to compile OpenBOR_Plus on x86 Linux specifically Armbian 24.2.4 Jammy KDE Neon Kernel: 6.6.21 gcc 11.4.0

I tried manually with platform BUILD_LINUX or BUILD_LINUX_LE_x86_64 and also with the build script ./build.sh 4

I'd appreciate any tips on how to complete it

Option 1 fails with:

make BUILD_LINUX=1
Compiling LINUX Port: openbor.c...
/bin/sh: 1: /gcc: not found
make: *** [Makefile:777: openbor.o] Error 127

Option 2 fails with:

make BUILD_LINUX_LE_x86_64=1
Compiling LINUX Port: openbor.c...
openbor.c: In function 'loadsettings':
openbor.c:2573:5: error: ignoring return value of 'fread' declared with attribute 'warn_unused_result' [-Werror=unused-result]
 2573 |     fread(&savedata, 1, sizeof(savedata), handle);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
openbor.c: In function 'loadfromdefault':
openbor.c:2606:5: error: ignoring return value of 'fread' declared with attribute 'warn_unused_result' [-Werror=unused-result]
 2606 |     fread(&savedata, 1, sizeof(savedata), handle);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
openbor.c: In function 'loadHighScoreFile':
openbor.c:2763:5: error: ignoring return value of 'fread' declared with attribute 'warn_unused_result' [-Werror=unused-result]
 2763 |     fread(&savescore, 1, sizeof(savescore), handle);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
openbor.c: In function 'loadScriptFile':
openbor.c:2946:5: error: ignoring return value of 'fread' declared with attribute 'warn_unused_result' [-Werror=unused-result]
 2946 |     fread(buf, 1, len, handle);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~
openbor.c: In function 'playRecordedInputs':
openbor.c:35518:9: error: ignoring return value of 'fread' declared with attribute 'warn_unused_result' [-Werror=unused-result]
35518 |         fread(&header, 6, 1, playrecstatus->handle);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
openbor.c:35519:9: error: ignoring return value of 'fread' declared with attribute 'warn_unused_result' [-Werror=unused-result]
35519 |         fread(&playrecstatus->starttime, sizeof(u32), 1, playrecstatus->handle);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
openbor.c:35520:9: error: ignoring return value of 'fread' declared with attribute 'warn_unused_result' [-Werror=unused-result]
35520 |         fread(&playrecstatus->endtime, sizeof(u32), 1, playrecstatus->handle);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
openbor.c:35521:9: error: ignoring return value of 'fread' declared with attribute 'warn_unused_result' [-Werror=unused-result]
35521 |         fread(&playrecstatus->totsynctime, sizeof(u32), 1, playrecstatus->handle);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
openbor.c:35522:9: error: ignoring return value of 'fread' declared with attribute 'warn_unused_result' [-Werror=unused-result]
35522 |         fread(&playrecstatus->cseed, sizeof(u32), 1, playrecstatus->handle);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
openbor.c:35523:9: error: ignoring return value of 'fread' declared with attribute 'warn_unused_result' [-Werror=unused-result]
35523 |         fread(&playrecstatus->seed, sizeof(unsigned long), 1, playrecstatus->handle);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
openbor.c:35524:9: error: ignoring return value of 'fread' declared with attribute 'warn_unused_result' [-Werror=unused-result]
35524 |         fread(&playrecstatus->ticks, sizeof(unsigned), 1, playrecstatus->handle);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
openbor.c:35525:9: error: ignoring return value of 'fread' declared with attribute 'warn_unused_result' [-Werror=unused-result]
35525 |         fread(playrecstatus->buffer, sizeof(RecKeys)*(playrecstatus->endtime+1), 1, playrecstatus->handle);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make: *** [Makefile:777: openbor.o] Error 1

Option 3 fails with:

-------------------------------------------------------
OpenBOR PLUS v4.0 Build 527 (commit hash a19b4f2) - http://www.ChronoCrash.com

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

Copyright (c) 2004 - 2018 OpenBOR Team
-------------------------------------------------------
-------------------------------------------------------
     ERROR - Linux x86 Environment Failed
                 SDK Installed?
-------------------------------------------------------
-------------------------------------------------------
   Linux x86 SDK (x86_64-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:771:9: error: ‘mallinfo’ is deprecated [-Werror=deprecated-declarations]
  771 |         writeToLogFile("Memory usage at exit: %u\n", mallinfo().arena);
      |         ^~~~~~~~~~~~~~
In file included from source/utils.c:13:
/usr/include/malloc.h:114:24: note: declared here
  114 | extern struct mallinfo mallinfo (void) __THROW __MALLOC_DEPRECATED;
      |                        ^~~~~~~~
cc1: all warnings being treated as errors
make: *** [Makefile:777: source/utils.o] Error 1
make: *** Waiting for unfinished jobs....

Removing All LINUX Files...
Done!
2play commented 5 months ago

Fixed it by using mallinfo2 rather installing an older gcc

2play commented 5 months ago

Will post fix suggestion for deprecated mallinfo