Allegro-4.4.3.1 on Beaglebone Console. [SOLVED]

Linux specific questions.
Dinosaur
Posts: 1481
Joined: Jul 24, 2005 1:13
Location: Hervey Bay (.au)

Allegro-4.4.3.1 on Beaglebone Console. [SOLVED]

Post by Dinosaur »

Hi All

Currently trying to run my Beaglebone Black application from the Debian 9 terminal without a gui installed.
The Freebasic compiler was actually available from the depository (1.05) and the only problem with that was that the
Freebasic folder was put into /usr/include and as a result libraries could not be found.
Copying it into /usr/local/include solved that problem.

Then had an issue with an error from the allegro.bi file
"incomplete Type ZBUFFER" and the lines in the .bi file are shown below.

Code: Select all

type ZBUFFER as BITMAP
declare function create_zbuffer(byval bmp as BITMAP ptr) as ZBUFFER ptr
declare function create_sub_zbuffer(byval parent as ZBUFFER ptr, byval x as long, byval y as long, byval width as long, byval height as long) as ZBUFFER ptr
declare sub set_zbuffer(byval zbuf as ZBUFFER ptr)
declare sub clear_zbuffer(byval zbuf as ZBUFFER ptr, byval z as single)
declare sub destroy_zbuffer(byval zbuf as ZBUFFER ptr)
By commenting these line out, the program compiles ,BUT when I try to run the application I get "error installing allegro"
I have also tried using #undefine ZBUFFER and #undefine BITMAP at the top of the allegro.bi file.
It will compile but the error persists.

Worth noting that I am using exactly the same .bi files as my full Debian gui version which does not have this problem.
From my browsing it seems to have something to do with "Forward declaration" but don't understand why it is a problem
with the terminal application.
Any suggestions greatly appreciated.

Regards
Last edited by Dinosaur on May 17, 2020 4:00, edited 2 times in total.
MrSwiss
Posts: 3910
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: incomplete Type ZBuffer

Post by MrSwiss »

Since ZBuffer is defined as Bitmap 'Alias', the real question is:
how exactly is Bitmap defined (should be before the ZBuffer declaration).

One of the reasons, why such short-cutted exerpts are not very usefull.
Dinosaur
Posts: 1481
Joined: Jul 24, 2005 1:13
Location: Hervey Bay (.au)

Re: incomplete Type ZBuffer

Post by Dinosaur »

Hi All

The BITMAP is declared previous to the ZBUFFER
Your copy of allegro.bi will show that.

Still why does it work with GUI install and not with command line ?

Regards
MrSwiss
Posts: 3910
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: incomplete Type ZBuffer

Post by MrSwiss »

Dinosaur wrote:Still why does it work with GUI install and not with command line ?
Maybe, because allegro is a GUI library?!?! (like FLTK, IUP, GTK and so on)
Dinosaur
Posts: 1481
Joined: Jul 24, 2005 1:13
Location: Hervey Bay (.au)

Re: incomplete Type ZBuffer

Post by Dinosaur »

Hi All

That would really surprise me as I have used it in Dos for years.

It may boil down to having to compile the library from the terminal.??

Regards
MrSwiss
Posts: 3910
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: incomplete Type ZBuffer

Post by MrSwiss »

Dinosaur wrote:That would really surprise me as I have used it in Dos for years.
DOS could also be switched to graphic screen mode ...
Dinosaur
Posts: 1481
Joined: Jul 24, 2005 1:13
Location: Hervey Bay (.au)

Re: incomplete Type ZBuffer

Post by Dinosaur »

Hi All

That's correct , however my application uses cgui library, which then uses Allegro to set the screen modes.
After compiling the Allegro library the "incomplete Type" error is gone, BUT I still have "error installing allegro" when the program starts.

Regards

EDIT:
Just found this.
Installing Allegro

See docs/build/unix.txt: this process is identical for the console and X versions.

You must set the CMake option WANT_LINUX_CONSOLE to enable the console version, as it is not built by default.
TJF
Posts: 3809
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

Re: incomplete Type ZBuffer

Post by TJF »

Dinosaur wrote:Currently trying to run my Beaglebone Black application from the Debian 9 terminal without a gui installed.
The Freebasic compiler was actually available from the depository (1.05) and the only problem with that was that the
Freebasic folder was put into /usr/include and as a result libraries could not be found.
Copying it into /usr/local/include solved that problem.
"libraries"? Do you mean headers? I cannot second that. Here it works from both locations, depending on the install source. fbc uses the path ../include. Do you have two versions of fbc installed, in /usr/bin and also /usr/local/bin, and the later gets found first by the PATH setting?
Dinosaur wrote: Just found this.
Installing Allegro

See docs/build/unix.txt: this process is identical for the console and X versions.

You must set the CMake option WANT_LINUX_CONSOLE to enable the console version, as it is not built by default.
I guess the issue is that Allegro cannot open a screen in the console setup. Did you try to install the frame buffer device:

sudo apt-get install xserver-xorg-video-fbdev
Dinosaur
Posts: 1481
Joined: Jul 24, 2005 1:13
Location: Hervey Bay (.au)

Re: incomplete Type ZBuffer

Post by Dinosaur »

Hi All

The problem is that I can't seem to find any guide as to what the dependencies are for installing Allegro
on a Linux console system.
TJF, I did not install xorg, so I did and then re-compiled the libraries, but there were dependency errors during make.

If anyone does have some idea as to which packages should be installed, I would be pleased to hear it.

I am going to re-start with a clean image and document things step by step.

Regards
TJF
Posts: 3809
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

Re: incomplete Type ZBuffer

Post by TJF »

Dinosaur wrote:The problem is that I can't seem to find any guide as to what the dependencies are for installing Allegro
on a Linux console system.
sudo apt install liballegro-dev
Dinosaur
Posts: 1481
Joined: Jul 24, 2005 1:13
Location: Hervey Bay (.au)

Re: incomplete Type ZBuffer

Post by Dinosaur »

Hi All

TJF, that was the first step after which the "incomplete Type ZBuffer" appeared, after which I decided that perhaps I should
compile the library from the downloaded package.

Stay Tuned

Regards
TJF
Posts: 3809
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

Re: incomplete Type ZBuffer

Post by TJF »

Dinosaur wrote:TJF, that was the first step after which the "incomplete Type ZBuffer" appeared, after which I decided that perhaps I should
compile the library from the downloaded package.
Sure! Since you had no frame buffer device at this time, no ZBuffer type could get established. (Perhaps the Allegro packaging manager could find a way to better report errors.)
Dinosaur
Posts: 1481
Joined: Jul 24, 2005 1:13
Location: Hervey Bay (.au)

Re: incomplete Type ZBuffer

Post by Dinosaur »

Hi All

So you are suggesting that I install frame buffer first then allegro-dev then Freebasic ?

Regards
TJF
Posts: 3809
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

Re: incomplete Type ZBuffer

Post by TJF »

Dinosaur wrote:Hi All

So you are suggesting that I install frame buffer first then allegro-dev then Freebasic ?

Regards
You can do all at once, but fbdev before allegro (fbc doesn't metter)

sudo apt install xserver-xorg-video-fbdev liballegro-dev freebasic
Dinosaur
Posts: 1481
Joined: Jul 24, 2005 1:13
Location: Hervey Bay (.au)

Re: incomplete Type ZBuffer

Post by Dinosaur »

Hi All

Did the following:
Debian Stretch Image
bone-debian-9.9-iot-armhf-2019-08-03-4gb.img.xz
sudo apt-get update
sudo apt-get upgrade
sudo apt autoremove
reboot
sudo apt-get install xserver-xorg-video-fbdev
sudo apt-get install liballegro4-dev
sudo apt-get install freebasic

This resulted in:
usr/include/freebasic/ contained allegro.bi etc
usr/lib/arm-linux-gnueabihf/ contained liballeg.so liballeg.so.4.4 liballeg.so.4.4.2
usr/share/lintian/overrides/ contained liballeg4.4 text file

Copied cgui.bi from working Debian Stretch GUI disk to usr/include/freebasic
Copied libcgui.so from working Debian Stretch GUI disk to usr/lib/arm-linux-gnueabihf/

cd/Projects/SmartPlug
fbc -v -w all SmartPlug.bas
No errors
./SmartPlug
Error installing Allegro

At this stage I am assuming that my libcgui.so will work both in console & lxqt gui.
To compile cgui on the target system, I have to compile Allegro from scratch so that the build directory is available to the cgui build.
These are the first few lines of the program and those lines print.

Code: Select all

Sub Win_Startup
    If Debug.PrintFlag > 0 Then
        Print "FreeBasic ;";"Version","Major","minor","patch"
        Print "          ;"; __FB_VER_MAJOR__ ;".", __FB_VER_MINOR__ , __FB_VER_PATCH__
        Print "Allegro   ;";"Version;"
        Print "          ;   4.4.3"
        Print "Cgui      ;";"Version","Major","minor","Release Date"
        Print "          ;";cgui_ver;".", cgui_rev, cgui_minor_rev, cgui_release_date
        Print
    EndIf
    Control.Device = 0
    InitComms(Control.Device)
    Times.OldmSec = 0
    ''-------Cgui init below-------------
    InitCgui(1024,630,32)               '' set to full screen
Will perservere...

Regards
Post Reply