Win32 Example Error Irrlicht 1.4

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
VagueNess
Posts: 15
Joined: Wed Jan 02, 2008 8:17 pm
Location: Holland

Win32 Example Error Irrlicht 1.4

Post 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!
FuzzYspo0N
Posts: 914
Joined: Fri Aug 03, 2007 12:43 pm
Location: South Africa
Contact:

Post 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.
oldskoolPunk
Posts: 199
Joined: Wed Nov 29, 2006 4:07 am

Post 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.
Signature? I ain't signin nuthin!
VagueNess
Posts: 15
Joined: Wed Jan 02, 2008 8:17 pm
Location: Holland

Post 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'
oldskoolPunk
Posts: 199
Joined: Wed Nov 29, 2006 4:07 am

Post by oldskoolPunk »

Thats weird then. Just change the <void*> in FuzzYspo0N's answer to <irr::s32*>
Signature? I ain't signin nuthin!
VagueNess
Posts: 15
Joined: Wed Jan 02, 2008 8:17 pm
Location: Holland

Post 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
oldskoolPunk
Posts: 199
Joined: Wed Nov 29, 2006 4:07 am

Post 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
Signature? I ain't signin nuthin!
VagueNess
Posts: 15
Joined: Wed Jan 02, 2008 8:17 pm
Location: Holland

Post by VagueNess »

Thanks everyone, I figured it out :)
Post Reply