Code Monkey home page Code Monkey logo

dwarf_fortress_unfuck's Introduction

Unfucking Dwarf Fortress

⚠️: As of v50, this repo shouldn't be required anymore.

As we know, Dwarf Fortress is, most sadly, closed source. However, the multimedia layer for font rendering, audio output and graphics is open source. The problem is that the source is somewhat fucked with no clear way to build it and no official upstream source repo.

This repo exists to track upstream changes, to provide a build system and to unfuck the code a little bit.

Additionally, GTK has been removed as a hard dependancy and Dwarf Fortress will run without it. Note that if [WINDOWED=PROMPT] in data/init/init.txt then the game must be run from the terminal so that the user may make their choice with an input prompt.

Build Dependencies

To build the graphics library you must have the required libraries and dev packages installed.

You may ignore any GTK dependency if you do not want to build with support.

Arch Linux

pacman -S base-devel sdl sdl_image sdl_ttf openal pango atk gtk3 ncurses glew zlib ninja

Fedora

yum install gcc gcc-c++ cmake automake libXext-devel atk-devel cairo-devel gdk-pixbuf2-devel fontconfig-devel openal-soft-devel SDL_image-devel SDL_ttf-devel freetype-devel libX11-devel libICE-devel libSM-devel mesa-libGL mesa-libGL-devel glib2-devel mesa-lib GLU-devel pango-devel ncurses-devel libsndfile-devel gtk3-devel glew-devel SDL-devel glibc-devel zlib

Debian/Ubuntu

apt install -y cmake ninja-build libgl1-mesa-dev libsdl1.2-dev libsdl-image1.2-dev libsdl-ttf2.0-dev libglew-dev libopenal-dev libgtk-3-dev libsndfile1-dev

Building Library

To build the library:

cmake -Bbuild -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo
ninja -Cbuild

If the build completed successfully the library file is in build/libgraphics.so

dwarf_fortress_unfuck's People

Contributors

carbohydratesn avatar davidstrauss avatar ncfavier avatar ramblurr avatar rardiol avatar rayment avatar rofl0r avatar svenstaro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dwarf_fortress_unfuck's Issues

Provide a more detailed description.

Hi,
I came to this repo through the github search functionality. Could you please add more information to the readme about what this project does? Or provide a link to the forum post describing the project?
Thanks!

Tag Releases

It would be useful to some if releases would get a git tag.

Build fails on Arch Linux with Pango 1:1.44.6-1

I feel like this happens to you every few years (#3, #18). Anyway, we are once again failing to build and I haven't been able to turn up any easy solutions to implement at the package level. Error shown below.

[bash 5.0.9] $ aurman -S dwarffortress-ironhand
~~ initializing aurman...
~~ calculating solutions...

:: The following 1 package(s) are getting reinstalled:
   aur/dwarffortress-ironhand  0.44.12-1  ->  0.44.12-1

?? Do you want to continue? Y/n:
~~ looking for new pkgbuilds and fetching them...
==> Making package: dwarffortress-ironhand 0.44.12-1 (Mon 23 Sep 2019 09:09:13 PM EDT)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found dwarffortress-unfuck-0.44.12.tar.gz
  -> Found dwarffortress
  -> Found dwarffortress.desktop
  -> Found Ironhand_44_12A.zip
  -> Found dwarffortress.png
  -> Found df_44_12_linux.tar.bz2
==> Validating source files with sha256sums...
    dwarffortress-unfuck-0.44.12.tar.gz ... Passed
    dwarffortress ... Passed
    dwarffortress.desktop ... Passed
    Ironhand_44_12A.zip ... Passed
    dwarffortress.png ... Passed
==> Validating source_x86_64 files with sha256sums...
    df_44_12_linux.tar.bz2 ... Passed
==> Extracting sources...
  -> Extracting dwarffortress-unfuck-0.44.12.tar.gz with bsdtar
  -> Extracting Ironhand_44_12A.zip with bsdtar
  -> Extracting df_44_12_linux.tar.bz2 with bsdtar
==> Removing existing $pkgdir/ directory...
==> Starting build()...
CMake Warning (dev) at /usr/share/cmake-3.15/Modules/FindOpenGL.cmake:275 (message):
  Policy CMP0072 is not set: FindOpenGL prefers GLVND by default when
  available.  Run "cmake --help-policy CMP0072" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

  FindOpenGL found both a legacy GL library:

    OPENGL_gl_LIBRARY: /usr/lib/libGL.so

  and GLVND libraries for OpenGL and GLX:

    OPENGL_opengl_LIBRARY: /usr/lib/libOpenGL.so
    OPENGL_glx_LIBRARY: /usr/lib/libGLX.so

  OpenGL_GL_PREFERENCE has not been set to "GLVND" or "LEGACY", so for
  compatibility with CMake 3.10 and below the legacy GL library will be used.
Call Stack (most recent call first):
  CMakeLists.txt:8 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/aurman/dwarffortress-ironhand/src/dwarf_fortress_unfuck-0.44.12
Scanning dependencies of target graphics
[  4%] Building CXX object CMakeFiles/graphics.dir/g_src/enabler.cpp.o
In file included from /usr/include/pango-1.0/pango/pango-attributes.h:25,
                 from /usr/include/pango-1.0/pango/pango.h:25,
                 from /usr/include/gtk-2.0/gdk/gdktypes.h:37,
                 from /usr/include/gtk-2.0/gdk/gdkscreen.h:32,
                 from /usr/include/gtk-2.0/gdk/gdkapplaunchcontext.h:31,
                 from /usr/include/gtk-2.0/gdk/gdk.h:32,
                 from /usr/include/gtk-2.0/gtk/gtk.h:32,
                 from /tmp/aurman/dwarffortress-ironhand/src/dwarf_fortress_unfuck-0.44.12/g_src/enabler.cpp:4:
/usr/include/pango-1.0/pango/pango-font.h:29:10: fatal error: hb.h: No such file or directory
   29 | #include <hb.h>
      |          ^~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/graphics.dir/build.make:89: CMakeFiles/graphics.dir/g_src/enabler.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:76: CMakeFiles/graphics.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
==> ERROR: A failure occurred in build().
    Aborting...
2019-09-23 21:09:16,250 - wrappers - makepkg - ERROR - makepkg query ['makepkg', '-cf', '--noconfirm'] failed in directory /tmp/aurman/dwarffortress-ironhand

My Ducking turned up a few things, mostly above my knowledge level:

  1. https://bugs.archlinux.org/task/63460
  2. eiskaltdcpp/eiskaltdcpp@8b22479

Doesn't compile on suse.

Can't find the reason for this and I'm not proficient with cpp

In file included from g_src/enabler.cpp:115:0:
g_src/renderer_curses.cpp: In member function ‘virtual void renderer_curses::update_tile(int, int)’:
g_src/renderer_curses.cpp:104:38: error: ‘mvwaddwstr’ was not declared in this scope
mvwaddwstr(*stdscr_p, y, x, chs);
^

Final 0.47 tag

Hi there,

I maintain this for nixpkgs and it would be good if we could get a "0.47.05-final" tag or similar on master. We maintain builds for older DF versions and it would be good to have a final tag we could refer to.

Thanks!

Release build change breaks dfhack

Hey there,

I get the following when running the latest dfhack:

/[...]/libs/Dwarf_Fortress: symbol lookup error: /[...]/hack/libdfhack.so: undefined symbol: _ZN8rendererD1Ev

I ran nm -D on the built libgraphics.so and don't see renderer::~renderer() anywhere.

Cannot Build on Arch Linux x86_64

[ 14%] Building CXX object CMakeFiles/graphics.dir/g_src/enabler.cpp.o
In file included from /usr/lib64/glib-2.0/include/glibconfig.h:9:0,
                 from /usr/include/glib-2.0/glib/gtypes.h:32,
                 from /usr/include/glib-2.0/glib/galloca.h:32,
                 from /usr/include/glib-2.0/glib.h:30,
                 from /usr/include/glib-2.0/gobject/gbinding.h:28,
                 from /usr/include/glib-2.0/glib-object.h:23,
                 from /usr/include/glib-2.0/gio/gioenums.h:28,
                 from /usr/include/glib-2.0/gio/giotypes.h:28,
                 from /usr/include/glib-2.0/gio/gio.h:26,
                 from /usr/include/gtk-2.0/gdk/gdkapplaunchcontext.h:30,
                 from /usr/include/gtk-2.0/gdk/gdk.h:32,
                 from /usr/include/gtk-2.0/gtk/gtk.h:32,
                 from /tmp/packerbuild-1000/dwarffortress-lnp-git/dwarffortress-lnp-git/src/dwarf_fortress_unfuck/g_src/enabler.cpp:4:
/usr/include/glib-2.0/glib/gtypes.h: 在函数‘gboolean _GLIB_CHECKED_ADD_U64(guint64*, guint64, guint64)’中:
/usr/include/glib-2.0/glib/gmacros.h:127:29: 错误:数组‘_GStaticAssertCompileTimeAssertion_0’的大小为负
   __attribute__((__unused__))
                             ^
/usr/include/glib-2.0/glib/gmacros.h:217:120: 附注:in expansion of macro ‘G_GNUC_UNUSED’
 #define G_STATIC_ASSERT(expr) typedef char G_PASTE (_GStaticAssertCompileTimeAssertion_, __COUNTER__)[(expr) ? 1 : -1] G_GNUC_UNUSED
                                                                                                                        ^
/usr/include/glib-2.0/glib/gtypes.h:422:3: 附注:in expansion of macro ‘G_STATIC_ASSERT’
   G_STATIC_ASSERT(sizeof (unsigned long long) == sizeof (guint64));
   ^
CMakeFiles/graphics.dir/build.make:110: recipe for target 'CMakeFiles/graphics.dir/g_src/enabler.cpp.o' failed
make[2]: *** [CMakeFiles/graphics.dir/g_src/enabler.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/graphics.dir/all' failed
make[1]: *** [CMakeFiles/graphics.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

Build fails with AMD Catalyst - No rule to make target /usr/lib/libGL.so

I have 64-bit F20 with the proprietary ATI Catalyst driver installed. My build fails with:

$ make -j4
make[2]: *** No rule to make target `/usr/lib/libGL.so', needed by `libgraphics.so'.  Stop.
make[1]: *** [CMakeFiles/graphics.dir/all] Error 2
make: *** [all] Error 2

tl;dr

The solution is to run this:

# ln -s /usr/lib/fglrx/fglrx-libGL.so.1.2 /usr/lib/libGL.so

Then make again.

Full Explanation

This isn't your fault, it's the AMD graphics drivers, they mess with libGL and don't correctly symlink themselves in place.

I've solved this and you can close this issue, I'm just documenting the full steps here in case it's helpful to others.

I installed dependencies as per the readme.

Building fails:

$ make -j4
Scanning dependencies of target graphics
[ 10%] [ 10%] [ 20%] [ 20%] Building CXX object CMakeFiles/graphics.dir/g_src/command_line.cpp.o
Building CXX object CMakeFiles/graphics.dir/g_src/basics.cpp.o
Building CXX object CMakeFiles/graphics.dir/g_src/enabler.cpp.o
Building CXX object CMakeFiles/graphics.dir/g_src/enabler_input.cpp.o
/home/superjamie/.bin/df_linux/dwarf_fortress_unfuck/g_src/enabler_input.cpp: In member function ‘void enabler_inputst::add_input(SDL_Event&, Uint32)’:
/home/superjamie/.bin/df_linux/dwarf_fortress_unfuck/g_src/enabler_input.cpp:522:81: warning: narrowing conversion of ‘next_serial()’ from ‘Time {aka unsigned int}’ to ‘int’ inside { } [-Wnarrowing]
       Event e = {REPEAT_NOT, (InterfaceKey)INTERFACEKEY_OPTIONS, 0, next_serial(), now, 0};
                                                                                 ^
/home/superjamie/.bin/df_linux/dwarf_fortress_unfuck/g_src/enabler_input.cpp:522:90: warning: narrowing conversion of ‘now’ from ‘Uint32 {aka unsigned int}’ to ‘int’ inside { } [-Wnarrowing]
       Event e = {REPEAT_NOT, (InterfaceKey)INTERFACEKEY_OPTIONS, 0, next_serial(), now, 0};
                                                                                          ^
/home/superjamie/.bin/df_linux/dwarf_fortress_unfuck/g_src/enabler_input.cpp: In member function ‘void enabler_inputst::add_input_refined(KeyEvent&, Uint32, int)’:
/home/superjamie/.bin/df_linux/dwarf_fortress_unfuck/g_src/enabler_input.cpp:689:77: warning: narrowing conversion of ‘now’ from ‘Uint32 {aka unsigned int}’ to ‘int’ inside { } [-Wnarrowing]
       Event e = {key_repeat(*k), *k, 0, serial, now, enabler.simticks.read()};
                                                                             ^
[ 25%] Building CXX object CMakeFiles/graphics.dir/g_src/files.cpp.o
[ 30%] Building CXX object CMakeFiles/graphics.dir/g_src/find_files_posix.cpp.o
[ 35%] Building CXX object CMakeFiles/graphics.dir/g_src/graphics.cpp.o
[ 40%] Building CXX object CMakeFiles/graphics.dir/g_src/init.cpp.o
[ 45%] Building CXX object CMakeFiles/graphics.dir/g_src/interface.cpp.o
[ 50%] Building CXX object CMakeFiles/graphics.dir/g_src/keybindings.cpp.o
/home/superjamie/.bin/df_linux/dwarf_fortress_unfuck/g_src/graphics.cpp: In member function ‘void graphicst::addst(const string&, justification, int)’:
/home/superjamie/.bin/df_linux/dwarf_fortress_unfuck/g_src/graphics.cpp:226:60: warning: narrowing conversion of ‘((graphicst*)this)->graphicst::screenf’ from ‘char’ to ‘unsigned char’ inside { } [-Wnarrowing]
     struct ttf_id id = {str, screenf, screenb, screenbright};
                                                            ^
/home/superjamie/.bin/df_linux/dwarf_fortress_unfuck/g_src/graphics.cpp:226:60: warning: narrowing conversion of ‘((graphicst*)this)->graphicst::screenb’ from ‘char’ to ‘unsigned char’ inside { } [-Wnarrowing]
/home/superjamie/.bin/df_linux/dwarf_fortress_unfuck/g_src/graphics.cpp:226:60: warning: narrowing conversion of ‘((graphicst*)this)->graphicst::screenbright’ from ‘char’ to ‘unsigned char’ inside { } [-Wnarrowing]
[ 55%] Building CXX object CMakeFiles/graphics.dir/g_src/KeybindingScreen.cpp.o
[ 60%] Building CXX object CMakeFiles/graphics.dir/g_src/random.cpp.o
[ 65%] Building CXX object CMakeFiles/graphics.dir/g_src/renderer_offscreen.cpp.o
[ 70%] Building CXX object CMakeFiles/graphics.dir/g_src/resize++.cpp.o
[ 75%] Building CXX object CMakeFiles/graphics.dir/g_src/textures.cpp.o
[ 80%] Building CXX object CMakeFiles/graphics.dir/g_src/textlines.cpp.o
[ 85%] Building CXX object CMakeFiles/graphics.dir/g_src/ttf_manager.cpp.o
[ 90%] Building CXX object CMakeFiles/graphics.dir/g_src/ViewBase.cpp.o
[ 95%] Building CXX object CMakeFiles/graphics.dir/g_src/win32_compat.cpp.o
[100%] make[2]: *** No rule to make target `/usr/lib/libGL.so', needed by `libgraphics.so'.  Stop.
make[2]: *** Waiting for unfinished jobs....
Building CXX object CMakeFiles/graphics.dir/g_src/music_and_sound_openal.cpp.o
/home/superjamie/.bin/df_linux/dwarf_fortress_unfuck/g_src/ttf_manager.cpp: In member function ‘SDL_Surface* ttf_managerst::get_texture(int)’:
/home/superjamie/.bin/df_linux/dwarf_fortress_unfuck/g_src/ttf_manager.cpp:192:62: warning: narrowing conversion of ‘(Sint16)xpos’ from ‘Sint16 {aka short int}’ to ‘Uint16 {aka short unsigned int}’ inside { } [-Wnarrowing]
           SDL_Rect left = {0, 0, Sint16(xpos), Sint16(height)};
                                                              ^
/home/superjamie/.bin/df_linux/dwarf_fortress_unfuck/g_src/ttf_manager.cpp:192:62: warning: narrowing conversion of ‘(Sint16)height’ from ‘Sint16 {aka short int}’ to ‘Uint16 {aka short unsigned int}’ inside { } [-Wnarrowing]
/home/superjamie/.bin/df_linux/dwarf_fortress_unfuck/g_src/ttf_manager.cpp:196:85: warning: narrowing conversion of ‘(Sint16)it.std::_List_const_iterator<_Tp>::operator-><ttf_managerst::todum>()->ttf_managerst::todum::pixel_width’ from ‘Sint16 {aka short int}’ to ‘Uint16 {aka short unsigned int}’ inside { } [-Wnarrowing]
           SDL_Rect right = {Sint16(xpos), 0, Sint16(it->pixel_width), Sint16(height)};
                                                                                     ^
/home/superjamie/.bin/df_linux/dwarf_fortress_unfuck/g_src/ttf_manager.cpp:196:85: warning: narrowing conversion of ‘(Sint16)height’ from ‘Sint16 {aka short int}’ to ‘Uint16 {aka short unsigned int}’ inside { } [-Wnarrowing]
/home/superjamie/.bin/df_linux/dwarf_fortress_unfuck/g_src/ttf_manager.cpp:202:81: warning: narrowing conversion of ‘(Sint16)textimg_seg->SDL_Surface::w’ from ‘Sint16 {aka short int}’ to ‘Uint16 {aka short unsigned int}’ inside { } [-Wnarrowing]
         SDL_Rect dest = {Sint16(xpos), 0, Sint16(textimg_seg->w), Sint16(height)};
                                                                                 ^
/home/superjamie/.bin/df_linux/dwarf_fortress_unfuck/g_src/ttf_manager.cpp:202:81: warning: narrowing conversion of ‘(Sint16)height’ from ‘Sint16 {aka short int}’ to ‘Uint16 {aka short unsigned int}’ inside { } [-Wnarrowing]
make[1]: *** [CMakeFiles/graphics.dir/all] Error 2
make: *** [all] Error 2

Running make again produces:

$ make -j4
make[2]: *** No rule to make target `/usr/lib/libGL.so', needed by `libgraphics.so'.  Stop.
make[1]: *** [CMakeFiles/graphics.dir/all] Error 2
make: *** [all] Error 2

The missing file is owned by mesa-libGL-devel:

# rpm -qf /usr/lib/libGL.so
mesa-libGL-devel-10.3.3-1.20141110.fc20.i686

However it's a symlink to libGL.so.1.2.0:

# file -s /usr/lib/libGL.so
/usr/lib/libGL.so: broken symbolic link to `libGL.so.1.2.0'
# ls -lgo /usr/lib/libGL.so
lrwxrwxrwx. 1 14 Jan 26 22:30 /usr/lib/libGL.so -> libGL.so.1.2.0

Usually this is a file in mesa-libGL:

# yum provides "*/libGL.so.1.2.0"
...
mesa-libGL-10.3.3-1.20141110.fc20.i686 : Mesa libGL runtime libraries and DRI drivers
Repo        : updates
Matched from:
Filename    : /usr/lib/libGL.so.1.2.0

And it's missing:

# rpm -V mesa-libGL.i686
....L....    /usr/lib/libGL.so.1
missing     /usr/lib/libGL.so.1.2.0

One could restore the original file with:

# yum reinstall mesa-libGL.i686

Which then allows build to complete:

$ make
Linking CXX shared library libgraphics.so
[100%] Built target graphics

However, one should link against the AMD OpenGL implementation:

# ln -s /usr/lib/fglrx/fglrx-libGL.so.1.2 /usr/lib/libGL.so

Which successfully builds and works:

$ make clean
$ make
[  5%] Building CXX object CMakeFiles/graphics.dir/g_src/basics.cpp.o

...

[100%] Building CXX object CMakeFiles/graphics.dir/g_src/music_and_sound_openal.cpp.o
Linking CXX shared library libgraphics.so
[100%] Built target graphics

key bindings all crazy-like

When playing the game, key bindings are all weird, for example, 'p' is used in the top-level menu to view nobles as well as to enter 'look' mode. 'l' is used for announcements. These issues are not present in the default game or builds which do not use this git repo. I'm using Arch and the problem is present in the official package, even when built manually.

Additionally, upon starting the game, STDOUT is showing these errors which all seem to be added in the latest commit:

Unknown binding: CIVZONE_GATHER
Unknown binding: CIVZONE_GATHER_OPTIONS
Unknown binding: CIVZONE_GATHER_OPTIONS_PICK_TREES
Unknown binding: CIVZONE_GATHER_OPTIONS_PICK_SHRUBS
Unknown binding: CIVZONE_GATHER_OPTIONS_GATHER_FALLEN

(Gentoo) Build fails: 'mvwaddwstr' was not declared

$ make
[  5%] Building CXX object CMakeFiles/graphics.dir/g_src/enabler.cpp.o
In file included from /home/shazow/local/src/dwarf_fortress_unfuck/g_src/enabler.cpp:115:0:
/home/shazow/local/src/dwarf_fortress_unfuck/g_src/renderer_curses.cpp: In member function ‘virtual void renderer_curses::update_tile(int, int)’:
/home/shazow/local/src/dwarf_fortress_unfuck/g_src/renderer_curses.cpp:101:38: error: ‘mvwaddwstr’ was not declared in this scope
       mvwaddwstr(*stdscr_p, y, x, chs);
                                      ^
CMakeFiles/graphics.dir/build.make:103: recipe for target 'CMakeFiles/graphics.dir/g_src/enabler.cpp.o' failed
make[2]: *** [CMakeFiles/graphics.dir/g_src/enabler.cpp.o] Error 1
CMakeFiles/Makefile2:63: recipe for target 'CMakeFiles/graphics.dir/all' failed
make[1]: *** [CMakeFiles/graphics.dir/all] Error 2
Makefile:75: recipe for target 'all' failed
make: *** [all] Error 2

Looks like that part of the code hasn't changed so it's probably some version of some library that I have, hmm.

Missing build dependencies for Fedora 20

I had to install the following packages additionally to the ones installed by the command generously provided in the README file:

gtk2-devel.i686
glew-devel.i686

Also, gcc-c++gcc should probably be just gcc-c++

40.16 not supported?

Using the latest master with 40.16, I'm getting:

./libs/Dwarf_Fortress: symbol lookup error: ./libs/Dwarf_Fortress: undefined symbol: _ZN17file_compressorst15set_buffer_infoEPclS0_l

Is 4.016 not supported? 40.16 is where dfhack and DT are still, that's why I'm using it.

Controls munted

fedora 20 x64
phoebus graphics
after compiling and installing patch all in game bindings were wrong
eg
Building = d (normally b)
Designations = . (normally d)
Look = Shift+F1 (normally k)

After removing patch and converting all pngs to bmps problem went away

Can't build on Gentoo - [CMakeFiles/graphics.dir/g_src/enabler.cpp.o] Error 1

I'm on gentoo and somehow I can't compile it. I'm stuck at the last step. I have all dependencies installed (emul-linux-x86-sdl, emul-linux-x86-baselibs, emul-linux-x86-xlibs, emul-linux-x86-gtklibs).

eregus@enterprise ~/dwarf_fortress_unfuck/build $ cmake ..
-- The C compiler identification is GNU 4.8.3
-- The CXX compiler identification is GNU 4.8.3
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
Detected 64bit build arch. Setting 32bit build options.
This requires a multilib cross-compiler. Let's hope you have one.
-- Looking for XOpenDisplay in /usr/lib/libX11.so;/usr/lib/libXext.so
-- Looking for XOpenDisplay in /usr/lib/libX11.so;/usr/lib/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- Found X11: /usr/lib/libX11.so
-- Found OpenGL: /usr/lib/libGL.so  
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found SDL: /usr/lib/libSDLmain.a;/usr/lib/libSDL.so;-lpthread (found version "1.2.15") 
-- Found SDL_image: /usr/lib/libSDL_image.so (found version "1.2.12") 
-- Found SDL_ttf: /usr/lib/libSDL_ttf.so (found version "2.0.11") 
-- Found GTK2_GTK: /usr/lib/libgtk-x11-2.0.so  
-- Found GLEW: /usr/include  
-- Found OpenAL: /usr/lib/libopenal.so  
-- Found Freetype: /usr/lib/libfreetype.so (found version "2.5.4") 
-- Looking for wsyncup in /usr/lib/libcurses.so
-- Looking for wsyncup in /usr/lib/libcurses.so - found
-- Looking for cbreak in /usr/lib/libncurses.so
-- Looking for cbreak in /usr/lib/libncurses.so - found
-- Found Curses: /usr/lib/libncurses.so  
-- Configuring done
-- Generating done
-- Build files have been written to: /home/eregus/dwarf_fortress_unfuck/build
eregus@enterprise ~/dwarf_fortress_unfuck/build $ make -j4
Scanning dependencies of target graphics
[  5%] [ 10%] Building CXX object CMakeFiles/graphics.dir/g_src/basics.cpp.o
Building CXX object CMakeFiles/graphics.dir/g_src/command_line.cpp.o
[ 15%] [ 20%] Building CXX object CMakeFiles/graphics.dir/g_src/enabler.cpp.o
Building CXX object CMakeFiles/graphics.dir/g_src/enabler_input.cpp.o
In file included from /home/eregus/dwarf_fortress_unfuck/g_src/enabler.cpp:115:0:
/home/eregus/dwarf_fortress_unfuck/g_src/renderer_curses.cpp: In member function ‘virtual void renderer_curses::update_tile(int, int)’:
/home/eregus/dwarf_fortress_unfuck/g_src/renderer_curses.cpp:101:38: error: ‘mvwaddwstr’ was not declared in this scope
       mvwaddwstr(*stdscr_p, y, x, chs);
                                      ^
[ 25%] Building CXX object CMakeFiles/graphics.dir/g_src/files.cpp.o
/home/eregus/dwarf_fortress_unfuck/g_src/enabler_input.cpp: In member function ‘void enabler_inputst::add_input(SDL_Event&, Uint32)’:
/home/eregus/dwarf_fortress_unfuck/g_src/enabler_input.cpp:522:81: warning: narrowing conversion of ‘next_serial()’ from ‘Time {aka unsigned int}’ to ‘int’ inside { } [-Wnarrowing]
       Event e = {REPEAT_NOT, (InterfaceKey)INTERFACEKEY_OPTIONS, 0, next_serial(), now, 0};
                                                                                 ^
/home/eregus/dwarf_fortress_unfuck/g_src/enabler_input.cpp:522:90: warning: narrowing conversion of ‘now’ from ‘Uint32 {aka unsigned int}’ to ‘int’ inside { } [-Wnarrowing]
       Event e = {REPEAT_NOT, (InterfaceKey)INTERFACEKEY_OPTIONS, 0, next_serial(), now, 0};
                                                                                          ^
/home/eregus/dwarf_fortress_unfuck/g_src/enabler_input.cpp: In member function ‘void enabler_inputst::add_input_refined(KeyEvent&, Uint32, int)’:
/home/eregus/dwarf_fortress_unfuck/g_src/enabler_input.cpp:689:77: warning: narrowing conversion of ‘now’ from ‘Uint32 {aka unsigned int}’ to ‘int’ inside { } [-Wnarrowing]
       Event e = {key_repeat(*k), *k, 0, serial, now, enabler.simticks.read()};
                                                                             ^
[ 30%] Building CXX object CMakeFiles/graphics.dir/g_src/find_files_posix.cpp.o
make[2]: *** [CMakeFiles/graphics.dir/g_src/enabler.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/graphics.dir/all] Error 2
make: *** [all] Error 2
eregus@enterprise ~/dwarf_fortress_unfuck/build $

lib32-glew is also a dependency on Arch

graphics.so fails to link without this library:

Linking CXX shared library libgraphics.so
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.1/../../../libGLEW.so when searching for -lGLEW
/usr/bin/ld: skipping incompatible /usr/lib/libGLEW.so when searching for -lGLEW
/usr/bin/ld: cannot find -lGLEW
collect2: error: ld returned 1 exit status
CMakeFiles/graphics.dir/build.make:616: recipe for target 'libgraphics.so' failed
make[2]: *** [libgraphics.so] Error 1
CMakeFiles/Makefile2:60: recipe for target 'CMakeFiles/graphics.dir/all' failed
make[1]: *** [CMakeFiles/graphics.dir/all] Error 2
Makefile:76: recipe for target 'all' failed
make: *** [all] Error 2

Installing lib32-glew resolved the issue and allowed me to build graphics.so.

Build fails on 64-bit arch

When building this project using instructions from the readme, I get the following error:

music_and_sound_openal.cpp:(.text._ZN9__gnu_cxx13new_allocatorISt13_Rb_tree_nodeISt4pairIKS2_IbiEjEEE8allocateEjPKv[_ZN9__gnu_cxx13new_allocatorISt13_Rb_tree_nodeISt4pairIKS2_IbiEjEEE8allocateEjPKv]+0x45): undefined reference to `operator new(unsigned int)'
/usr/bin/ld: CMakeFiles/graphics.dir/g_src/basics.cpp.o: file class ELFCLASS32 incompatible with ELFCLASS64
/usr/bin/ld: final link failed: File in wrong format
collect2: error: ld returned 1 exit status
CMakeFiles/graphics.dir/build.make:619: recipe for target 'libgraphics.so' failed
make[2]: *** [libgraphics.so] Error 1
CMakeFiles/Makefile2:63: recipe for target 'CMakeFiles/graphics.dir/all' failed
make[1]: *** [CMakeFiles/graphics.dir/all] Error 2
Makefile:75: recipe for target 'all' failed
make: *** [all] Error 2

System is Arch Linux on x86_64 with all necessary libraries installed in their respective 32-bit variantt

Reverting 10acd34 fixed this error for me. Seems like this is necessary for some libraries to get linked correctly as opposed to what you said in #2.

Do you need more information?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.