Allegro on new installation

New to FreeBASIC? Post your questions here.
crylex
Posts: 2
Joined: Sep 13, 2020 10:19

Allegro on new installation

Postby crylex » Sep 13, 2020 10:56

Hi

First post here, and apologies if it's an ubernoob question, I have searched through the forum for solutions.

I want to use allegro with freebasic for some translation from a previous program that uses Allegro.

I have created a vanilla install of WINFBE_suite (2.17) with FreeBASIC-1.07.1-gcc-8.4, and going through various demos, it appears that some wofk and some don't, and most of the problems seem to be linking issues.

As I am interested inAllegro, I will illustrate with that

Opening hello.bas in the graphics/allegro examples fails, the last 2 lines of the log being
C:\WinFBE_Suite\FreeBASIC-1.07.1-gcc-8.4\bin\win32\ld.exe: C:\WinFBE_Suite\FreeBASIC-1.07.1-gcc-8.4\examples\graphics\Allegro\TMPC782.o:fake:(.text+0x36): undefined reference to `_install_allegro_version_check'
linking failed: 'C:\WinFBE_Suite\FreeBASIC-1.07.1-gcc-8.4\bin\win32\ld.exe' terminated with exit code 1


`_install_allegro_version_check' is in allegro.bi, and is part of the allegro_init() function

ligalleg is located here C:\WinFBE_Suite\FreeBASIC-1.07.1-gcc-8.4\lib\win32\liballegdll.a

The allegro.bi declaration of the location of the allegro libs also makes little sense, it looks like it's linked as a static library
#inclib "alleg"


but I can't for the life of me see how that points to the library.

Also, do I need a specific allegroxx.dll in the windows\system folder (I have several, all differently numbered)

I also seem to be getting similar issues with SDL (amongst others) though the linkin errors are different - the linker can't find the libs

C:\WinFBE_Suite\FreeBASIC-1.07.1-gcc-8.4\bin\win32\ld.exe: cannot find -lSDL
C:\WinFBE_Suite\FreeBASIC-1.07.1-gcc-8.4\bin\win32\ld.exe: cannot find -lSDL_image
linking failed: 'C:\WinFBE_Suite\FreeBASIC-1.07.1-gcc-8.4\bin\win32\ld.exe' terminated with exit code 1


Neither of these libraries seem to exist in the directory structure.

Any pointers gratefully accepted.

Cheers

Chris
MrSwiss
Posts: 3577
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: Allegro on new installation

Postby MrSwiss » Sep 13, 2020 20:41

@crylex, welcome to the forum.

All external libraries must be downloaded seperately from fbc's distribution.
Only the necessary .bi files (basic include) are part of the distribution itself.
(indepedent of static (*.a) or dynamic (*.dll/*.so))
srvaldez
Posts: 2482
Joined: Sep 25, 2005 21:54

Re: Allegro on new installation

Postby srvaldez » Sep 14, 2020 0:23

Hi crylex
the easiest way to get allegro working with FB is to use the same version as the example which is allegro-5.0.10
you can get the 32-bit binaries from https://www.allegro.cc/files/
you need to get the MinGW 4.7.0 archive
ideally you would want the latest version, but the example in the FB distribution uses 5.0.10
the latest version can be found at https://github.com/liballeg/allegro5/releases
crylex
Posts: 2
Joined: Sep 13, 2020 10:19

Re: Allegro on new installation

Postby crylex » Sep 14, 2020 11:25

Thanks guys

Cheers, Chris

Return to “Beginners”

Who is online

Users browsing this forum: No registered users and 3 guests