frankheckenbach / ftgl

fork from http://sourceforge.net/projects/ftgl
Other
28 stars 17 forks source link

FTVectoriser.cpp: error: invalid conversion from 'GLUTesselatorFunction' {aka 'void (*)(...)'} to 'GLvoid (*)()' {aka 'void (*)()'} [-fpermissive] #17

Open barracuda156 opened 1 year ago

barracuda156 commented 1 year ago

Build with GCC fails on:

FTVectoriser.cpp: In member function 'void FTVectoriser::MakeMesh(FTGL_DOUBLE, int, float)':
FTVectoriser.cpp:277:52: error: invalid conversion from 'GLUTesselatorFunction' {aka 'void (*)(...)'} to 'GLvoid (*)()' {aka 'void (*)()'} [-fpermissive]
  277 |     gluTessCallback(tobj, GLU_TESS_BEGIN_DATA,     (GLUTesselatorFunction)ftglBegin);
      |                                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                                    |
      |                                                    GLUTesselatorFunction {aka void (*)(...)}
In file included from FTInternals.h:73,
                 from FTVectoriser.cpp:30:
/System/Library/Frameworks/OpenGL.framework/Headers/glu.h:290:74: note:   initializing argument 3 of 'void gluTessCallback(GLUtesselator*, GLenum, GLvoid (*)())'
  290 | extern void gluTessCallback (GLUtesselator* tess, GLenum which, GLvoid (*CallBackFunc)());
      |                                                                 ~~~~~~~~~^~~~~~~~~~~~~~~
FTVectoriser.cpp:278:52: error: invalid conversion from 'GLUTesselatorFunction' {aka 'void (*)(...)'} to 'GLvoid (*)()' {aka 'void (*)()'} [-fpermissive]
  278 |     gluTessCallback(tobj, GLU_TESS_VERTEX_DATA,    (GLUTesselatorFunction)ftglVertex);
      |                                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                                    |
      |                                                    GLUTesselatorFunction {aka void (*)(...)}
/System/Library/Frameworks/OpenGL.framework/Headers/glu.h:290:74: note:   initializing argument 3 of 'void gluTessCallback(GLUtesselator*, GLenum, GLvoid (*)())'
  290 | extern void gluTessCallback (GLUtesselator* tess, GLenum which, GLvoid (*CallBackFunc)());
      |                                                                 ~~~~~~~~~^~~~~~~~~~~~~~~
FTVectoriser.cpp:279:52: error: invalid conversion from 'GLUTesselatorFunction' {aka 'void (*)(...)'} to 'GLvoid (*)()' {aka 'void (*)()'} [-fpermissive]
  279 |     gluTessCallback(tobj, GLU_TESS_COMBINE_DATA,   (GLUTesselatorFunction)ftglCombine);
      |                                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                                    |
      |                                                    GLUTesselatorFunction {aka void (*)(...)}
/System/Library/Frameworks/OpenGL.framework/Headers/glu.h:290:74: note:   initializing argument 3 of 'void gluTessCallback(GLUtesselator*, GLenum, GLvoid (*)())'
  290 | extern void gluTessCallback (GLUtesselator* tess, GLenum which, GLvoid (*CallBackFunc)());
      |                                                                 ~~~~~~~~~^~~~~~~~~~~~~~~
FTVectoriser.cpp:280:52: error: invalid conversion from 'GLUTesselatorFunction' {aka 'void (*)(...)'} to 'GLvoid (*)()' {aka 'void (*)()'} [-fpermissive]
  280 |     gluTessCallback(tobj, GLU_TESS_END_DATA,       (GLUTesselatorFunction)ftglEnd);
      |                                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                                    |
      |                                                    GLUTesselatorFunction {aka void (*)(...)}
/System/Library/Frameworks/OpenGL.framework/Headers/glu.h:290:74: note:   initializing argument 3 of 'void gluTessCallback(GLUtesselator*, GLenum, GLvoid (*)())'
  290 | extern void gluTessCallback (GLUtesselator* tess, GLenum which, GLvoid (*CallBackFunc)());
      |                                                                 ~~~~~~~~~^~~~~~~~~~~~~~~
FTVectoriser.cpp:281:52: error: invalid conversion from 'GLUTesselatorFunction' {aka 'void (*)(...)'} to 'GLvoid (*)()' {aka 'void (*)()'} [-fpermissive]
  281 |     gluTessCallback(tobj, GLU_TESS_ERROR_DATA,     (GLUTesselatorFunction)ftglError);
      |                                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                                    |
      |                                                    GLUTesselatorFunction {aka void (*)(...)}
/System/Library/Frameworks/OpenGL.framework/Headers/glu.h:290:74: note:   initializing argument 3 of 'void gluTessCallback(GLUtesselator*, GLenum, GLvoid (*)())'
  290 | extern void gluTessCallback (GLUtesselator* tess, GLenum which, GLvoid (*CallBackFunc)());
      |                                                                 ~~~~~~~~~^~~~~~~~~~~~~~~
make[2]: *** [libftgl_la-FTVectoriser.lo] Error 1
frankheckenbach commented 1 year ago

Note this repo isn't really maintained anymore (see https://github.com/frankheckenbach/ftgl/issues/10). You might want to try this fork: https://github.com/HamzaM3/ftgl

barracuda156 commented 1 year ago

@frankheckenbach Thank you, I will open an issue there.

barracuda156 commented 1 year ago

Oops, issues are disabled there.

@HamzaM3 Could you please take a look at this? Once -fpermissive is passed, build succeeds. I tried building from your latest commit, the problem is still there.

HamzaM3 commented 1 year ago

@barracuda Cool an issue, give me some time to organize myself

HamzaM3 commented 1 year ago

Is the problem resolved ?

barracuda156 commented 1 year ago

@HamzaM3 It does build with -fpermissive, however this is a hack, and it indicates there is a problem with the code.