Skip to content

Instantly share code, notes, and snippets.

@lucasw
Last active September 8, 2023 01:13
Show Gist options
  • Save lucasw/e1b516d258a987ac1393af9790a2f5eb to your computer and use it in GitHub Desktop.
Save lucasw/e1b516d258a987ac1393af9790a2f5eb to your computer and use it in GitHub Desktop.
Compile Doom on Linux
@lucasw
Copy link
Author

lucasw commented Jun 19, 2017

Ultimate Doom from GOG on Linux

$2.39 on sale.

Linux install

wine setup_the_ultimate_doom_2.0.0.3.exe

It runs a bit then says it has errors but continues on.
Check ~/.wine/drive_c/GOG Games/DOOM and DOOM.WAD is in it
the md5sum is c4fe9fd920207691a9f493668e0a2083 which matches https://doomwiki.org/wiki/Doom_files

Next copy DOOM.WAD to /usr/share/games/doom, launch zdoom

Doom 2 from GOG

Similar install messages like Runtime Error (at 69:445): and then Runtime Error (at 196:800): Invalid Opcode then Runtime Error (at 196:807): Out of Global Vars range., -> just press OK, then exit at the end (not Launch).

sudo cp ~/.wine/drive_c/GOG\ Games/DOOM\ 2/doom2/DOOM2.WAD /usr/share/games/doom/

There are also a bunch of WAD files in ~/.wine/drive_c/GOG Games/DOOM 2/master/wads/

Final Doom

Haven't tried it yet.

@lucasw
Copy link
Author

lucasw commented Jun 23, 2017

Slade

building from source

sudo apt-get install libsfml-dev libftgl-dev libwxbase3.0-dev libfluidsynth-dev libglew-dev libwxgtk3.0-dev libwxgtk-media3.0-dev

git clone https://github.com/sirjuddington/SLADE.git

building stable branch

http://slade.mancubus.net/index.php?page=wiki&wikipage=Ubuntu-Step-by-Step-Compilation

git checkout remotes/origin/stable

Ubuntu 16.04

In file included from /home/lucasw/other/games/doom/build_zdoom/slade/src/General/VersionCheck.cpp:32:0:
/home/lucasw/other/games/doom/build_zdoom/slade/src/./UI/WxStuff.h:15:1: error: ‘wxMenuItem’ does not name a type
 wxMenuItem* createMenuItem(wxMenu* menu, int id, string label, string help = wxEmptyString, string 
 ^

Clean and re-cmake, now it works.

Ubuntu 14.04

building master branch on Ubuntu 14.04

Was able to do this shortly before discovering I should be using the stable branch, which does compile on the version of gcc that comes with 14.04- c++14 is needed to build master without all the changes outlined below I had to make.

need wxwidgets, fluidsynth

sudo apt-get install libwxbase3.0-dev libfluidsynth-dev

Can't get libjack-dev for fluidsynth

The following packages have unmet dependencies:

 libjack-dev : Depends: libjack0 (= 1:0.121.3+20120418git75e3e20b-2.1ubuntu1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
sudo apt-get install libjack0

Have to remove
libasound2-plugins:i386 libjack-jackd2-0 libjack-jackd2-0:i386

sudo apt-get install libsfml-dev libftgl-dev
/usr/include/wx-3.0/wx/cursor.h:93:22: error: ‘wxIsBusy’ was not declared in this scope
         if( wxIsBusy() )

Try earlier 2.8 wxwidgets?
Nope

src/Application/SLADEWxApp.cpp:#error This will not compile with wxWidgets older than 3.0.0 !

https://ubuntuforums.org/archive/index.php/t-1853849.html

sudo apt-get install libwxgtk3.0-dev

(need to delete the build dir and redo cmake ../SLADE)

/home/lucasw/other/games/doom/SLADE/src/./General/Log.h:5:2: warning: scoped enums only available with -std=c++11 or -std=gnu++11 [enabled by default]
  enum class MessageType
  ^
/home/lucasw/other/games/doom/SLADE/src/./General/Log.h: In function ‘void Log::info(int, const char*)’:
/home/lucasw/other/games/doom/SLADE/src/./General/Log.h:34:58: error: ‘MessageType’ is not a class or namespace
  inline void info(int level, const char* text) { message(MessageType::Info, level, text); }
CMAKE_CXX_FLAGS:STRING=-std=c++11
[ 35%] Building CXX precompiled header src/cotire/slade_CXX_prefix.hxx.gch
c++: error: unrecognized command line option ‘-std=c++14’
CMake Error at /home/lucasw/other/games/doom/SLADE/cmake/cotire.cmake:1848 (message):
  cotire: error 1 precompiling
  /home/lucasw/other/games/doom/build_slade/src/cotire/slade_CXX_prefix.hxx.
Call Stack (most recent call first):
  /home/lucasw/other/games/doom/SLADE/cmake/cotire.cmake:3512 (cotire_precompile_prefix_header)

Delete c++14 from

src/slade_CXX_cotire.cmake:set (COTIRE_TARGET_COMPILE_FLAGS_RELEASE "-std=c++11;-pthread;-O3;-std=c++14")
and a couple others

but then

/home/lucasw/other/games/doom/SLADE/src/Application/SLADEWxApp.cpp: In member function ‘bool SLADEWxApp::singleInstanceCheck()’:
/home/lucasw/other/games/doom/SLADE/src/Application/SLADEWxApp.cpp:489:17: error: ‘make_unique’ is not a member of ‘std’
   auto client = std::make_unique<MainAppFLClient>();
g++ (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4

instead

CMAKE_CXX_FLAGS:STRING=-std=c++1y

Better go back to CMakeLists.txt isntead of editing output files:

# c++14 is required to compile
if(CMAKE_VERSION VERSION_LESS 3.1)
  add_compile_options(-std=c++1y)

But that doesn't fix enum issue.

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1y")

Still no make_unique in 1y
https://stackoverflow.com/questions/24609271/errormake-unique-is-not-a-member-of-std

Put this in ../SLADE/src/Application/Main.h

namespace std {
    template<class T> struct _Unique_if {
        typedef unique_ptr<T> _Single_object;
    };

    template<class T> struct _Unique_if<T[]> {
        typedef unique_ptr<T[]> _Unknown_bound;
    };

    template<class T, size_t N> struct _Unique_if<T[N]> {
        typedef void _Known_bound;
    };

    template<class T, class... Args>
        typename _Unique_if<T>::_Single_object
        make_unique(Args&&... args) {
            return unique_ptr<T>(new T(std::forward<Args>(args)...));
        }

    template<class T>
        typename _Unique_if<T>::_Unknown_bound
        make_unique(size_t n) {
            typedef typename remove_extent<T>::type U;
            return unique_ptr<T>(new U[n]());
        }

    template<class T, class... Args>
        typename _Unique_if<T>::_Known_bound
        make_unique(Args&&...) = delete;
}
/home/lucasw/other/games/doom/SLADE/src/General/Log.cpp: In function ‘void Log::init()’:
/home/lucasw/other/games/doom/SLADE/src/General/Log.cpp:105:3: error: ‘SFML_VERSION_PATCH’ was not declared in this scope
   SFML_VERSION_PATCH
   ^

#ifdef SFML_VERSION_MAJOR
  info(S_FMT(
    "Compiled with wxWidgets %i.%i.%i and SFML %i.%i.%i",
    wxMAJOR_VERSION,
    wxMINOR_VERSION,
    wxRELEASE_NUMBER,
    SFML_VERSION_MAJOR,
    SFML_VERSION_MINOR,
    SFML_VERSION_PATCH
  ));
#else
  info(S_FMT(
    "Compiled with wxWidgets %i.%i.%i",
    wxMAJOR_VERSION,
    wxMINOR_VERSION,
    wxRELEASE_NUMBER
  ));
#endif

Just make that #if 0

[ 43%] Building CXX object src/CMakeFiles/slade.dir/MainEditor/UI/DocsPage.o
/home/lucasw/other/games/doom/SLADE/src/MainEditor/UI/DocsPage.cpp: In constructor ‘DocsPage::DocsPage(wxWindow*)’:
/home/lucasw/other/games/doom/SLADE/src/MainEditor/UI/DocsPage.cpp:80:15: error: incomplete type ‘wxWebView’ used in nested name specifier
  wv_browser = wxWebView::New(this, -1, wxEmptyString);
               ^
/home/lucasw/other/games/doom/SLADE/src/MainEditor/UI/DocsPage.cpp:81:12: error: invalid use of incomplete type ‘class wxWebView’
  wv_browser->SetZoomType(wxWEBVIEW_ZOOM_TYPE_LAYOUT);

Disable USE_WEBVIEW_STARTPAGE

#ifdef USE_WEBVIEW_STARTPAGE

Edit SLADE/src/CMakeLists.txt

# if (NO_WEBVIEW)
  SET(WX_LIBS ${WX_LIBS} html)
# else (NO_WEBVIEW)
#   SET(WX_LIBS ${WX_LIBS} webview)
  # ADD_DEFINITIONS(-DUSE_WEBVIEW_STARTPAGE)
# endif (NO_WEBVIEW)
/home/lucasw/other/games/doom/SLADE/src/MapEditor/Renderer/Renderer.cpp: In constructor ‘MapEditor::Renderer::Renderer(MapEditContext&)’:
/home/lucasw/other/games/doom/SLADE/src/MapEditor/Renderer/Renderer.cpp:97:19: error: invalid initialization of non-const reference of type ‘MapEditContext&’ from an rvalue of type ‘<brace-enclosed initializer list>’
  anim_help_fade_{0}

context_{context}, -> context_(context),

also in Edit/ObjectEdit.cpp, Input.cpp, MoveObjects.cpp, Edit2D.cpp, Edit3D.cpp, ItemSelection.cpp, MapCanvas.cpp


/usr/bin/ld: cannot find -lwx_gtk2u_media-3.0

sudo apt-get install libwxgtk-media3.0-dev

And it is finished... but there is a stable branch that maybe could avoid all this:

Map Editing

using shareware doom1.wad

need a bsp compiler? Not for zdoom

@HyperEye
Copy link

HyperEye commented Sep 9, 2017

Have you tried Odamex? https://github.com/odamex/odamex

@PROPHESSOR
Copy link

@Rowan-Bird
Copy link

Chocolate Doom

https://github.com/chocolate-doom/chocolate-doom.git

This looks better:

git clone https://github.com/chocolate-doom/chocolate-doom.git
sudo apt-get install libsdl2-mixer-dev libsdl2-net-dev
cd chocolate-doom
./autogen.sh
make
./src/chocolate-doom -iwad ../DOOM1.WAD

It goes full-screen.

The keyboard doesn't work except for the buttons used for moving the player- it isn't possible to quit! Also not possible to save.

Also switching ctrl-alt-f1 to a terminal didn't work, the screen was just black.

So need to run in windowed mode, and how to fix the keyboard? chocolate-doom/chocolate-doom#740

./src/chocolate-doom-setup 

Made the game windowed and told it not to own the mouse, which allows quitting, but still no keyboard support.

Get these errors:

The key you just pressed is not recognized by SDL. To help get this fixed, please report this to the SDL mailing list <[email protected]> X11 KeyCode 29 (21), X11 KeySym 0x79 (y).

Looking to compile DOOM on a Wii running Debian, Chocolate DOOM doesn't support PowerPC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment