Recent

Author Topic: Allegro.pas  (Read 33520 times)

dubst3pp4

  • Jr. Member
  • **
  • Posts: 86
  • Retro computing ~ GNU/Linux
    • me on Mastodon
Re: Allegro.pas
« Reply #15 on: November 08, 2018, 07:31:19 am »
Hi Ñuño_Martínez, thanks for your great work!

I'm testing the Allegro.pas bindings for a new project and figured out, that the latest sources (allegro.pas-5.2.b.0) don't build on Linux, whereas allegro.pas-5.2.a.3 builds fine. I've installed allegro 5.2.3.0 from the Ubuntu repositories. After I type make the linker tells me the following:
Quote
Allegro.pas 5.2.b
(c) Guillermo Martínez J. 2006-2017
http://allegro-pas.sourceforge.net

fpc -O- -gl -vh -vw -dDEBUGMODE -Sh -Si  -Fulib/ -FUobj/ examples/ex_bitmap_flip.pas -obin/examples/ex_bitmap_flip
Hint: Start of reading config file /etc/fpc.cfg
Hint: End of reading config file /etc/fpc.cfg
Free Pascal Compiler version 3.0.4 [2017/12/13] for x86_64
Copyright (c) 1993-2017 by Florian Klaempfl and others
Target OS: Linux for x86-64
Compiling examples/ex_bitmap_flip.pas
Linking bin/examples/ex_bitmap_flip
/usr/bin/ld: warning: bin/examples/link.res contains output sections; did you forget -T?
/usr/bin/ld: -lallegro-debug was not found
/usr/bin/ld: -lallegro_image-debug was not found
/usr/bin/ld: -lallegro_font-debug was not found
/usr/bin/ld: -lallegro_dialog-debug was not found
Error: Error while linking
Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted
Error: /usr/bin/ppcx64 returned an error exitcode
makefile.all:20: recipe for target 'bin/examples/ex_bitmap_flip' failed
make: *** [bin/examples/ex_bitmap_flip] Error 1
It seems that the allegro_*-debug files weren't referenced with the previous version of allegro.pas, weren't they? Do I miss something important when I use allegro.pas-5.2.a.3?

Thanks for any hints :-)
« Last Edit: November 09, 2018, 10:25:46 am by dubst3pp4 »
Jabber: xmpp:marc.hanisch@member.fsf.org -- Support the Free Software Foundation: https://my.fsf.org/donate

Soner

  • Sr. Member
  • ****
  • Posts: 305
Re: Allegro.pas
« Reply #16 on: November 08, 2018, 03:53:11 pm »
You must install allegro development package.
Install synaptic package program and search with it.
It has same name plus...-dev...


Look at this lines from compile result:

usr/bin/ld: -lallegro-debug was not found
/usr/bin/ld: -lallegro_image-debug was not found
/usr/bin/ld: -lallegro_font-debug was not found
/usr/bin/ld: -lallegro_dialog-debug was not found



Linker tells to you that some libs are missing.
Look for the name -lxxxxx in synaptic.
I.e for -lallegro_image is something like liballegro_image...-dev

dubst3pp4

  • Jr. Member
  • **
  • Posts: 86
  • Retro computing ~ GNU/Linux
    • me on Mastodon
Re: Allegro.pas
« Reply #17 on: November 08, 2018, 04:00:54 pm »
You must install allegro development package.
Install synaptic package program and search with it.
It has same name plus...-dev...
I've installed them already, that's why I was able to build the examples with 5.2.a.3 but not with the latest version (5.2.b.0).
Jabber: xmpp:marc.hanisch@member.fsf.org -- Support the Free Software Foundation: https://my.fsf.org/donate

Soner

  • Sr. Member
  • ****
  • Posts: 305
Re: Allegro.pas
« Reply #18 on: November 08, 2018, 04:24:09 pm »
The linker tells you have not installed them. Maybe your program is 32 bit and your allegro 64bit,or lib names are changed in allegro.pas 5.2.b.0.
I would compare library names in both versions.
Good luck.

dubst3pp4

  • Jr. Member
  • **
  • Posts: 86
  • Retro computing ~ GNU/Linux
    • me on Mastodon
Re: Allegro.pas
« Reply #19 on: November 09, 2018, 08:21:36 am »
Hi Soner,
thanks for your input. I found out that it was no problem to compile the demo game by Handoko, which is included in the latest allegro.pas. So the problem had to be in the makefile and voilà, in the file there are the following lines:

Code: [Select]
# Optimized compilation
# FLAGS = $(OPTOPT) $(PFLAGS) $(EFLAGS)
# Use next line instead to activate debug.
FLAGS = $(DBGOPT) $(PFLAGS) $(EFLAGS)

which I changed to

Code: [Select]
# Optimized compilation
FLAGS = $(OPTOPT) $(PFLAGS) $(EFLAGS)
# Use next line instead to activate debug.
# FLAGS = $(DBGOPT) $(PFLAGS) $(EFLAGS)

and now all the examples compile fine. Neither on Ubuntu nor on Fedora there are *-debug versions of allegro5, just the -dev packages.
« Last Edit: November 09, 2018, 10:25:25 am by dubst3pp4 »
Jabber: xmpp:marc.hanisch@member.fsf.org -- Support the Free Software Foundation: https://my.fsf.org/donate

Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 1186
    • Burdjia
Re: Allegro.pas
« Reply #20 on: November 09, 2018, 06:21:49 pm »
That's weird.  I can compile it in my Linux system (Xubuntu 16.04, should upgrade and test  %)).  May be they changed something in the names, but I don't think so.  Or am I using a different version?  I'll take a look and update if needed. Thanks dubst3pp4.

BTW I'm working in the documentation (slowly because I don't have a lot of free time, and also I want to do something for GitHub Game Off) checking the whole library line per line comparing with the original Allegro.  This is also to find potential (API) bugs and also to know what stuff are not implemented yet.

[Edit]
I've created a bug ticket just to keep track and not forget it.
« Last Edit: November 09, 2018, 06:29:33 pm by Ñuño_Martínez »
Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal

Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 1186
    • Burdjia
Re: Allegro.pas
« Reply #21 on: November 22, 2018, 07:41:35 pm »
Finally I found time to try and it didn't go well.

I updated Xubuntu Linux to 18.04.1 so I had to re-install Allegro but something goes wrong.  Allegro does work perfect but when I try Allegro.pas examples I have some unhandled exceptions when exiting.  Also I've found I can't compile my own game engine (mingro on SourceForge) because some issues with the library that deals with PNG files.  This is specially weird s Allegro.pas examples compile perfectly.

This is weird so I think I'll reinstall Linux.  This isn't the first time that Ubuntu update doesn't do the work correctly.
« Last Edit: November 22, 2018, 07:47:42 pm by Ñuño_Martínez »
Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal

lainz

  • Hero Member
  • *****
  • Posts: 4460
    • https://lainz.github.io/
Re: Allegro.pas
« Reply #22 on: November 24, 2018, 05:12:06 pm »
I think a good port with Allegro can be Open Surge
http://opensnc.sourceforge.net/forum/

Now it has his own scripting engine as well.

I think they was using Allegro 4, but now I don't know. I never get to compile their code, I'm not good using 'make' and similar tools, getting things working in the C world seems harder that installing everything with packages / OPM.

Anyways is a good allegro game, that will be cool to have in Pascal. I some time started a port to JS, to discover that a port to JS was already available  ::)

Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 1186
    • Burdjia
Re: Allegro.pas
« Reply #23 on: November 27, 2018, 11:17:57 am »
I think a good port with Allegro can be Open Surge
http://opensnc.sourceforge.net/forum/
Yep, I know that project too.  Actually I plan to add some ideas from it to my engine, such some of the scripting stuff to help defining tilesets and spritesheets.
Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal

Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 1186
    • Burdjia
Re: Allegro.pas
« Reply #24 on: November 27, 2018, 06:14:21 pm »
Ok, with a clean Linux installation it seems to work, and I think I've found what's the problem found by dubst3pp4:

-dev packages provided by Ubuntu doesn't includes the library compiled with "debug" option.  The only way to get such library is to download sources and compile by yourself.  I'll add a note to the installation instructions.
Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: Allegro.pas
« Reply #25 on: November 27, 2018, 08:53:29 pm »
[...] Ubuntu doesn't includes the library compiled with "debug" option.  The only way to get such library is to download sources and compile by yourself.  I'll add a note to the installation instructions.

Yeah, my Kubuntu hasn't got any "-debug" package:
Code: Bash  [Select][+][-]
  1. lucamar@luna:~$ apt list *allegro*
  2. Listing... Done
  3. allegro4-doc/trusty 2:4.4.2-4 all
  4. allegro5-doc/trusty 2:5.0.10-2 all
  5. liballegro-acodec5-dev/trusty 2:5.0.10-2 i386
  6. liballegro-acodec5.0/trusty 2:5.0.10-2 i386
  7. liballegro-audio5-dev/trusty 2:5.0.10-2 i386
  8. liballegro-audio5.0/trusty 2:5.0.10-2 i386
  9. liballegro-dialog5-dev/trusty 2:5.0.10-2 i386
  10. liballegro-dialog5.0/trusty 2:5.0.10-2 i386
  11. liballegro-doc/trusty 2:4.4.2-4 all
  12. liballegro-image5-dev/trusty 2:5.0.10-2 i386
  13. liballegro-image5.0/trusty 2:5.0.10-2 i386
  14. liballegro-physfs5-dev/trusty 2:5.0.10-2 i386
  15. liballegro-physfs5.0/trusty 2:5.0.10-2 i386
  16. liballegro-ttf5-dev/trusty 2:5.0.10-2 i386
  17. liballegro-ttf5.0/trusty 2:5.0.10-2 i386
  18. liballegro4-dev/trusty 2:4.4.2-4 i386
  19. liballegro4.4/trusty 2:4.4.2-4 i386
  20. liballegro4.4-plugin-alsa/trusty 2:4.4.2-4 i386
  21. liballegro5-dev/trusty 2:5.0.10-2 i386
  22. liballegro5.0/trusty 2:5.0.10-2 i386
  23. libguichan-allegro-0.8.1-1/trusty 0.8.2-13 i386
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 1186
    • Burdjia
Re: Allegro.pas
« Reply #26 on: November 28, 2018, 11:05:03 am »
I was re-thinking it.  The "-debug" versions are to debug Allegro itself.  So they're not actually needed when working in your game, but it is useful when working on Allegro.pas or creating a new add-on.  So, to not link the "-debug" version just remove the "-dDEBUGMODE" option from the makefile (just line 85) and/or use the optimized  configuration as dubst3pp4 said (lines 114 to 117)

This will be "fixed" in the next release, including the documentation explaining it.  I don't know when it will be released but I doubt it will be before next year (too little time :().
Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal

dubst3pp4

  • Jr. Member
  • **
  • Posts: 86
  • Retro computing ~ GNU/Linux
    • me on Mastodon
Re: Allegro.pas
« Reply #27 on: November 28, 2018, 12:06:11 pm »
Ok, with a clean Linux installation it seems to work, and I think I've found what's the problem found by dubst3pp4:

-dev packages provided by Ubuntu doesn't includes the library compiled with "debug" option.  The only way to get such library is to download sources and compile by yourself.  I'll add a note to the installation instructions.
Thanks Ñuño! When I compile without the DBGOPT flags, everything works also without the -debug packages. For what do I need those debug packages? To get a proper support of Allegro.pas in gdb?
Jabber: xmpp:marc.hanisch@member.fsf.org -- Support the Free Software Foundation: https://my.fsf.org/donate

Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 1186
    • Burdjia
Re: Allegro.pas
« Reply #28 on: November 29, 2018, 12:08:48 pm »
Thanks Ñuño! When I compile without the DBGOPT flags, everything works also without the -debug packages. For what do I need those debug packages? To get a proper support of Allegro.pas in gdb?
The -debug packages are to debug Allegro, so yes, they're to debug Allegro.pas with GDB too.  They're not needed to debug your games.  Now I have to test if -dev packages are mandatory or if it can work with the release ones.
« Last Edit: November 29, 2018, 12:10:47 pm by Ñuño_Martínez »
Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal

knerking@gmail.com

  • Newbie
  • Posts: 3
Re: Allegro.pas
« Reply #29 on: May 12, 2019, 03:53:33 am »
I just like to thank you for your work with allegro5. I works very well.  8)

 

TinyPortal © 2005-2018