Menu

#3 SegFault open file ./freera.log

v1.0 (example)
open
nobody
None
5
2021-05-01
2021-05-01
No

Just tried to compile this on Ubuntu 20.04.2 LTS, but it fails:

g++ -Wall -Werror -g  -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -std=c++98 -Wconversion -W -Wno-unused-parameter -c freera.cpp -o freera.o -I./include  -I./include/lua
In file included from ./include/common.h:5,
                 from freera.cpp:15:
./include/mapsini.h:11:1: error: typedef was ignored in this declaration [-Werror]
   11 | typedef class MissionMapsClass{
      | ^~~~~~~
./include/mapsini.h:28:1: error: typedef was ignored in this declaration [-Werror]
   28 | typedef class MPmapsClass{
      | ^~~~~~~
In file included from ./include/playerpool.h:10,
                 from ./include/graphicsengine.h:12,
                 from freera.cpp:18:
./include/player.h: In member function Uint16 Player::getStructureLosses() const:
./include/player.h:94:44: error: conversion from Uint32 {aka unsigned int} to Uint16 {aka short unsigned int} may change value [-Werror=conversion]
   94 |  Uint16 getStructureLosses() const {return structurelosses;}
      |                                            ^~~~~~~~~~~~~~~
In file included from ./include/graphicsengine.h:12,
                 from freera.cpp:18:
./include/playerpool.h: At global scope:
./include/playerpool.h:38:5: error: type qualifiers ignored on function return type [-Werror=ignored-qualifiers]
   38 |     const int MultiColourStringToNumb(const char* colour);
      |     ^~~~~
cc1plus: all warnings being treated as errors
make[1]: *** [Makefile:40: freera.o] Error 1
make[1]: Leaving directory '/home/squigley/src/freera++/src'
make: *** [Makefile:12: default] Error 2

The "cc1plus: all warnings being treated as errors" looked suspect, so I edited the config file, and removed "-Werror", which allowed it to compile, however attempting to run it:

$ ./freera
vfs/filesystem/externalvfs.cpp line 81: open file ./freera.log
Segmentation fault (core dumped)

Discussion


Log in to post a comment.