requesting help with Allegro and OpenGLish stuff
#1
requesting help with Allegro and OpenGLish stuff
1st question: I've been working on compiling Allegro 4.4.2 for the past two weeks and finally got it working (i think) with gcc, but I'm running into a problem with the MIPSpro compile, maybe its some basic C stuff, just wondering if anyone knows how to fix this?


Code:
cc-1142 cc: ERROR File = /usr/people/develop/dev/Allegro/allegro-4.4.2_gcc/src/font.c, Line = 32
  There are too many initializers for a declared aggregate.

  static FONT_GLYPH f_0x20 = { 8, 8, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } };
                                     ^

cc-1142 cc: ERROR File = /usr/people/develop/dev/Allegro/allegro-4.4.2_gcc/src/font.c, Line = 33
  There are too many initializers for a declared aggregate.

  static FONT_GLYPH f_0x21 = { 8, 8, { 0x18, 0x3C, 0x3C, 0x18, 0x18, 0x00, 0x18, 0x00 } };
                                     ^

2nd question:  In order to compile Allegro I had to disable examples and modules, but I really wanted to compile them too, I was getting this error tho:


Code:
Linking C executable skater_agl
ld32: WARNING 84 : /usr/lib32/libSM.so is not used for resolving any symbol.
ld32: WARNING 84 : /usr/lib32/libdl.so is not used for resolving any symbol.
ld32: ERROR   33 : Unresolved text symbol "glActiveTexture" -- 1st referenced by ../../lib/liballeggl.a(glvtable.c.o).
        Use linker option -v to see when and which objects, archives and dsos are loaded.  
ld32: ERROR   33 : Unresolved text symbol "glMultiTexCoord2f" -- 1st referenced by ../../lib/liballeggl.a(glvtable.c.o).
        Use linker option -v to see when and which objects, archives and dsos are loaded.  
ld32: ERROR   33 : Unresolved text symbol "glMultiTexCoord2i" -- 1st referenced by ../../lib/liballeggl.a(glvtable.c.o).
        Use linker option -v to see when and which objects, archives and dsos are loaded.  
ld32: INFO    152: Output file removed because of error.
collect2: ld returned 2 exit status
gmake[2]: *** [demos/skater/CMakeFiles/skater_agl.dir/build.make:982: demos/skater/skater_agl] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:2550: demos/skater/CMakeFiles/skater_agl.dir/all] Error 2
gmake: *** [Makefile:114: all] Error 2
-bash-4.2$ 

googling around, it appears "glActiveTexture" is in glext.h, which I suppose should be located in GL/glext.h.  anyone know what these OpenGL headers are or if they are actually supported in IRIX?  SGI originally had them posted under oss.sgi.com, now they are located in https://www.khronos.org/registry/OpenGL/api/GL/

putzing around  I created /usr/local/include/KHR,  and added KHR/khrplatform.h, created /usr/local/include/OpenGL, copied GL/glext.h to OpenGL/glext.h, added #include <GL/glext.h> to the end of /usr/include/GL/gl.h, and added GL/glext.h to demos/skater/CMakeFiles/skater_agl.dir/C.includecache, but it just gave me more errors

3rd question: regarding Allegro, wtf is "agl"?  anything that had the suffix "agl" would have the error from question 2.  Allegro GL?  Apple GL?

edit:
4th Question: anyone ever try to compile Allegro 5.0.11?  

I get this error:


Code:
[  0%] Building C object CMakeFiles/allegro.dir/src/tls.c.o
In file included from /usr/people/develop/dev/Allegro/allegro-5.0.11/src/tls.c:148:
/usr/people/develop/dev/Allegro/allegro-5.0.11/src/tls_native.inc:22: error: thread-local storage not supported for this target
/usr/people/develop/dev/Allegro/allegro-5.0.11/src/tls_native.inc: In function `tls_get':
/usr/people/develop/dev/Allegro/allegro-5.0.11/src/tls_native.inc:33: error: thread-local storage not supported for this target
gmake[2]: *** [CMakeFiles/allegro.dir/build.make:992: CMakeFiles/allegro.dir/src/tls.c.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:61: CMakeFiles/allegro.dir/all] Error 2
gmake: *** [Makefile:114: all] Error 2
-bash-4.2$ 

line 148 of src/tls.c:
   #include "tls_native.inc"
   
line 22 of src/tls_native.inc:
static THREAD_LOCAL_QUALIFIER thread_local_state _tls;
(This post was last modified: 01-12-2019, 01:57 AM by gijoe77.)
gijoe77
Tezro

Posts: 573
Threads: 33
Joined: Jun 2018
Find Reply
01-12-2019, 01:50 AM
#2
RE: requesting help with Allegro and OpenGLish stuff
Hi gijoe77!!!


1st question:

aggregate data types are structs and arrays in C, and initializers are those values you put into a braced-list for its initialization. If the compiler complains about too many initializers, then you have more values in the braced-list than the struct needs (in this case it is clearly a struct since the initializer uses nested braces).

Look what exactly FONT_GLYPH is and how many values it needs.


Another reason could be C standards related: Aggregate initialization was first introduced with C99. Check this too.


Good luck!
TruHobbyist
Octane

Posts: 71
Threads: 8
Joined: May 2018
Find Reply
01-12-2019, 09:22 AM
#3
RE: requesting help with Allegro and OpenGLish stuff
MIPSPro aggregate initialisation isn't quite standards conforming.

I've seen cases in some of the things I've tried to get working where I had to rejig these to get the compiler to accept them.

EDIT: Ignore the below, serves me right for not actually checking with MIPSPro :-)

I'll have a download of it and see if I see the same as you.


----

If the original is like this:


Code:
static struct FONT_GLYPH f_0x21 = { 8, 8, { 0x18, 0x3C, 0x3C, 0x18, 0x18, 0x00, 0x18, 0x00 } };


You could try re-writing it like this (need to work out what that internal structure is inside FONT_GLYPH of course):


Code:
static const struct OTHER theother = { 0x18, 0x3C, 0x3C, 0x18, 0x18, 0x00, 0x18, 0x00 };
static struct FONT_GLYPH f_0x21 = { 8, 8, theother };
(This post was last modified: 01-12-2019, 11:25 AM by mrthinlysliced.)
mrthinlysliced
Octane

Posts: 94
Threads: 8
Joined: May 2018
Find Reply
01-12-2019, 10:47 AM
#4
RE: requesting help with Allegro and OpenGLish stuff
I get that same issue as you do gijoe.

Problem seems to stem from the use of the macro "ZERO_SIZE_ARRAY" in font.h.

The macro itself just seems to rewrite to be a 64 element array of the type passed in.

If you rewrite this:


Code:
typedef struct FONT_GLYPH           /* a single monochrome font character */
{
  short w, h;
 ZERO_SIZE_ARRAY(unsigned char, dat);
} FONT_GLYPH;

To be this:

Code:
typedef struct FONT_GLYPH           /* a single monochrome font character */
{
  short w, h;
 /*ZERO_SIZE_ARRAY(unsigned char, dat);*/
 unsigned char dat[64];
} FONT_GLYPH;

It's no longer using the macro and seems to compile ok. There are other places that macro is used, so maybe they need changing too.

I'm getting other errors after that (mixer.c fails, something about LONG_LONG) - but at least it might get you a bit further along.
(This post was last modified: 01-12-2019, 12:22 PM by mrthinlysliced.)
mrthinlysliced
Octane

Posts: 94
Threads: 8
Joined: May 2018
Find Reply
01-12-2019, 12:22 PM
#5
RE: requesting help with Allegro and OpenGLish stuff
glActiveTexture is from OpenGL 1.3. There is an ARB extension glActiveTextureARB but unsure if it will work as afaik, VPro only supports 1.2 with some ARB extensions.

GL works by creating a context requesting the Core profile that you want, and then getting a function pointer to the extensions you want. glXGetProcAddressARB or glXGetProcAddress passing the name of the function (as string). https://www.khronos.org/opengl/wiki/Load..._Functions

Since this is right on the borderline of supported versions, the only way to check is find out which extensions are supported at runtime. https://www.khronos.org/opengl/wiki/Open...on_queries
(This post was last modified: 01-13-2019, 01:07 AM by spiroyster.)
spiroyster
O2

Posts: 8
Threads: 1
Joined: Jan 2019
Find Reply
01-13-2019, 12:55 AM


Forum Jump:


Users browsing this thread: 1 Guest(s)