RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login

    Step-by-step: How to build EmulationStation on Windows

    Scheduled Pinned Locked Moved Ideas and Development
    emulationstatiobuildingwindows
    108 Posts 22 Posters 83.3k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • fieldofcowsF
      fieldofcows
      last edited by fieldofcows

      Whilst building EmulationStation on Linux and Raspberry Pi is a relatively painless (and well documented) experience, the same cannot be said for building it on Windows. I recently went through that pain in order to create a Windows build of my ES fork for people to try so I thought I would document the process from the beginning to hopefully save others from having to work it out.

      I tested this process from a freshly installed Windows 10 VM so am confident that the steps are complete.


      Pre-requisites

      A few tools are required on the Windows system in order to build ES:

      7-zip:
      Download from http://7-zip.org/a/7z1604-x64.exe and install

      CMake:
      Download from https://cmake.org/files/v3.7/cmake-3.7.0-rc3-win64-x64.msi
      Ensure you select "Add CMake to the path for all users" during installation
      Visual Studio Community 2015:
      Use the web setup at https://www.visualstudio.com/vs/community/ selecting the following options:

      • Custom install
      • Select Visual C++->Common Tools (nothing else)
      • Select Common Tools->Git & GitHub
      • Everything else off

      Libraries

      Next we need to download and build all the dependent libraries for ES. I have linked to specific versions of the libraries in each case because I know these build without issue with ES.

      Boost:
      https://sourceforge.net/projects/boost/files/boost-binaries/1.61.0/boost_1_61_0-msvc-14.0-32.exe
      Unzip to c:\src\lib\boost_1_61_0

      Eigen:
      http://bitbucket.org/eigen/eigen/get/3.2.10.zip
      Unzip to c:\src\lib\eigen

      FreeImage:
      http://downloads.sourceforge.net/freeimage/FreeImage3170.zip
      Unzip to c:\src\lib\FreeImage
      Open c:\src\lib\FreeImage\FreeImage.2013.sln in Visual Studio
      Allow Visual Studio to convert project to 2015
      Edit tif_config.h to remove #define snprintf _snprintf
      Build Debug | Win32
      Build Release | Win32

      FreeType:
      http://download.savannah.gnu.org/releases/freetype/freetype-2.7.tar.gz
      Extract to c:\src\lib\freetype-2.7
      Open C:\src\lib\freetype-2.7\builds\windows\vc2010\freetype.sln i VS
      Allow VS to convert project to 2015
      Build Debug | Win32
      Build Release | Win32

      Curl:
      https://curl.haxx.se/download/curl-7.50.3.zip
      Unzip to c:\src\lib\curl-7.50.3
      Open a Visual Studio Developer Command Prompt
      Enter these commands:

           c:
           cd \src\lib\curl-7.50.3\winbuild
           nmake /f Makefile.vc mode=dll VC=14 DEBUG=yes
           nmake /f Makefile.vc mode=dll VC=14 DEBUG=no
      

      VLC (required for fieldofcows fork):
      https://github.com/RSATom/libvlc-sdk/archive/64ca3daa475a6539073f7544c740725b818642b2.zip (This is for V2.2.2)
      Extract to c:\src\lib\libvlc-2.2.2
      Download http://download.videolan.org/pub/videolan/vlc/2.2.2/win32/vlc-2.2.2-win32.zip (You will need the DLLs from this in a bit)

      SDL2:
      https://www.libsdl.org/release/SDL2-2.0.5.zip
      Extract to c:\src\lib\SDL2-2.0.5
      Open a Visual Studio Developer Command Prompt
      Enter these commands:

           c:
           cd \src\lib\SDL2-2.0.5
           mkdir build
           cd build
           cmake -G "Visual Studio 14 2015" ..
      

      Open c:\src\lib\SDL2-2.0.5\build\SDL2.sln in VS
      Build Debug | Win32
      Build Release | Win32


      Building EmulationStation

      The final step is to do the actual build of EmulationStation. This requires setting up CMake to find all of the libraries that we have just configured. The steps below build my fork. The instructions should work for other forks too, including the RetroPie fork. Just replace the URL in the git clone command.

      Open a Visual Studio Developer Command Prompt
      Enter these commands:

       c:
       cd \src
       git clone https://github.com/fieldofcows/EmulationStation.git EmulationStation
       cd EmulationStation
       mkdir build
       cd build
       set ES_LIB_DIR=c:\src\lib
       cmake -g "Visual Studio 14 2015 x86" .. -DEIGEN3_INCLUDE_DIR=%ES_LIB_DIR%\eigen -DFREETYPE_INCLUDE_DIRS=%ES_LIB_DIR%\freetype-2.7\include -DFREETYPE_LIBRARY=%ES_LIB_DIR%\freetype-2.7\objs\vc2010\Win32\freetype27.lib -DFreeImage_INCLUDE_DIR=%ES_LIB_DIR%\FreeImage\Source -DFreeImage_LIBRARY=%ES_LIB_DIR%\FreeImage\Dist\x32\FreeImage.lib -DSDL2_INCLUDE_DIR=%ES_LIB_DIR%\SDL2-2.0.5\include -DSDL2_LIBRARY=%ES_LIB_DIR%\SDL2-2.0.5\build\Release\SDL2.lib;%ES_LIB_DIR%\SDL2-2.0.5\build\Release\SDL2main.lib;Imm32.lib;version.lib -DBOOST_ROOT=%ES_LIB_DIR%\boost_1_61_0 -DBoost_LIBRARY_DIR=%ES_LIB_DIR%\boost_1_61_0\lib32-msvc-14.0 -DCURL_INCLUDE_DIR=%ES_LIB_DIR%\curl-7.50.3\include -DCURL_LIBRARY=%ES_LIB_DIR%\curl-7.50.3\builds\libcurl-vc14-x86-release-dll-ipv6-sspi-winssl\lib\libcurl.lib -DVLC_INCLUDE_DIR=%ES_LIB_DIR%\libvlc-2.2.2\include -DVLC_LIBRARIES=%ES_LIB_DIR%\libvlc-2.2.2\lib\msvc\libvlc.lib;%ES_LIB_DIR%\libvlc-2.2.2\lib\msvc\libvlccore.lib -DVLC_VERSION=1.0.0     
      

      When CMake has finished, open c:\src\EmulationStation\build\emulationstation-all.sln in Visual Studio 2015 and build.


      Running EmulationStation

      In order to run ES you need to make sure any DLLs required by ES are in the right place. The DLLs you need can all be found under the libraries subdirectory in c:\src\libs. The easiest thing to do is search for all the DLLs here and copy them to c:\src\EmulationStation\Release or c:\src\EmulationStation\Debug depending on which version you built.

      The required DLLs are:

      • boost_filesystem-vc140-mt-1_61.dll
      • boost_locale-vc140-mt-1_61.dll
      • boost_system-vc140-mt-1_61.dll
      • FreeImage.dll
      • libcurl.dll

      And if you're building my fork then you need the VLC DLLs from vlc-2.2.2-win32.zip

      • libvlc.dll
      • libvlccore.dll

      I hope I've remembered to cover everything :D I'm here to help if anyone gets stuck

      [Edit 16/11/2016: Update ES build commands to include 'cd EmulationStation'. Thanks @Zigurana]

      N R Z 3 Replies Last reply Reply Quote 9
      • N
        Nismo @fieldofcows
        last edited by

        @fieldofcows Amazing tutorial, thanks for taking your time for doing this.

        Seems that finally I could compile Emulationstation by miself. I'll try soon.

        Good job.

        1 Reply Last reply Reply Quote 0
        • R
          reigelgallarde @fieldofcows
          last edited by

          @fieldofcows Very nice... thanks dude...

          now how to edit EmulationStation? what software do I need? haha

          mattrixkM Z 2 Replies Last reply Reply Quote 0
          • mattrixkM
            mattrixk @reigelgallarde
            last edited by

            @reigelgallarde: I think Notepad should do it. Maybe Notepad++ if you want to get really hardcore.

            My ES themes: MetaPixel | Spare | Io | Indent

            1 Reply Last reply Reply Quote 2
            • Z
              Zigurana @fieldofcows
              last edited by

              @fieldofcows YOU ARE THE BEST!

              If tetris has thought me anything, it's that errors pile up and that accomplishments dissappear.

              1 Reply Last reply Reply Quote 0
              • Z
                Zigurana @reigelgallarde
                last edited by

                @reigelgallarde
                Depends on your preferences, notepad(++) will work, but if you want a full blown IDE to guide you through the code and supply code-completion and what not, use the VisualStudio. This also integrates with Github nowadays, and you will use it for building anyways.

                If tetris has thought me anything, it's that errors pile up and that accomplishments dissappear.

                mattrixkM 1 Reply Last reply Reply Quote 0
                • mattrixkM
                  mattrixk @Zigurana
                  last edited by

                  @Zigurana I was just s#!t-stirring when I mentioned notepad... I wasn't expecting it to actually be an applicable answer. I have no idea where to even begin if I wanted to try messing with ES itself. I'll stick to theme making for now.

                  My ES themes: MetaPixel | Spare | Io | Indent

                  Z 1 Reply Last reply Reply Quote 0
                  • T
                    tronkyfran
                    last edited by

                    I coudn't for my life make this work on windows before, lets give it a try again!!!

                    fieldofcowsF Z 2 Replies Last reply Reply Quote 1
                    • fieldofcowsF
                      fieldofcows @tronkyfran
                      last edited by

                      @tronkyfran If you do give it a go then please update this topic saying how you got on. I can then fix the steps if there are any errors. Thanks :)

                      Z 1 Reply Last reply Reply Quote 0
                      • Z
                        Zigurana @tronkyfran
                        last edited by

                        @tronkyfran
                        I'll be doing the same thing tonight.

                        If tetris has thought me anything, it's that errors pile up and that accomplishments dissappear.

                        1 Reply Last reply Reply Quote 1
                        • Z
                          Zigurana @mattrixk
                          last edited by

                          @mattrixk Ah, I see, I'm afraid my shitstirring-detectors were not booted up yet. All ready to go now!
                          (Wait, do I smell something?)

                          If tetris has thought me anything, it's that errors pile up and that accomplishments dissappear.

                          1 Reply Last reply Reply Quote 0
                          • Z
                            Zigurana @fieldofcows
                            last edited by Zigurana

                            @fieldofcows : Hey, I'm still running cmake for ES at the moment, but I just wanted to let you know that after cloning your ES repo, you need to create the build directory inside that newly downloaded EmulationStation directory, then call the long cmake command from there.
                            It's kinda obvious, but easy to miss if you are just copy pasting the commands to the command prompt.

                            Apart from that, everything is going swell!

                            [Edit: And the debug version is running! I can't believe this! I finally got out of this dependency hell! Thank you, I owe you a beer!]

                            If tetris has thought me anything, it's that errors pile up and that accomplishments dissappear.

                            fieldofcowsF 1 Reply Last reply Reply Quote 1
                            • fieldofcowsF
                              fieldofcows @Zigurana
                              last edited by

                              @Zigurana Yay! It works! Thanks for pointing out the error. I've edited it in the first post.

                              Did you manage to copy the dependent DLLs ok? By the time I was writing that bit up it was after midnight and I was working in Linux from memory so it's a bit vague.

                              1 Reply Last reply Reply Quote 0
                              • R
                                reigelgallarde
                                last edited by reigelgallarde

                                Thanks to all and thanks for the notepad(++) suggestion... haha my bad I was not specific with my question. I thought there was an easy way than notepad(++).
                                So I guess Visual Studio it is.

                                I'm not a c++ developer but I know a little about it. What I'm trying to achieve might not be possible.
                                What I'm really trying to do is make emulation station accept html/css/javascript codes.
                                So it would be easy for us to change theme. As in change all the designs the easy way. Not just color or background. And there are a lot of javascript plugins around free to download.

                                I was thinking of using nodejs + ejs. I'm still reading through chromium embedded framework. CEF has chromium inside it, much like google chrome. With this it would be easy for us to just throw in html/css/javascript templates. And with javascript or css3, imagine the animations we could do.

                                Outside ES, with this idea, using node-webkit , I was able to replicate hyperspin (frontend only) on my Windows machine (I have not tried but I'm sure it would also run on Linux). But my target is raspberry pi. node-webkit can't be opened on a lite raspbian which is too bad. It says GTK error, cannot open window* haha.

                                So with that I'm back to editing ES. But a novice like me on C++ this would take time. Good luck to me.

                                1 Reply Last reply Reply Quote 1
                                • K
                                  kfj001
                                  last edited by

                                  This was an awesome guide! One caveat I found - building emulationstation in VS ran into linker errors, but once I added /FORCE:MULTIPLE to the linker options (of the emulationstation project!) it built with no problems.

                                  1 Reply Last reply Reply Quote 0
                                  • T
                                    TheRealFox
                                    last edited by

                                    ""Allow Visual Studio to convert project to 2015"". In this section, i need a detalied explanation how to convert. I am noob , so can you explain step by step how to convert the project to 2015?

                                    fieldofcowsF 1 Reply Last reply Reply Quote 0
                                    • fieldofcowsF
                                      fieldofcows @TheRealFox
                                      last edited by

                                      @TheRealFox Just open the project in Visual Studio. It will pop up a box saying that the project is for an old version of visual studio and ask you if you want to update it. Just say yes and it should load and build ok.

                                      T 4 Replies Last reply Reply Quote 0
                                      • B
                                        binpaxjunk
                                        last edited by

                                        great work

                                        1 Reply Last reply Reply Quote 0
                                        • T
                                          TheRealFox @fieldofcows
                                          last edited by

                                          @fieldofcows The Project doesnt ask. I saw it also on a note at microsoft site: " If you decline the update when you're first prompted, you can update the project later by choosing Update VC++ project on the Project menu. If the command doesn't appear, then an update isn't required."

                                          T Z 2 Replies Last reply Reply Quote 0
                                          • T
                                            TheRealFox @fieldofcows
                                            last edited by TheRealFox

                                            @fieldofcows I see this also at microsoft site, that the conversion in some cases are not necessary. Check this: " If the project (.vcxproj) was created in Visual Studio 2010, Visual Studio 2012, or Visual Studio 2013 you have two options:
                                            You can skip the update. Visual Studio 2015 will load the project without making any changes if it has access to the Visual C++ tools in Visual Studio 2010 with SP1, Visual Studio 2012, or Visual Studio 2013. You can provide this access by installing the version of Visual Studio that the project was created with on the same machine that has Visual Studio 2015. For more information, see Installing Visual Studio Versions Side-by-Side. "

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

                                            Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.