Need Help With SDL and Allegro5 Libraries

External libraries (GTK, GSL, SDL, Allegro, OpenGL, etc) questions.
Post Reply
mg_keystrokes
Posts: 3
Joined: Jun 23, 2020 3:28

Need Help With SDL and Allegro5 Libraries

Post by mg_keystrokes »

I was testing out the sample "hello.bas" for use with the Allegro game creation library.

' "Hello, world!" example program by Shawn Hargreaves.
' This is a very simple program showing how to get into graphics
' mode and draw text onto the screen.

#include "allegro.bi"

' you should always do this at the start of Allegro programs
allegro_init()

' set up the keyboard handler
install_keyboard()

' set a graphics mode sized 320x200
if (set_gfx_mode(GFX_SAFE, 320, 200, 0, 0) <> 0) then
set_gfx_mode(GFX_TEXT, 0, 0, 0, 0)
allegro_message("Unable to set any graphic mode" + chr(13) + allegro_error + chr(13))
end 1
end if

' set the color palette
set_palette(@desktop_palette(0))

' clear the screen to white
clear_to_color(screen, makecol(255, 255, 255))

' you don't need to do this, but on some platforms (eg. Windows) things
' will be drawn more quickly if you always acquire the screen before
' trying to draw onto it.
acquire_screen()

' set transparent text
text_mode(-1)

' write some text to the screen with black letters
textout_centre(screen, font, "Hello, world!", SCREEN_W\2, SCREEN_H\2, makecol(0,0,0))

' you must always release bitmaps before calling any input functions
release_screen()

' wait for a keypress
readkey()

END_OF_MAIN()

...and I got this:

ld: skipping incompatible /usr/lib/x86_64-linux-gnu/liballeg.so when searching for -lalleg
ld: cannot find -lalleg

What to install, if possible, among the solutions.
MrSwiss
Posts: 3910
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: Need Help With SDL and Allegro5 Libraries

Post by MrSwiss »

mg_keystrokes wrote:ld: skipping incompatible /usr/lib/x86_64-linux-gnu/liballeg.so when searching for -lalleg
ld: cannot find -lalleg
First message: liballeg.so is found but, the bitness of it is wrong for the used compiler.
Second message: simply states, "the right library" was not found (other bitness).

Seems that you've installed the 64 bit version library but, are using FBC 32 bit.
The next try should simply be with FBC 64 bit (should work okay).
(Except, your OS is actually 32 bit, then you'll need the 32 bit library.)
mg_keystrokes
Posts: 3
Joined: Jun 23, 2020 3:28

Re: Need Help With SDL and Allegro5 Libraries

Post by mg_keystrokes »

I need to look up the file names for the correct versions of the Allegro libraries to install. Where do I go?
MrSwiss
Posts: 3910
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: Need Help With SDL and Allegro5 Libraries

Post by MrSwiss »

Sorry, don't understand the question (the library name itself, is the same for both versions).
badidea
Posts: 2591
Joined: May 24, 2007 22:10
Location: The Netherlands

Re: Need Help With SDL and Allegro5 Libraries

Post by badidea »

mg_keystrokes wrote:I need to look up the file names for the correct versions of the Allegro libraries to install. Where do I go?
It might be easier to install 64-bit fbc (FreeBASIC-1.07.1-linux-x86_64.tar.gz on sourceforge).
I just checked the Ubuntu 18.04 repository (via the synaptic package manager) and I don't see the 32 bit version of allegro.
MrSwiss
Posts: 3910
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: Need Help With SDL and Allegro5 Libraries

Post by MrSwiss »

[edit]as requested by Moderator:

@badidea, infringing on copyright is against forum rules and therefore, discouraged.
See: Forum/Beginners/Welcome to the forum, by counting_pine
especially this section:
In addition, we expect you to follow all the rules set out by our host, phatcode.net, including:

Do not post any copyrighted material that you do not have a license to distribute.
In detail:
any 'idea' = 'intelectual propery'
'intelectual propery' = protected by international copyright treaty agreements ...
MrSwiss wrote:The next try should simply be with FBC 64 bit (should work okay).
Why this should be in any way similar to an insult (obviously OT also), escapes me.
[/edit]
Last edited by MrSwiss on Jun 25, 2020 15:54, edited 1 time in total.
jj2007
Posts: 2326
Joined: Oct 23, 2016 15:28
Location: Roma, Italia
Contact:

Re: Need Help With SDL and Allegro5 Libraries

Post by jj2007 »

.  .
Last edited by jj2007 on Jun 25, 2020 20:37, edited 1 time in total.
mg_keystrokes
Posts: 3
Joined: Jun 23, 2020 3:28

Re: Need Help With SDL and Allegro5 Libraries

Post by mg_keystrokes »

Yes, the Allegro libraries do compile and run successfully when I install the 64-bit version of FreeBASIC 1.07.1 for Linux. But I will also need names to look up for the 64-bit version of the BASS library for playing sound effects and background music. Plus, whenever I try to compile an SDL-dependent *.bas file, I still get the error message,"Cannot find -SDL," I also need to look up grx20 libraries, too.

One other question about Allegro is, if it has audio provisions in its library, besides graphics.
badidea
Posts: 2591
Joined: May 24, 2007 22:10
Location: The Netherlands

Re: Need Help With SDL and Allegro5 Libraries

Post by badidea »

I have never used the BASS library, but this topic might be useful: audio lib bass (dynamic) Windows/Linux 32/64-bit
For audio on linux I have used (for one or two projects): fbsound 1.1 (dynamic) Windows/Linux 32 and 64-bit (wav mp3 ogg mod it xm s3m)
Also I never used GRX. If I look at this website (http://grx.gnu.de/download/index.html), I think you have to build library it yourself (and hope it works on 64-bit, it looks a bit dated).
For 64-bit SDL on Ubuntu 18.04 I needed to install at least: libsdl1.2-dev and libsdl-gfx1.2-dev
Imortis
Moderator
Posts: 1924
Joined: Jun 02, 2005 15:10
Location: USA
Contact:

Re: Need Help With SDL and Allegro5 Libraries

Post by Imortis »

MrSwiss wrote:@badidea, thanks very much indeed, for parroting what I've already stated.
jj2007 wrote:Minderwertigkeitskomplex?
Please clean up your posts, both of you. Neither of these comments did anything other than needle other users on this forum.

If you don't edit them, I will.
Post Reply