[fixed]Error on building latest gles branch for android

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
cheqnk
Posts: 5
Joined: Tue Feb 02, 2016 10:03 am

[fixed]Error on building latest gles branch for android

Post by cheqnk »

Hello everyone

Currently I'm trying to port irrlicht-gles branch latest revision from svn into android (JNI), and struggling with the following error.

Irrlicht/COGLES2Driver.h:46:3: error: a class-key must be used when declaring a friend
Irrlicht/COGLES2Driver.h:46:3: error: friend declaration does not name a class or function

which points into friend COGLES2CacheHandler declaration on COGLES2Driver.h.

Everythings was fine when compiling on Visual Studio 2010.
But above error occures on Android JNI.

Does anyone know how to solve this ?

Thank you very much
CuteAlien
Admin
Posts: 9644
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Error on building latest gles branch for android

Post by CuteAlien »

It should probably be "friend class COGLES2CacheHandler;" (and same for other similar places). I'm on the wrong OS right now, have to check in the evening.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
cheqnk
Posts: 5
Joined: Tue Feb 02, 2016 10:03 am

Re: Error on building latest gles branch for android

Post by cheqnk »

Changed it to "friend class COGLES2CacheHandler", the following error is occured.

Irrlicht/COGLES2Driver.h:46:16: error: using typedef-name 'irr::video::COGLES2CacheHandler' after 'class'
Irrlicht/COGLES2Common.h:63:65: error: 'irr::video::COGLES2CacheHandler' has a previous declaration here

Did some digging, it seems like friend-template-typedef kind is not working on gcc ?
CuteAlien
Admin
Posts: 9644
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Error on building latest gles branch for android

Post by CuteAlien »

Argh, sorry, forgot about this last evening... I'll try to remember it today!
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
CuteAlien
Admin
Posts: 9644
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Error on building latest gles branch for android

Post by CuteAlien »

For some reason I didn't get the compile error here (maybe other gcc version), but I've checked in a fix which might work. Please try it and give me some feedback.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
cheqnk
Posts: 5
Joined: Tue Feb 02, 2016 10:03 am

Re: Error on building latest gles branch for android

Post by cheqnk »

Great! Your fix works.
You saved my day..

Thanks a lot cutealien!
Post Reply