alemart / opensurge

A retro game engine with a fun platformer for making your dreams come true!
http://opensurge2d.org
GNU General Public License v3.0
385 stars 33 forks source link

unable to build, Allegro5 no longer comes with liballegro_dialog #56

Closed coreybruce closed 3 years ago

coreybruce commented 3 years ago

Hey there just wanted to report that Allegro5 no longer comes with liballegro_dialog meaning you are no longer able to build this from source.

[corey@corey-pi4 build]$ cmake ..
Open Surge version 0.6.0.0
-- Building using the Allegro 5 backend...
-- Found liballegro at /usr/lib/liballegro.so...
-- Found liballegro_image at /usr/lib/liballegro_image.so...
-- Found liballegro_primitives at /usr/lib/liballegro_primitives.so...
-- Found liballegro_font at /usr/lib/liballegro_font.so...
-- Found liballegro_ttf at /usr/lib/liballegro_ttf.so...
-- Found liballegro_acodec at /usr/lib/liballegro_acodec.so...
-- Found liballegro_audio at /usr/lib/liballegro_audio.so...
CMake Error at CMakeLists.txt:228 (MESSAGE):
  Can't find Allegro 5 lib (liballegro_dialog).  You might get some luck by
  tweaking CMake options with ccmake | cmake-gui, or you can get help at
  opensurge2d.org

-- Configuring incomplete, errors occurred!
See also "/run/media/corey/47F22DEE70C10570/projects/opensurge/build/CMakeFiles/CMakeOutput.log".
coreybruce commented 3 years ago

I ended up packaging up liballegro_dialog myself but when I got to building it I run into this issue.

[corey@corey-pi4 build]$ cmake ..
Open Surge version 0.6.0.0
-- Building using the Allegro 5 backend...
-- Found liballegro at /usr/lib/liballegro.so...
-- Found liballegro_image at /usr/lib/liballegro_image.so...
-- Found liballegro_primitives at /usr/lib/liballegro_primitives.so...
-- Found liballegro_font at /usr/lib/liballegro_font.so...
-- Found liballegro_ttf at /usr/lib/liballegro_ttf.so...
-- Found liballegro_acodec at /usr/lib/liballegro_acodec.so...
-- Found liballegro_audio at /usr/lib/liballegro_audio.so...
-- Found liballegro_dialog at /usr/lib/aarch64-linux-gnu/liballegro_dialog.so.5.2.3...
-- Found liballegro_memfile at /usr/lib/liballegro_memfile.so...
-- Found libsurgescript at /usr/lib/libsurgescript.so...
-- Configuring done
-- Generating done
-- Build files have been written to: /run/media/corey/47F22DEE70C10570/projects/opensurge/build
[corey@corey-pi4 build]$ make -j4
[  0%] Building C object CMakeFiles/opensurge.dir/src/core/nanoparser/nanoparser.c.o
[  1%] Building C object CMakeFiles/opensurge.dir/src/core/whereami/whereami.c.o
[  2%] Building C object CMakeFiles/opensurge.dir/src/core/utf8/utf8.c.o
[  3%] Building C object CMakeFiles/opensurge.dir/src/core/zip/zip.c.o
[  4%] Building C object CMakeFiles/opensurge.dir/src/core/assetfs.c.o
[  5%] Building C object CMakeFiles/opensurge.dir/src/core/audio.c.o
[  6%] Building C object CMakeFiles/opensurge.dir/src/core/color.c.o
[  7%] Building C object CMakeFiles/opensurge.dir/src/core/commandline.c.o
[  8%] Building C object CMakeFiles/opensurge.dir/src/core/csv.c.o
[  9%] Building C object CMakeFiles/opensurge.dir/src/core/engine.c.o
[ 10%] Building C object CMakeFiles/opensurge.dir/src/core/font.c.o
/run/media/corey/47F22DEE70C10570/projects/opensurge/src/core/engine.c:23:10: fatal error: allegro5/allegro_native_dialog.h: No such file or directory
   23 | #include <allegro5/allegro_native_dialog.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/opensurge.dir/build.make:202: CMakeFiles/opensurge.dir/src/core/engine.c.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/opensurge.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
coreybruce commented 3 years ago

Ok update, I have to package up allegro-dialog-dev as well and install that because it is needed for building games using allegro so I did that and got it to compile

YES!!

but my excitement ended pretty quickly when I ran into this issue when running it so I will have to figure this next hurdle next..

image

alemart commented 3 years ago

Hi Corey,

Hey there just wanted to report that Allegro5 no longer comes with liballegro_dialog meaning you are no longer able to build this from source.

I'm using the latest version of Allegro (5.2.7) and I still have a liballegro_dialog.so in my system. There seems to be a mixing of versions of libraries in your system, as your output shows that liballegro_dialog is outside the standard directory and is likely to be of a different release than all other Allegro .so files.

-- Found liballegro_dialog at /usr/lib/aarch64-linux-gnu/liballegro_dialog.so.5.2.3...

What you can do is wipe off your current installation of Allegro completely. Purge it completely. Next, you may get the latest release at https://liballeg.org. Note that they have migrated the Native Dialog addon from GTK2 to GTK3. This may explain the underlying issue. liballegro_dialog.so.5.2.7 is expected to be available as usual.

coreybruce commented 3 years ago

Hey thanks for the reply Alemart, ignore my response that I just removed. I removed the files in the build folder after completely removing allegro and compiling than installing it manually than re ran the build process again and this time when I launch I actually got a Window but ran into another error about the language file error

image

alemart commented 3 years ago

Please remove your opensurge folder and get a new copy using git clone.

coreybruce commented 3 years ago

Just did it but it still does it after a fresh clone and build..

alemart commented 3 years ago

Can't reproduce it here. I can only imagine some bogus character at the end of languages/english.lng. Each line must have exactly 2 entries: key and value, otherwise you get the error that you see. Can you send this file? Please send it as an attachment.

coreybruce commented 3 years ago

Hmm ok and sure here you go english.lng.zip

alemart commented 3 years ago

This is exactly the same file I have here, as expected. What is your compiler and its version?

Please get the Snap and the Flatpak releases and let me know what you see. The links are available our website.

coreybruce commented 3 years ago

cmake version 3.20.1 GNU Make 4.3

Hmm it did the exact same thing on the flatpak so would it have to do with something on the game than?

alemart commented 3 years ago

Try the snap. Its architecture is different compared to the flatpak.

As far as I know, the game is fine. The piece of code that triggers that error message has not been changed in a while, and the game has been successfully deployed to multiple Linux distros and to Windows. To suspect an error in the game, I would need to see multiple users reporting that same issue.

I don't know what's causing the issue, and I was unable to reproduce it here. It may be something related to this particular system. I would need access to this system in order to be able to find the cause of the error.

The game should work in a different machine. In any case, I ask you to test the snap.

What is your compiler? What are the specs of your system? (operating system, etc.) Is the game stored in an external device?

coreybruce commented 3 years ago

Hmm I tried the snap version but got an error which I assume might be the same..

image

I am testing this this on Rasperry pi 4 8gb running Manjaro Arm64

Broadcom BCM2711, Quad core Cortex-A72 (ARM v8) 64-bit SoC @ 1.8GHz 8GB ram

alemart commented 3 years ago

In this case I suggest you try in a different machine.

Detailed logs can be found at ~/snap/opensurge/common/.cache/opensurge2d/opensurge/logfile.txt. We now know that the issue is probably unrelated to system libraries or to the compiling environment. The fact that the characters don't show up may be a clue.

If you are a C programmer, I believe you can figure this out. What is going on is that the program is not reading text files as expected. In src/core/engine.c, you'll find calls to setlocale(). It asks for "en_us.UTF-8". This affects the reading and the parsing of files. You may tweak the calls, tweak languages/english.lng, and see what you get. Locale settings are usually stored in /etc/default/locale.

alemart commented 3 years ago

If you're going to try it, also call setlocale after scripting_init in src/core/engine.c. Example:

    scripting_init(cmd->user_argc, cmd->user_argv);
    setlocale(LC_ALL, "C"); // <--- here

    scenestack_init();
coreybruce commented 3 years ago

In this case I suggest you try in a different machine.

Detailed logs can be found at ~/snap/opensurge/common/.cache/opensurge2d/opensurge/logfile.txt. We now know that the issue is probably unrelated to system libraries or to the compiling environment. The fact that the characters don't show up may be a clue.

If you are a C programmer, I believe you can figure this out. What is going on is that the program is not reading text files as expected. In src/core/engine.c, you'll find calls to setlocale(). It asks for "en_us.UTF-8". This affects the reading and the parsing of files. You may tweak the calls, tweak languages/english.lng, and see what you get. Locale settings are usually stored in /etc/default/locale.

I would but I am not proficient in C and only new to even learning it, I'll have to reinstall the snap version and get a log for you tho.

alemart commented 3 years ago

What I can ultimately suggest you is to play in a different machine.

I'm unable to reproduce the issue and I haven't seen any other person facing the same issue. This leads me to believe that the issue is related to the particular system you're using.

Even if you're not a C expert, you've already done the most difficult part of the job, which is to compile the source code. Tweaking the calls to setlocale is a matter of editing them. So far I suspect the issue has something to do with the UTF-8 encoding in languages/english.lng and possibly other files.

I can't give further assistance unless you're able to tweak things and help dig this up. If you'd like to continue, feel free to contact me again.

coreybruce commented 3 years ago

Ok I am testing on my PC, I will let you know how it goes.

EDIT

Ok it seems to work so I wonder why it works fine on Manjaro x64 and not Manjaro Arm64, I will look into this more.