Article # 195, added by Geoworks, historical record
| first | previous | index | next | last |

Glue error: "test2.eobj: struct foo.bar: field type mismatch"



Q. I have a developer who is porting old code in which the same structure 
   name ("Foo") is defined it 2 different .c files (not .goc files).  But
   it is defined to be one thing in one file, and another in the second
   file.

   ------FILE 1-------
   struct foo {
       int * bar;
   };
   struct foo var1;

   -----FILE 2--------
   struct foo {
       char * bar;
   };
   struct foo var2;

   However, glue complains:
   error: test2.eobj: struct foo.bar: field type mismatch
   Type fptr(signed(2)) not same as type fptr(int(1)).

   I'm not exactly sure why this is happening.  Clearly it seems like a
   bad idea to do this, but I'm not sure why it is an error (The developer
   says it works when compiled for DOS/Windoze)

A. I'm pretty sure that glue simply doesn't support having a separate
   namespace for each .obj file, at least not for "types". Even this
   will not work:

   foo.c:
       char * x;

   bar.c:
       int x;

   All variables declared outside of routines in C for GEOS get put
   into that geodes DGROUP, so there is not a separate name space for
   them.