Page 1 of 1

Win32 Example Error Irrlicht 1.4

Posted: Wed Jan 02, 2008 8:31 pm
by VagueNess
Hi

I have a problem when compiling the code of the "Win32 window" tutorial. The errors are:

"expected '>' before '(' token"
"expected identifier before '(' token"
"expected '<' before '(' token"

at line 196, which is:

Code: Select all

param.WindowId = reinterpret_cast(hIrrlichtWindow);
I'm a total noob in Irrlicht
Can someone help?

Thank you!

Posted: Wed Jan 02, 2008 8:45 pm
by FuzzYspo0N
Hey

I suggest reading through some of the tutorials, and especially a cpp book.

reinterpret cast uses a template which is noted by <type>

try reading what type yopu are trying to cast to, and stick it where its asking for a <> before the ()

For example (taken from the irrlicht examples)

Code: Select all

 param.WindowId = reinterpret_cast<void*>(hIrrlichtWindow);
notice the <void*> its casting it to a void pointer...

Hope this helps.

Posted: Wed Jan 02, 2008 9:37 pm
by oldskoolPunk
I think that tutorial needs to be updated.
Since 1.3.1, a simple

Code: Select all

param.WindowId = hwnd;
has worked for me.

Posted: Wed Jan 02, 2008 9:44 pm
by VagueNess
oldskoolPunk wrote:I think that tutorial needs to be updated.
Since 1.3.1, a simple

Code: Select all

param.WindowId = hwnd;
has worked for me.
I did that but is says

Code: Select all

invalid conversion from 'HWND__*' to "irr::s32"
I already tried to change it to irr::s32, I guess it's still needed...

@FuzzySpoon: I've figured out that it had to be <s32>, but then I get a linker error: undefined reference to `_imp___ZN3irr14createDeviceExERKNS_27SIrrlichtCreationParametersE'

Posted: Wed Jan 02, 2008 9:52 pm
by oldskoolPunk
Thats weird then. Just change the <void*> in FuzzYspo0N's answer to <irr::s32*>

Posted: Wed Jan 02, 2008 9:58 pm
by VagueNess
oldskoolPunk wrote:Thats weird then. Just change the <void*> in FuzzYspo0N's answer to <irr::s32*>
I was doing that... im not that stupid xD

Posted: Wed Jan 02, 2008 10:07 pm
by oldskoolPunk
Aw man im really sorry. Try this thread

http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=21164

Also try your code without using namespaces. Someone somewhere sometime said that Irrlicht's namespaces might cause errors when using windows.h

Posted: Wed Jan 02, 2008 11:29 pm
by VagueNess
Thanks everyone, I figured it out :)