goblinhack / zorbash

An ascii and/or pixelart roguelike.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problems compile under GNU/Linux x64

Andres6936 opened this issue · comments

Good day ...

The program doesn't finish the compilation, because I can't find the SDL2 [Maybe] library (which I have in its version 2.0.9), the problem is probably due in part to me, since I have compiled both SDL and SDL2, so the program [probably] won't be able to determine exactly which library to use.

Thanks ....

build.log

are you on ubuntu? if so,

sudo apt-get install libsdl2-dev
sudo apt-get install libsdl2-mixer-dev
sudo apt-get install libsdl2-ttf-dev

BTW this is a work in progress, I mean, it's years off being complete I reckon. But hey if you want to try it out, limited as it is, you might want to change the line in src/my_main.h #define ENABLE_INVERTED_GFX as I have the graphics inverted 8) I have poor eyesight, so I work with an inverted desktop - obviously when it is finished I'll turn this flag off

I'm sorry, I didn't express myself well.

Effectively, I already have SDL2 installed, but on the other hand I also have SDL installed, which is the cause of the problem.

The application fails to recognize the binaries for SDL2 and instead uses the binaries for SDL, hence the error.

gotch, Andres - time to remove this code in .RUNME I think

Prefer SDL over SDL2 as it seems more common

fix now I hope - and thanks for reporting it!

Bear in mind, like I said, very "in development" - mainly I use this as a C++ self education experience - but I do have hopeful plans this makes it to be an eventually released roguelike (free) with some kind of surface world. Something like ADOM, in my dreams!

Good day @goblinhack,

Problems with compilation continue to occur:

andres6936@Tierra ~/CLionProjects/Zorbash $ sh RUNME
RUNME: 21: .: Can't open ./scripts/common.sh

Try to compile with the Makefile of the src directory and the error is

andres6936@Tierra ~/CLionProjects/Zorbash $ make -f src/Makefile.base 
make: *** No rule to make target '.o/ascii.o', needed by 'zorbash'.  Stop.

So I decided to move to the src directory and try again:

andres6936@Tierra ~/CLionProjects/Zorbash $ cd src/
andres6936@Tierra ~/CLionProjects/Zorbash/src $ make -f Makefile.base
cc -c -o .o/ascii.o ascii.cpp
In file included from my_ascii.h:14,
                 from ascii.cpp:6:
my_tex.h:10:10: fatal error: SDL.h: No such file or directory
   10 | #include <SDL.h>
      |          ^~~~~~~
compilation terminated.
make: *** [Makefile.base:186: .o/ascii.o] Error 1

Hey Andres - can you do a fresh clone ? as ascii.cpp def exists.
scripts/common.sh was missing - not sure what happened. I just
fixed that there.

As for SDL.h, do you have SDL2 dev installed? SDL1 is too old.
Now that the missing file is there - it should tell you some more
clues

I just did a fresh build there on ubuntu and it's back working (ubuntu 19.04)
So give it another try now

andres6936@Tierra ~/CLionProjects/Zorbash $ git merge origin/master 
....
andres6936@Tierra ~/CLionProjects/Zorbash $ ./RUNME

The important part:

In file included from my_main.h:112,
                 from my_tile.h:10,
                 from my_ascii.h:15,
                 from ascii.cpp:6:
my_sys.h:142:30: error: conflicting declaration ‘typedef long long unsigned int uint64_t’
  142 | typedef unsigned long long   uint64_t;
      |                              ^~~~~~~~
In file included from my_main.h:112,
                 from my_tile.h:10,
                 from my_ascii.h:15,
                 from ascii_box.cpp:6:
my_sys.h:142:30: error: conflicting declaration ‘typedef long long unsigned int uint64_t’
  142 | typedef unsigned long long   uint64_t;
      |                              ^~~~~~~~
In file included from /usr/lib/gcc/x86_64-linux-gnu/9/include/stdint.h:9,
                 from /usr/include/c++/9/cstdint:41,
                 from /usr/include/c++/9/bits/char_traits.h:621,
                 from /usr/include/c++/9/string:40,
                 from /usr/include/c++/9/stdexcept:39,
                 from /usr/include/c++/9/array:39,
                 from my_ascii.h:11,
                 from ascii.cpp:6:
/usr/include/stdint.h:55:27: note: previous declaration as ‘typedef long unsigned int uint64_t’
   55 | typedef unsigned long int uint64_t;
      |                           ^~~~~~~~
In file included from /usr/lib/gcc/x86_64-linux-gnu/9/include/stdint.h:9,
                 from /usr/include/c++/9/cstdint:41,
                 from /usr/include/c++/9/bits/char_traits.h:621,
                 from /usr/include/c++/9/string:40,
                 from /usr/include/c++/9/stdexcept:39,
                 from /usr/include/c++/9/array:39,
                 from my_ascii.h:11,
                 from ascii_box.cpp:6:
/usr/include/stdint.h:55:27: note: previous declaration as ‘typedef long unsigned int uint64_t’
   55 | typedef unsigned long int uint64_t;
      |                           ^~~~~~~~
make: *** [Makefile:199: .o/ascii.o] Error 1
make: *** Waiting for unfinished jobs....
make: *** [Makefile:199: .o/ascii_box.o] Error 1
zorbash: FATAL ERROR: Build failed
Mail goblinhack@gmail.com for help
zorbash: ERROR: Build failed.
zorbash: ERROR: Could you send ./build.log to goblinhack@gmail.com?
zorbash: ERROR: Or file an issue at https://github.com/goblinhack/zorbash

As for SDL.h, do you have SDL2 dev installed?

That's what I've been trying to tell you for a while, I've got both of them installed, here are the proofs:

Screenshot from 2020-06-28 14-17-13

Screenshot from 2020-06-28 14-17-34

hmm - thanks - I'll try and fix this tomorrow

hey can you paste the output from

sdl2-config --cflags

and

sdl2-config --libs

that's what I use for the include path, so odd that it cannot then find it. Also could you paste one of the c++ lines in full so I can see the flags?

actually I did a quick attempted fix - maybe you have more than one sdl2-config and I should be using the one in
your path

tried to fix the uint issue also

let me know if anything works better -thanks

andres6936@Tierra ~ $ sdl2-config --cflags
-I/usr/local/include/SDL2 -D_REENTRANT
andres6936@Tierra ~ $ sdl2-config --libs
-L/usr/local/lib -Wl,-rpath,/usr/local/lib -Wl,--enable-new-dtags -lSDL2

it "--cflags" :)

anyway check out last nights fix - if that worked

BTW I looked at your Hale game - looks pretty nice - good to see an overworld game. I plan to add that for Zorbash eventually!

it "--cflags" :)

I'm sorry, I've already corrected it.

BTW I looked at your Hale game - looks pretty nice - good to see an overworld game.

Thank very much.

I think it is still a big problem to build your project, it is very tedious and prone to errors:

Commands:

andres6936@Tierra ~/CLionProjects $ git clone --recursive --depth=1 https://github.com/goblinhack/zorbash.git
andres6936@Tierra ~/CLionProjects/zorbash $ ./RUNME
zorbash: SDL2 config                : /usr/local/bin/sdl2-config
zorbash: SDL2 version               : 2.0.9
zorbash: SDL2 include path          : /usr/local/include/SDL2
zorbash: SDL2 mixer.h               : /usr/local/include/SDL2/SDL_mixer.h
zorbash: SDL2 ttf.h                 : /usr/local/include/SDL2/SDL_ttf.h
zorbash: Default Python             : /usr/bin/python
zorbash: Default Python config      : /usr/bin/python-config
zorbash: Default Python exec        : /usr
zorbash: Default Python include path: /usr/include/python2.7
zorbash: Python3                    : /usr/bin/python3
zorbash: Python3 config             : /usr/bin/python3-config
zorbash: Python3 exec               : /usr
zorbash: Python3 include path       : /usr/include/python3.5m
zorbash: Python lib version         : 3.5
zorbash: PYTHONVERSION              : 3.5
zorbash: PYTHONPATH                 : /usr/lib/python35.zip:/usr/lib/python3.5:/usr/lib/python3.5/plat-x86_64-linux-gnu:/usr/lib/python3.5/lib-dynload:/home/andres6936/.local/lib/python3.5/site-packages:/usr/local/lib/python3.5/dist-packages:/usr/lib/python3/dist-packages
zorbash: VERSION (game)             : 0.0.4
zorbash: Cleaning
g++ -Werror -I/usr/local/include/SDL2 -D_REENTRANT -I/usr/include/python3.5m -I/usr/include/python3.5m -Wno-unused-result -Wsign-compare -g -fstack-protector-strong -Wformat -Werror=format-security -DNDEBUG -g -Wall -DVERSION="0.0.4" -DPYTHONVERSION="3.5" -g -ggdb3 -O3 -x c++ -Wall -std=c++2a -ffast-math -c -o .o/level_display_deep_water.o level_display_deep_water.cpp
level_display_deep_water.cpp: In member function ‘void Level::display_deep_water(int, uint16_t, uint16_t, uint16_t, uint16_t)’:
level_display_deep_water.cpp:22:9: error: variable ‘fbo_mask4’ set but not used [-Werror=unused-but-set-variable]
   22 |     int fbo_mask4;
      |         ^~~~~~~~~
cc1plus: all warnings being treated as errors
make: *** [Makefile:226: .o/level_display_deep_water.o] Error 1
make: *** Waiting for unfinished jobs....
zorbash: FATAL ERROR: Build failed
Mail goblinhack@gmail.com for help
zorbash: ERROR: Build failed.
zorbash: ERROR: Could you send ./build.log to goblinhack@gmail.com?
zorbash: ERROR: Or file an issue at https://github.com/goblinhack/zorbash

I think I need to just turn off Werror except when building for my own dev - as I build mainly on macos and only every few weeks check linux