home home

downloads files

forum forum

docs docs

wiki wiki

faq faq

Cube & Cube 2 FORUM


Possible macro concatenation error in glemu.h

by chasester on 11/16/2016 19:08, 2 messages, last message: 12/08/2016 00:32, 668 views, last view: 04/21/2024 16:34

This may only be a tesseract error, but its worth looking into.

I have some one building on gcc and is encountering an error on line 51 Stating that glVertexAttrib1f is undefined:

GLE_INITATTRIBF(vertex, ATTRIB_VERTEX);

This macro is on line 42-47:
#define GLE_INITATTRIBF(name, index)
GLE_INITATTRIB(name, index, f, float)
static inline void name(const vec &v) { glVertexAttrib3fv_(index, v.v); }
static inline void name(const vec &v, float w) { glVertexAttrib4f_(index, v.x, v.y, v.z, w); }
static inline void name(const vec2 &v) { glVertexAttrib2fv_(index, v.v); }
static inline void name(const vec4 &v) { glVertexAttrib4fv_(index, v.v); }

line 43 references a macro GLE_INITATTRIB which is defined on line 37 through 41:
#define GLE_INITATTRIB(name, index, suffix, type)
static inline void name##suffix(type x) { glVertexAttrib1##suffix##_(index, x); }
static inline void name##suffix(type x, type y) { glVertexAttrib2##suffix##_(index, x, y); }
static inline void name##suffix(type x, type y, type z) { glVertexAttrib3##suffix##_(index, x, y, z); }
static inline void name##suffix(type x, type y, type z, type w) { glVertexAttrib4##suffix##_(index, x, y, z, w); }

As can be noted there is a double concatination error here whereas glVertexAttrib1f would be glVertexAttrib1f_ therefore leading to an undefined. From what Ive read this is a removed feature (or maybe was never a feature) for version 6 gcc.

http://stackoverflow.com/questions/1489932/how-to-concatenate-twice-with-the-c-preprocessor-and-expand-a-macro-as-in-arg

Above is a way to fix this error for gcc.

Thanx
chasester

   Board Index   

#1: ..

by Hypernova2 on 12/06/2016 01:34

For anyone who runs into this error, check that your shared/glexts.h is up to date. This is not an issue with Tesseract master, however Rival may have been forked from a bad commit (I can't find which).

reply to this message

#2: ..

by chasester on 12/08/2016 00:32

i assume anything after revision 2114 is save. This seems to be where this issue was addressed. But probably Starting form the HEAD would be best.

reply to this message

   Board Index   


Unvalidated accounts can only reply to the 'Permanent Threads' section!


content by Aardappel & eihrul © 2001-2024
website by SleepwalkR © 2001-2024
53868291 visitors requested 71643462 pages
page created in 0.029 seconds using 10 queries
hosted by Boost Digital