is this a bug or i just have to ignore the warnings?/home/leezhieng/Projects/GenetixMaterialEditor/main.cpp:: In member function ‘virtual bool MyEventReceiver::OnEvent(irr::SEvent)’:
/home/leezhieng/Projects/GenetixMaterialEditor/main.cpp:26: warning: enumeration value ‘EGET_ELEMENT_FOCUS_LOST’ not handled in switch
/home/leezhieng/Projects/GenetixMaterialEditor/main.cpp:26: warning: enumeration value ‘EGET_ELEMENT_FOCUSED’ not handled in switch
/home/leezhieng/Projects/GenetixMaterialEditor/main.cpp:26: warning: enumeration value ‘EGET_ELEMENT_HOVERED’ not handled in switch
/home/leezhieng/Projects/GenetixMaterialEditor/main.cpp:26: warning: enumeration value ‘EGET_ELEMENT_LEFT’ not handled in switch
/home/leezhieng/Projects/GenetixMaterialEditor/main.cpp:26: warning: enumeration value ‘EGET_ELEMENT_CLOSED’ not handled in switch
/home/leezhieng/Projects/GenetixMaterialEditor/main.cpp:26: warning: enumeration value ‘EGET_SCROLL_BAR_CHANGED’ not handled in switch
/home/leezhieng/Projects/GenetixMaterialEditor/main.cpp:26: warning: enumeration value ‘EGET_CHECKBOX_CHANGED’ not handled in switch
/home/leezhieng/Projects/GenetixMaterialEditor/main.cpp:26: warning: enumeration value ‘EGET_LISTBOX_CHANGED’ not handled in switch
/home/leezhieng/Projects/GenetixMaterialEditor/main.cpp:26: warning: enumeration value ‘EGET_LISTBOX_SELECTED_AGAIN’ not handled in switch
/home/leezhieng/Projects/GenetixMaterialEditor/main.cpp:26: warning: enumeration value ‘EGET_FILE_CHOOSE_DIALOG_CANCELLED’ not handled in switch
/home/leezhieng/Projects/GenetixMaterialEditor/main.cpp:26: warning: enumeration value ‘EGET_MESSAGEBOX_YES’ not handled in switch
/home/leezhieng/Projects/GenetixMaterialEditor/main.cpp:26: warning: enumeration value ‘EGET_MESSAGEBOX_NO’ not handled in switch
/home/leezhieng/Projects/GenetixMaterialEditor/main.cpp:26: warning: enumeration value ‘EGET_MESSAGEBOX_OK’ not handled in switch
/home/leezhieng/Projects/GenetixMaterialEditor/main.cpp:26: warning: enumeration value ‘EGET_MESSAGEBOX_CANCEL’ not handled in switch
/home/leezhieng/Projects/GenetixMaterialEditor/main.cpp:26: warning: enumeration value ‘EGET_EDITBOX_ENTER’ not handled in switch
/home/leezhieng/Projects/GenetixMaterialEditor/main.cpp:26: warning: enumeration value ‘EGET_TAB_CHANGED’ not handled in switch
/home/leezhieng/Projects/GenetixMaterialEditor/main.cpp:26: warning: enumeration value ‘EGET_COMBO_BOX_CHANGED’ not handled in switch
/home/leezhieng/Projects/GenetixMaterialEditor/main.cpp:26: warning: enumeration value ‘EGET_SPINBOX_CHANGED’ not handled in switch
:: === Build finished: 0 errors, 18 warnings ===
warnings when use event in switch?
warnings when use event in switch?
My company: https://kloena.com
My profile: https://zhieng.com
My co-working space: https://deskspace.info
My game engine: https://kemena3d.com
My profile: https://zhieng.com
My co-working space: https://deskspace.info
My game engine: https://kemena3d.com
by the way, when i try to add
it got this errors:
Code: Select all
MyEventReceiver receiver;i followed exactly the tutorial at the main site.../home/leezhieng/Projects/GenetixMaterialEditor/main.cpp:: In function ‘int main()’:
/home/leezhieng/Projects/GenetixMaterialEditor/main.cpp:67: error: cannot declare variable ‘receiver’ to be of abstract type ‘MyEventReceiver’
/home/leezhieng/Projects/GenetixMaterialEditor/main.cpp:19: note: because the following virtual functions are pure within ‘MyEventReceiver’:
/home/leezhieng/Irrlicht/include/IEventReceiver.h:256: note: virtual bool irr::IEventReceiver::OnEvent(const irr::SEvent&)
My company: https://kloena.com
My profile: https://zhieng.com
My co-working space: https://deskspace.info
My game engine: https://kemena3d.com
My profile: https://zhieng.com
My co-working space: https://deskspace.info
My game engine: https://kemena3d.com
You should use
virtual bool irr::IEventReceiver::OnEvent(const irr::SEvent&)
not
virtual bool irr::IEventReceiver::OnEvent(irr::SEvent&)
(without "const").
If you have used for example
Code after default (2, 3) will be ignored. Maybe you have something like this.
virtual bool irr::IEventReceiver::OnEvent(const irr::SEvent&)
not
virtual bool irr::IEventReceiver::OnEvent(irr::SEvent&)
(without "const").
If you have used for example
Code: Select all
switch ( something )
{
case 1 :
foo('dadad');
break;
default:
foo('sadas');
break;
case 2 :
foo('dadad');
break;
case 3 :
foo('dadad');
break;
}
Last edited by TomiZ on Sat Sep 22, 2007 2:25 pm, edited 1 time in total.
No more error, but now, when i double click my app nothing happen..... anyone know why?
My company: https://kloena.com
My profile: https://zhieng.com
My co-working space: https://deskspace.info
My game engine: https://kemena3d.com
My profile: https://zhieng.com
My co-working space: https://deskspace.info
My game engine: https://kemena3d.com
From debugger:
Code: Select all
#0 0x804c256 MyEventReceiver::OnEvent(this=0xbfc24dfc, event=@0x3) (/home/leezhieng/Projects/GenetixMaterialEditor/main.cpp:23)
#1 0x8055d37 irr::CLogger::log(this=0x82b8e08, text=0x82b8e48 "Irrlicht Engine version 1.4alpha", ll=irr::ELL_INFORMATION) (CLogger.cpp:39)
#2 0x8056a94 irr::os::Printer::log(message=0x82b8e48 "Irrlicht Engine version 1.4alpha", ll=irr::ELL_INFORMATION) (os.cpp:168)
#3 0x8055553 CIrrDeviceStub(this=0x82b8878, __vtt_parm=0x822b55c, version=0x822ab7d "1.4alpha", recv=0xbfc24dfc) (CIrrDeviceStub.cpp:31)
#4 0x80521e7 CIrrDeviceLinux(this=0x82b8878, driverType=irr::video::EDT_OPENGL, windowSize=@0xbfc24d78, bits=32, fullscreen=false, sbuffer=false, vsync=false, antiAlias=false, receiver=0xbfc24dfc, version=0x822ab7d "1.4alpha") (CIrrDeviceLinux.cpp:52)
#5 0x8052768 irr::createDeviceEx(param=@0xbfc24d74) (CIrrDeviceLinux.cpp:1324)
#6 0x804c8db irr::createDevice(driverType=irr::video::EDT_OPENGL, windowSize=@0xbfc24df4, bits=32, fullscreen=false, stencilbuffer=false, vsync=false, res=0xbfc24dfc, version=0x822ab7d "1.4alpha") (Irrlicht.cpp:41)
#7 0x804bc88 main() (/home/leezhieng/Projects/GenetixMaterialEditor/main.cpp:68)My company: https://kloena.com
My profile: https://zhieng.com
My co-working space: https://deskspace.info
My game engine: https://kemena3d.com
My profile: https://zhieng.com
My co-working space: https://deskspace.info
My game engine: https://kemena3d.com
Nope I didn't use default infront of other cases.
My company: https://kloena.com
My profile: https://zhieng.com
My co-working space: https://deskspace.info
My game engine: https://kemena3d.com
My profile: https://zhieng.com
My co-working space: https://deskspace.info
My game engine: https://kemena3d.com
thanks there is no more warnings. but still, when i launch it nothing happen.
My company: https://kloena.com
My profile: https://zhieng.com
My co-working space: https://deskspace.info
My game engine: https://kemena3d.com
My profile: https://zhieng.com
My co-working space: https://deskspace.info
My game engine: https://kemena3d.com
warnings are just that, they're warnings alerting you to something that you could have possibly missed. Generally they mean nothing and can be ignored and will not affect how your program functions but sometimes they can be useful and point out an oversight you've made, such as not handling all the correct events in your switch. As it happens you probably don't care about those other events so you can just ignore them.
No, I meant, no more warnings now, but then I double click my compiled app it didn't launch at all. Nothing happened.
My company: https://kloena.com
My profile: https://zhieng.com
My co-working space: https://deskspace.info
My game engine: https://kemena3d.com
My profile: https://zhieng.com
My co-working space: https://deskspace.info
My game engine: https://kemena3d.com
ok now i copy directly from the tutorial page at the main site. it did opened a window and i can see all the gui etc. once i move my mouse/press a button it close...
My company: https://kloena.com
My profile: https://zhieng.com
My co-working space: https://deskspace.info
My game engine: https://kemena3d.com
My profile: https://zhieng.com
My co-working space: https://deskspace.info
My game engine: https://kemena3d.com
-
monkeycracks
- Posts: 1029
- Joined: Thu Apr 06, 2006 12:45 am
- Location: Tennesee, USA
- Contact:
In order to get rid of all of those warnings, just do this
Right before you close your switch.. that seemed to work for me.
Code: Select all
default:
break;