mickelson / attract

A graphical front-end for command line emulators that hides the underlying operating system and is intended to be controlled with a joystick or gamepad.
http://attractmode.org
GNU General Public License v3.0
393 stars 115 forks source link

Compile Attract mode on Fedora #687

Open unites opened 2 years ago

unites commented 2 years ago

Fedora 34 specifically.

I think I got most of the required libraries. In fedora most of them are similar in naming, just requiring you to add '-devel'.

I am not sure if this is a missing a lib.

When running make, I end up getting this...

flags: -Wl,--export-dynamic -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/sysprof-4 -pthread  -DDATA_PATH=\"/usr/local/share/attract/\" -O2 -DNDEBUG -Iextlibs/miniz -Iextlibs/audio/include -D__STDC_CONSTANT_MACROS -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/sysprof-4 -pthread -I/usr/include/libxml2 -I/usr/include/ffmpeg -I/usr/include/AL  -Iextlibs/squirrel/include -Iextlibs/sqrat/include -Iextlibs/nowide -Iextlibs/nvapi -Iextlibs/rapidjson/include -Iextlibs/gameswf -DUSE_XLIB -DUSE_FONTCONFIG -DUSE_SWRESAMPLE
Compiling obj/swf.o...
In file included from /usr/include/c++/11/backward/hash_map:60,
                 from extlibs/gameswf/base/container.h:75,
                 from extlibs/gameswf/base/tu_file.h:18,
                 from src/swf.cpp:26:
/usr/include/c++/11/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Please use a non-deprecated interface with equivalent functionality instead. For a listing of replacement headers and interfaces, consult the file backward_warning.h. To disable this warning use -Wno-deprecated. [-Wcpp]
   32 | #warning \
      |  ^~~~~~~
In file included from extlibs/gameswf/gameswf/gameswf_action.h:13,
                 from extlibs/gameswf/gameswf/gameswf_impl.h:14,
                 from src/swf.cpp:28:
extlibs/gameswf/gameswf/gameswf_environment.h:150:17: error: ‘class array<gameswf::as_value> array<gameswf::as_value>::array’ is private within this context
  150 |                 array<as_value> m_local_register;       // function2 uses this
      |                 ^~~~~~~~~~~~~~~
extlibs/gameswf/gameswf/gameswf_environment.h:51:16: note: declared private here
   51 |         struct vm_stack : private array<as_value>
      |                ^~~~~~~~
extlibs/gameswf/gameswf/gameswf_environment.h:162:17: error: ‘class array<gameswf::as_value> array<gameswf::as_value>::array’ is private within this context
  162 |                 array<frame_slot>       m_local_frames;
      |                 ^~~~~~~~~~~~~~~~~
extlibs/gameswf/gameswf/gameswf_environment.h:51:16: note: declared private here
   51 |         struct vm_stack : private array<as_value>
      |                ^~~~~~~~
extlibs/gameswf/gameswf/gameswf_environment.h:179:78: error: ‘class array<gameswf::as_value> array<gameswf::as_value>::array’ is private within this context
  179 |                 as_value        get_variable(const tu_string& varname, const array<with_stack_entry>& with_stack) const;
      |                                                                              ^~~~~~~~~~~~~~~~~~~~~~~
extlibs/gameswf/gameswf/gameswf_environment.h:51:16: note: declared private here
   51 |         struct vm_stack : private array<as_value>
      |                ^~~~~~~~
extlibs/gameswf/gameswf/gameswf_environment.h:181:82: error: ‘class array<gameswf::as_value> array<gameswf::as_value>::array’ is private within this context
  181 |                 as_value        get_variable_raw(const tu_string& varname, const array<with_stack_entry>& with_stack) const;
      |                                                                                  ^~~~~~~~~~~~~~~~~~~~~~~
extlibs/gameswf/gameswf/gameswf_environment.h:51:16: note: declared private here
   51 |         struct vm_stack : private array<as_value>
      |                ^~~~~~~~
extlibs/gameswf/gameswf/gameswf_environment.h:183:88: error: ‘class array<gameswf::as_value> array<gameswf::as_value>::array’ is private within this context
  183 |                 void    set_variable(const tu_string& path, const as_value& val, const array<with_stack_entry>& with_stack);
      |                                                                                        ^~~~~~~~~~~~~~~~~~~~~~~
extlibs/gameswf/gameswf/gameswf_environment.h:51:16: note: declared private here
   51 |         struct vm_stack : private array<as_value>
      |                ^~~~~~~~
extlibs/gameswf/gameswf/gameswf_environment.h:185:92: error: ‘class array<gameswf::as_value> array<gameswf::as_value>::array’ is private within this context
  185 |                 void    set_variable_raw(const tu_string& path, const as_value& val, const array<with_stack_entry>& with_stack);
      |                                                                                            ^~~~~~~~~~~~~~~~~~~~~~~
extlibs/gameswf/gameswf/gameswf_environment.h:51:16: note: declared private here
   51 |         struct vm_stack : private array<as_value>
      |                ^~~~~~~~
make: *** [Makefile:460: obj/swf.o] Error 1
Arbars commented 2 years ago

This is regression caused by gcc 11.2.1:

http://gcc.gnu.org/gcc-11/changes.html

http://gcc.gnu.org/gcc-11/porting_to.html

Same troubles on ALT Linux Sisyphus build system.

bleargh45 commented 2 years ago

attract-gameswf-gcc11-no-access-control.patch.txt

Although not ideal (as it creates a separate Makefile rule for obj/swf.o, instead of relying on the global pattern rule), this patch will get Attract compiling against GCC 11; compiles here on Fedora 35.

davide125 commented 2 years ago

fwiw I can't repro this error, and attract-mode builds fine for me on Fedora 36 and on Rawhide. I submitted a package for it at https://bugzilla.redhat.com/show_bug.cgi?id=2056734

bleargh45 commented 2 years ago

@davide125 I see that your build is against v2.6.2, while our earlier comments are re: v2.6.1. It looks like this particular issue was fixed by 5b50df3 on Feb 15th by @mickelson .

Later today, I will update my checkout to v2.6.2, try again, and confirm that this fixes things and removes the need for the patch I had included above.

bleargh45 commented 2 years ago

CAN CONFIRM that v2.6.2 addresses the underlying compile issue that I was seeing on Fedora 35.

@unites / @Arbars ... at this point I would motion to close this ticket/issue, unless either of you can chime in and clearly indicate that you still have compile problems here.

Arbars commented 2 years ago

CAN CONFIRM that v2.6.2 addresses the underlying compile issue that I was seeing on Fedora 35

Confirm - bug fixed, Attract 2.6.2 compiled successfully on last version of GCC