Aloshi / EmulationStation

A flexible emulator front-end supporting keyboardless navigation and custom system themes.
MIT License
2.06k stars 905 forks source link

Cannot build from source on Arch Linux #852

Open ghost opened 3 years ago

ghost commented 3 years ago

When trying to compile ES on Arch Linux (since the AUR package seems to be broken), I get the following errors:

In file included from /tmp/emulationstation/EmulationStation/es-app/src/views/gamelist/BasicGameListView.h:3,
                 from /tmp/emulationstation/EmulationStation/es-app/src/views/gamelist/BasicGameListView.cpp:1:
/tmp/emulationstation/EmulationStation/es-app/src/views/gamelist/ISimpleGameListView.h:37:14: error: ‘stack’ in namespace ‘std’ does not name a template type
   37 |         std::stack<FileData*> mCursorStack;
      |              ^~~~~
/tmp/emulationstation/EmulationStation/es-app/src/views/gamelist/ISimpleGameListView.h:7:1: note: ‘std::stack’ is defined in header ‘<stack>’; did you forget to ‘#include <stack>’?
    6 | #include "components/ImageComponent.h"
  +++ |+#include <stack>
    7 | 
/tmp/emulationstation/EmulationStation/es-app/src/views/gamelist/BasicGameListView.cpp: In member function ‘virtual void BasicGameListView::setCursor(FileData*)’:
/tmp/emulationstation/EmulationStation/es-app/src/views/gamelist/BasicGameListView.cpp:63:20: error: ‘mCursorStack’ was not declared in this scope; did you mean ‘CursorState’?
   63 |                 if(mCursorStack.empty() || mCursorStack.top() != cursor->getParent())
      |                    ^~~~~~~~~~~~
      |                    CursorState
/tmp/emulationstation/EmulationStation/es-app/src/views/gamelist/BasicGameListView.cpp:65:30: error: ‘stack’ is not a member of ‘std’
   65 |                         std::stack<FileData*> tmp;
      |                              ^~~~~
/tmp/emulationstation/EmulationStation/es-app/src/views/gamelist/BasicGameListView.cpp:8:1: note: ‘std::stack’ is defined in header ‘<stack>’; did you forget to ‘#include <stack>’?
    7 | #include "Settings.h"
  +++ |+#include <stack>
    8 | 
/tmp/emulationstation/EmulationStation/es-app/src/views/gamelist/BasicGameListView.cpp:65:44: error: expected primary-expression before ‘*’ token
   65 |                         std::stack<FileData*> tmp;
      |                                            ^
/tmp/emulationstation/EmulationStation/es-app/src/views/gamelist/BasicGameListView.cpp:65:45: error: expected primary-expression before ‘>’ token
   65 |                         std::stack<FileData*> tmp;
      |                                             ^
/tmp/emulationstation/EmulationStation/es-app/src/views/gamelist/BasicGameListView.cpp:65:47: error: ‘tmp’ was not declared in this scope; did you mean ‘tm’?
   65 |                         std::stack<FileData*> tmp;
      |                                               ^~~
      |                                               tm
/tmp/emulationstation/EmulationStation/es-app/src/views/gamelist/BasicGameListView.cpp:74:45: error: ‘stack’ is not a member of ‘std’
   74 |                         mCursorStack = std::stack<FileData*>();
      |                                             ^~~~~
/tmp/emulationstation/EmulationStation/es-app/src/views/gamelist/BasicGameListView.cpp:74:45: note: ‘std::stack’ is defined in header ‘<stack>’; did you forget to ‘#include <stack>’?
/tmp/emulationstation/EmulationStation/es-app/src/views/gamelist/BasicGameListView.cpp:74:59: error: expected primary-expression before ‘*’ token
   74 |                         mCursorStack = std::stack<FileData*>();
      |                                                           ^
/tmp/emulationstation/EmulationStation/es-app/src/views/gamelist/BasicGameListView.cpp:74:60: error: expected primary-expression before ‘>’ token
   74 |                         mCursorStack = std::stack<FileData*>();
      |                                                            ^
/tmp/emulationstation/EmulationStation/es-app/src/views/gamelist/BasicGameListView.cpp:74:62: error: expected primary-expression before ‘)’ token
   74 |                         mCursorStack = std::stack<FileData*>();
      |                                                              ^
make[2]: *** [es-app/CMakeFiles/emulationstation.dir/build.make:412: es-app/CMakeFiles/emulationstation.dir/src/views/gamelist/BasicGameListView.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:248: es-app/CMakeFiles/emulationstation.dir/all] Error 2
make: *** [Makefile:156: all] Error 2

Did I forget a dependency, or is there another error?

PascalVA commented 2 years ago

I have the same problem on Debian 11 when building from master. If I try to build from unstable I get a different error:

In file included from /home/vanacker/src/EmulationStation/es-core/src/Renderer_draw_gl.cpp:9:
/home/vanacker/src/EmulationStation/es-core/src/Util.h:23:22: error: ‘float round(float)’ conflicts with a previous declaration
   23 | float round(float num);
      |                      ^
In file included from /usr/include/c++/10/complex:44,
                 from /usr/include/eigen3/Eigen/Core:96,
                 from /usr/include/eigen3/Eigen/Dense:1,
                 from /home/vanacker/src/EmulationStation/es-core/src/Renderer.h:7,
                 from /home/vanacker/src/EmulationStation/es-core/src/Renderer_draw_gl.cpp:2:
/usr/include/c++/10/cmath:1756:3: note: previous declaration ‘constexpr float std::round(float)’
 1756 |   round(float __x)
      |   ^~~~~
/home/vanacker/src/EmulationStation/es-core/src/Renderer_draw_gl.cpp: In function ‘void Renderer::drawRect(float, float, float, float, unsigned int, GLenum, GLenum)’:
/home/vanacker/src/EmulationStation/es-core/src/Renderer_draw_gl.cpp:90:24: error: call of overloaded ‘round(float&)’ is ambiguous
   90 |   drawRect((int)round(x), (int)round(y), (int)round(w), (int)round(h), color, blend_sfactor, blend_dfactor);
      |                        ^
In file included from /usr/include/features.h:461,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/os_defines.h:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/c++config.h:522,
                 from /usr/include/c++/10/string:38,
                 from /home/vanacker/src/EmulationStation/es-core/src/platform.h:18,
                 from /home/vanacker/src/EmulationStation/es-core/src/Renderer_draw_gl.cpp:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:298:1: note: candidate: ‘double round(double)’
  298 | __MATHCALLX (round,, (_Mdouble_ __x), (__const__));
      | ^~~~~~~~~~~
In file included from /usr/include/c++/10/complex:44,
                 from /usr/include/eigen3/Eigen/Core:96,
                 from /usr/include/eigen3/Eigen/Dense:1,
                 from /home/vanacker/src/EmulationStation/es-core/src/Renderer.h:7,
                 from /home/vanacker/src/EmulationStation/es-core/src/Renderer_draw_gl.cpp:2:
/usr/include/c++/10/cmath:1760:3: note: candidate: ‘constexpr long double std::round(long double)’
 1760 |   round(long double __x)
      |   ^~~~~
/usr/include/c++/10/cmath:1756:3: note: candidate: ‘constexpr float std::round(float)’
 1756 |   round(float __x)
      |   ^~~~~
In file included from /home/vanacker/src/EmulationStation/es-core/src/Renderer_draw_gl.cpp:9:
/home/vanacker/src/EmulationStation/es-core/src/Util.h:23:7: note: candidate: ‘float round(float)’
   23 | float round(float num);
      |       ^~~~~
/home/vanacker/src/EmulationStation/es-core/src/Renderer_draw_gl.cpp:90:39: error: call of overloaded ‘round(float&)’ is ambiguous
   90 |   drawRect((int)round(x), (int)round(y), (int)round(w), (int)round(h), color, blend_sfactor, blend_dfactor);
      |                                       ^
In file included from /usr/include/features.h:461,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/os_defines.h:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/c++config.h:522,
                 from /usr/include/c++/10/string:38,
                 from /home/vanacker/src/EmulationStation/es-core/src/platform.h:18,
                 from /home/vanacker/src/EmulationStation/es-core/src/Renderer_draw_gl.cpp:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:298:1: note: candidate: ‘double round(double)’
  298 | __MATHCALLX (round,, (_Mdouble_ __x), (__const__));
      | ^~~~~~~~~~~
In file included from /usr/include/c++/10/complex:44,
                 from /usr/include/eigen3/Eigen/Core:96,
                 from /usr/include/eigen3/Eigen/Dense:1,
                 from /home/vanacker/src/EmulationStation/es-core/src/Renderer.h:7,
                 from /home/vanacker/src/EmulationStation/es-core/src/Renderer_draw_gl.cpp:2:
/usr/include/c++/10/cmath:1760:3: note: candidate: ‘constexpr long double std::round(long double)’
 1760 |   round(long double __x)
      |   ^~~~~
/usr/include/c++/10/cmath:1756:3: note: candidate: ‘constexpr float std::round(float)’
 1756 |   round(float __x)
      |   ^~~~~
In file included from /home/vanacker/src/EmulationStation/es-core/src/Renderer_draw_gl.cpp:9:
/home/vanacker/src/EmulationStation/es-core/src/Util.h:23:7: note: candidate: ‘float round(float)’
   23 | float round(float num);
      |       ^~~~~
/home/vanacker/src/EmulationStation/es-core/src/Renderer_draw_gl.cpp:90:54: error: call of overloaded ‘round(float&)’ is ambiguous
   90 |   drawRect((int)round(x), (int)round(y), (int)round(w), (int)round(h), color, blend_sfactor, blend_dfactor);
      |                                                      ^
In file included from /usr/include/features.h:461,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/os_defines.h:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/c++config.h:522,
                 from /usr/include/c++/10/string:38,
                 from /home/vanacker/src/EmulationStation/es-core/src/platform.h:18,
                 from /home/vanacker/src/EmulationStation/es-core/src/Renderer_draw_gl.cpp:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:298:1: note: candidate: ‘double round(double)’
  298 | __MATHCALLX (round,, (_Mdouble_ __x), (__const__));
      | ^~~~~~~~~~~
In file included from /usr/include/c++/10/complex:44,
                 from /usr/include/eigen3/Eigen/Core:96,
                 from /usr/include/eigen3/Eigen/Dense:1,
                 from /home/vanacker/src/EmulationStation/es-core/src/Renderer.h:7,
                 from /home/vanacker/src/EmulationStation/es-core/src/Renderer_draw_gl.cpp:2:
/usr/include/c++/10/cmath:1760:3: note: candidate: ‘constexpr long double std::round(long double)’
 1760 |   round(long double __x)
      |   ^~~~~
/usr/include/c++/10/cmath:1756:3: note: candidate: ‘constexpr float std::round(float)’
 1756 |   round(float __x)
      |   ^~~~~
In file included from /home/vanacker/src/EmulationStation/es-core/src/Renderer_draw_gl.cpp:9:
/home/vanacker/src/EmulationStation/es-core/src/Util.h:23:7: note: candidate: ‘float round(float)’
   23 | float round(float num);
      |       ^~~~~
/home/vanacker/src/EmulationStation/es-core/src/Renderer_draw_gl.cpp:90:69: error: call of overloaded ‘round(float&)’ is ambiguous
   90 |   drawRect((int)round(x), (int)round(y), (int)round(w), (int)round(h), color, blend_sfactor, blend_dfactor);
      |                                                                     ^
In file included from /usr/include/features.h:461,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/os_defines.h:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/c++config.h:522,
                 from /usr/include/c++/10/string:38,
                 from /home/vanacker/src/EmulationStation/es-core/src/platform.h:18,
                 from /home/vanacker/src/EmulationStation/es-core/src/Renderer_draw_gl.cpp:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:298:1: note: candidate: ‘double round(double)’
  298 | __MATHCALLX (round,, (_Mdouble_ __x), (__const__));
      | ^~~~~~~~~~~
In file included from /usr/include/c++/10/complex:44,
                 from /usr/include/eigen3/Eigen/Core:96,
                 from /usr/include/eigen3/Eigen/Dense:1,
                 from /home/vanacker/src/EmulationStation/es-core/src/Renderer.h:7,
                 from /home/vanacker/src/EmulationStation/es-core/src/Renderer_draw_gl.cpp:2:
/usr/include/c++/10/cmath:1760:3: note: candidate: ‘constexpr long double std::round(long double)’
 1760 |   round(long double __x)
      |   ^~~~~
/usr/include/c++/10/cmath:1756:3: note: candidate: ‘constexpr float std::round(float)’
 1756 |   round(float __x)
      |   ^~~~~
In file included from /home/vanacker/src/EmulationStation/es-core/src/Renderer_draw_gl.cpp:9:
/home/vanacker/src/EmulationStation/es-core/src/Util.h:23:7: note: candidate: ‘float round(float)’
   23 | float round(float num);
      |       ^~~~~
make[2]: *** [es-core/CMakeFiles/es-core.dir/build.make:199: es-core/CMakeFiles/es-core.dir/src/Renderer_draw_gl.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:298: es-core/CMakeFiles/es-core.dir/all] Error 2
make: *** [Makefile:171: all] Error 2
davim00 commented 2 years ago

I get the same error when trying to compile on Ubuntu 21-04:

In file included from /home/gzusrock/Projects/EmulationStation_appimage/EmulationStation/es-app/src/views/gamelist/BasicGameListView.h:3,
                 from /home/gzusrock/Projects/EmulationStation_appimage/EmulationStation/es-app/src/views/gamelist/BasicGameListView.cpp:1:
/home/gzusrock/Projects/EmulationStation_appimage/EmulationStation/es-app/src/views/gamelist/ISimpleGameListView.h:37:7: error: ‘stack’ in namespace ‘std’ does not name a template type
   37 |  std::stack<FileData*> mCursorStack;
      |       ^~~~~
/home/gzusrock/Projects/EmulationStation_appimage/EmulationStation/es-app/src/views/gamelist/ISimpleGameListView.h:7:1: note: ‘std::stack’ is defined in header ‘<stack>’; did you forget to ‘#include <stack>’?
    6 | #include "components/ImageComponent.h"
  +++ |+#include <stack>
    7 | 
/home/gzusrock/Projects/EmulationStation_appimage/EmulationStation/es-app/src/views/gamelist/BasicGameListView.cpp: In member function ‘virtual void BasicGameListView::setCursor(FileData*)’:
/home/gzusrock/Projects/EmulationStation_appimage/EmulationStation/es-app/src/views/gamelist/BasicGameListView.cpp:63:6: error: ‘mCursorStack’ was not declared in this scope; did you mean ‘CursorState’?
   63 |   if(mCursorStack.empty() || mCursorStack.top() != cursor->getParent())
      |      ^~~~~~~~~~~~
      |      CursorState
/home/gzusrock/Projects/EmulationStation_appimage/EmulationStation/es-app/src/views/gamelist/BasicGameListView.cpp:65:9: error: ‘stack’ is not a member of ‘std’
   65 |    std::stack<FileData*> tmp;
      |         ^~~~~
/home/gzusrock/Projects/EmulationStation_appimage/EmulationStation/es-app/src/views/gamelist/BasicGameListView.cpp:8:1: note: ‘std::stack’ is defined in header ‘<stack>’; did you forget to ‘#include <stack>’?
    7 | #include "Settings.h"
  +++ |+#include <stack>
    8 | 
/home/gzusrock/Projects/EmulationStation_appimage/EmulationStation/es-app/src/views/gamelist/BasicGameListView.cpp:65:23: error: expected primary-expression before ‘*’ token
   65 |    std::stack<FileData*> tmp;
      |                       ^
/home/gzusrock/Projects/EmulationStation_appimage/EmulationStation/es-app/src/views/gamelist/BasicGameListView.cpp:65:24: error: expected primary-expression before ‘>’ token
   65 |    std::stack<FileData*> tmp;
      |                        ^
/home/gzusrock/Projects/EmulationStation_appimage/EmulationStation/es-app/src/views/gamelist/BasicGameListView.cpp:65:26: error: ‘tmp’ was not declared in this scope; did you mean ‘tm’?
   65 |    std::stack<FileData*> tmp;
      |                          ^~~
      |                          tm
/home/gzusrock/Projects/EmulationStation_appimage/EmulationStation/es-app/src/views/gamelist/BasicGameListView.cpp:74:24: error: ‘stack’ is not a member of ‘std’
   74 |    mCursorStack = std::stack<FileData*>();
      |                        ^~~~~
/home/gzusrock/Projects/EmulationStation_appimage/EmulationStation/es-app/src/views/gamelist/BasicGameListView.cpp:74:24: note: ‘std::stack’ is defined in header ‘<stack>’; did you forget to ‘#include <stack>’?
/home/gzusrock/Projects/EmulationStation_appimage/EmulationStation/es-app/src/views/gamelist/BasicGameListView.cpp:74:38: error: expected primary-expression before ‘*’ token
   74 |    mCursorStack = std::stack<FileData*>();
      |                                      ^
/home/gzusrock/Projects/EmulationStation_appimage/EmulationStation/es-app/src/views/gamelist/BasicGameListView.cpp:74:39: error: expected primary-expression before ‘>’ token
   74 |    mCursorStack = std::stack<FileData*>();
      |                                       ^
/home/gzusrock/Projects/EmulationStation_appimage/EmulationStation/es-app/src/views/gamelist/BasicGameListView.cpp:74:41: error: expected primary-expression before ‘)’ token
   74 |    mCursorStack = std::stack<FileData*>();
      |                                         ^
In file included from /home/gzusrock/Projects/EmulationStation_appimage/EmulationStation/es-app/src/views/gamelist/BasicGameListView.h:3,
                 from /home/gzusrock/Projects/EmulationStation_appimage/EmulationStation/es-app/src/views/gamelist/DetailedGameListView.h:3,
                 from /home/gzusrock/Projects/EmulationStation_appimage/EmulationStation/es-app/src/views/gamelist/DetailedGameListView.cpp:1:
/home/gzusrock/Projects/EmulationStation_appimage/EmulationStation/es-app/src/views/gamelist/ISimpleGameListView.h:37:7: error: ‘stack’ in namespace ‘std’ does not name a template type
   37 |  std::stack<FileData*> mCursorStack;
      |       ^~~~~
/home/gzusrock/Projects/EmulationStation_appimage/EmulationStation/es-app/src/views/gamelist/ISimpleGameListView.h:7:1: note: ‘std::stack’ is defined in header ‘<stack>’; did you forget to ‘#include <stack>’?
    6 | #include "components/ImageComponent.h"
  +++ |+#include <stack>
    7 | 
In file included from /home/gzusrock/Projects/EmulationStation_appimage/EmulationStation/es-app/src/views/gamelist/ISimpleGameListView.cpp:1:
/home/gzusrock/Projects/EmulationStation_appimage/EmulationStation/es-app/src/views/gamelist/ISimpleGameListView.h:37:7: error: ‘stack’ in namespace ‘std’ does not name a template type
   37 |  std::stack<FileData*> mCursorStack;
      |       ^~~~~
/home/gzusrock/Projects/EmulationStation_appimage/EmulationStation/es-app/src/views/gamelist/ISimpleGameListView.h:7:1: note: ‘std::stack’ is defined in header ‘<stack>’; did you forget to ‘#include <stack>’?
    6 | #include "components/ImageComponent.h"
  +++ |+#include <stack>
    7 | 
/home/gzusrock/Projects/EmulationStation_appimage/EmulationStation/es-app/src/views/gamelist/ISimpleGameListView.cpp: In member function ‘virtual bool ISimpleGameListView::input(InputConfig*, Input)’:
/home/gzusrock/Projects/EmulationStation_appimage/EmulationStation/es-app/src/views/gamelist/ISimpleGameListView.cpp:69:6: error: ‘mCursorStack’ was not declared in this scope; did you mean ‘CursorState’?
   69 |      mCursorStack.push(cursor);
      |      ^~~~~~~~~~~~
      |      CursorState
/home/gzusrock/Projects/EmulationStation_appimage/EmulationStation/es-app/src/views/gamelist/ISimpleGameListView.cpp:77:7: error: ‘mCursorStack’ was not declared in this scope; did you mean ‘CursorState’?
   77 |    if(mCursorStack.size())
      |       ^~~~~~~~~~~~
      |       CursorState
make[2]: *** [es-app/CMakeFiles/emulationstation.dir/build.make:394: es-app/CMakeFiles/emulationstation.dir/src/views/gamelist/BasicGameListView.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [es-app/CMakeFiles/emulationstation.dir/build.make:433: es-app/CMakeFiles/emulationstation.dir/src/views/gamelist/ISimpleGameListView.cpp.o] Error 1
make[2]: *** [es-app/CMakeFiles/emulationstation.dir/build.make:407: es-app/CMakeFiles/emulationstation.dir/src/views/gamelist/DetailedGameListView.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:278: es-app/CMakeFiles/emulationstation.dir/all] Error 2
make: *** [Makefile:171: all] Error 2
davim00 commented 2 years ago

I was able to compile without errors using a fresh install of Ubuntu 18.04. I figured I would try it since the last merge was done in August of 2018.

My goal was to compile into an AppDir to make an AppImage. I quickly spun up a fresh Ubuntu 18.04 installation on a virtual machine and compiled EmulationStation into the AppDir, then I made the AppImage from that and used a shared folder to copy it to the host machine.

mikienet commented 1 year ago

To resolve this in 22.04:

nano /home/ "insert_username_here" /EmulationStation/es-app/src/views/gamelist/ISimpleGameListView.h

at the top .. above the 1st include .. add this line:

#include <stack>