r = engine->RegisterObjectProperty("MouseEvent", "int x", offsetof(MouseEvent,x)); jassert( r >= 0 );
// In static member function `static void ejuce::asMouseEvent::registerObjectType(asIScriptEngine*)':
// warning: invalid access to non-static data member `juce::MouseEvent::x' of NULL object
🎉 Celebrating 25 Years of GameDev.net! 🎉
Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!
use of offsetof in gcc 3.4.x
i'm completing the initial port of angeljuice for linux, all is quite good except that
i get a compiler warning that i'm trying to use the offsetof macro with a non-static member.
something like for example:
also when trying to execute that piece of code which access the memeber of a class (non static)
i get a segmentation fault. anyone have already this issue ? i mean, on windows there isn't this kind of
problem probably because offsetof works differently. there is a way to obtain the offsetof macro work
that way in gcc on linux ? (macosx's gcc is not reporting that warning nor crashing)...
any ideas ?
I always get a compiler warning with the offsetof macro when I compile on Linux, but in all my tests it worked anyway. Never had any problem with accessing the members.
Unfortunately I do not have a solution for you. Perhaps you can rewrite the offsetof macro in some way to not cause the compiler warning?
Regards,
Andreas
Unfortunately I do not have a solution for you. Perhaps you can rewrite the offsetof macro in some way to not cause the compiler warning?
Regards,
Andreas
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement