Allegro.cc - Online Community

Allegro.cc Forums » Installation, Setup & Configuration » Problem upgrading to 5.2.4.1 now getting ALLEGRO_FONT error

This thread is locked; no one can reply to it. rss feed Print
Problem upgrading to 5.2.4.1 now getting ALLEGRO_FONT error
devo_au
Member #15,282
August 2013

Hey (again),
I am now upgrading to 5.2.4.1 as advised by Edgar to solve a separate issue. I went to Github, got SiegeLords 5.2.4.1 release (the 38.1MB one). Added the libs to my release build linker dependencies,on codeblocks. Now after a build I am getting the following error in codeblocks:

C:####.cpp|216|error: invalid use of incomplete type 'ALLEGRO_FONT {aka struct ALLEGRO_FONT}'|

This error is accompanied every time (over 50 its) with this explanation:

c:\mingw\allegro\include\allegro5\allegro_font.h|48|note: forward declaration of 'ALLEGRO_FONT {aka struct ALLEGRO_FONT}'|

I am running mingw32-gcc_g++ 6.3.0-1 with codeblocks (maybe this is the issue, maybe not)

I will hack away as I do, because im in Australia, and your all asleep. Maybe I will get it going but if I can't and anyone is kind enough to assist me, that will be great. Thanks again.

it wasn't me, it was other kids

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

devo_au
Member #15,282
August 2013

Can't seem to add to this thread so just an update to my last post.
Went and upgraded the whole shabang:

- Updated to the i686 mingw-w64 version 7.2.0 - installed here c:\mingw-w64
- Updated my codeblocks to use the new toolchain
- downloaded allegro-i686-w64-mingw32-gcc-7.2.0-posix-dwarf-static-5.2.4.1.zip
- unzipped & installed the allegro folder in c:\mingw-64 (so far so good)
- updated the project to point all the includes libs where they should be
- compile
- ??? C:###\.cpp|216|error: invalid use of incomplete type 'ALLEGRO_FONT {aka struct ALLEGRO_FONT}'| (yep same error)

maybe the way im referencing it has changed between 5.0.10 and the new one :-/ , im going to look into that

[LATER THAT DAY BCUZ I CAN'T ADD TO THE THREAD]
i think i might be on to something with the referencing. All the errors are caused by my attempt to reference fonts sub member height.

//for instance:
textY = (letBoard.mid + letBoard.halfCell) - (si->font18->height / 2);//start Y here

This wasn't an issue in 5.0.10 but 5.2.4.1 doesn't want to know about it..

All of them, hmm, this means something :o

[LATER STILL - SOLUTION....]
Ok so they stoped us getting the font height directly

al_get_font_line_height(si->font18));//case closed

Thanks for your help Edgar. Now hopefully I can get it to build..

it wasn't me, it was other kids

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Yes, that would be an error with the way you're using the API then, not a build error.

You can't access opaque structs directly, but only through the mechanism that allegro allows you to use. In your code, the struct hasn't been defined yet, so you can't access its members. In allegro code, they include a private header for the implementation of ALLEGRO_FONT, so they can access its members directly.

This allows allegro to change it's backend at will, without breaking abi compatibility.

You can't double post on this forum, only edit and send to top. But you can reply now.

Did this fix your users issue with the half screen?

devo_au
Member #15,282
August 2013

All running and thanks for your help, moved on to minor improvements now.

I haven't heard back from the guy with the screen issues. He probably game up in disgust. Dems the breaks. Or maybe it worked and he is like me, you only hear from them if there is something wrong. Pretty slack but thats the way most people are unfortunately. Allegro 5.2.4.1 is pretty good and I'm not changing it any time soon.
Cheers Mate :)

it wasn't me, it was other kids

Go to: