Irrlicht Tutorial 15 .irr load file code Error->PLEASE HE

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
only1skingle
Posts: 25
Joined: Mon Sep 27, 2010 6:51 pm
Location: United Kingdom

Irrlicht Tutorial 15 .irr load file code Error->PLEASE HE

Post by only1skingle »

hey

I am trying to load a .irr file using the 15th tutorial available.

I have used the exact same code given but have chosen a different .irr file.

However i have one strange error that I'm not really sure why I am getting it. the error is this:

: fatal error C1021: invalid preprocessor command 'def'

here is the piece of code it's referring to:

#def _MSC_VER
#pragma comment(lib, "irrlicht.lib")
#endif

any help or guidance to solving this issue would be great!

thanks
only1skingle
Radikalizm
Posts: 1215
Joined: Tue Jan 09, 2007 7:03 pm
Location: Leuven, Belgium

Post by Radikalizm »

this should be #ifdef _MSC_VER

EDIT:

If you're having problems with preprocessor directives, this page gives a nice overview http://www.cplusplus.com/doc/tutorial/preprocessor/

Actually, that whole site is excellent as a C++ reference
only1skingle
Posts: 25
Joined: Mon Sep 27, 2010 6:51 pm
Location: United Kingdom

Post by only1skingle »

Ahh what an idiot I am!

thanks for pointing it out, else I would of been looking at that code all night!

and thanks for the link too! very helpful indeed :)

cheers
Anthony
Posts: 121
Joined: Sun Jan 09, 2011 12:03 pm

Post by Anthony »

you could set something in your ide's options to disable read-only file.

in MSVC
Tools->Options->Environment->Documents->Allow editing of....
No :shock: I am no noob, just checking if your not one too :roll:

Thanks to Niko and all others that made Irrlicht possible.
Radikalizm
Posts: 1215
Joined: Tue Jan 09, 2007 7:03 pm
Location: Leuven, Belgium

Post by Radikalizm »

Anthony wrote:you could set something in your ide's options to disable read-only file.

in MSVC
Tools->Options->Environment->Documents->Allow editing of....
What are you talking about? :?
Anthony
Posts: 121
Joined: Sun Jan 09, 2011 12:03 pm

Post by Anthony »

Code: Select all

// For educational purposes <- don't mess with big big companies ;)
*       Copyright (c) Microsoft Corporation. All rights reserved.
#ifndef __analysis_assume
#ifdef _PREFAST
#define __analysis_assume(expr) __assume(expr)
#else
#define __analysis_assume(expr) 
#endif
#endif
wouldn't it be crap if this has happend while debugging and some file opened and you didn't noticed you have changed something. Especially when the file has been saved (yeah got to love the automisation nowadays) and you shutdown your system due to whatever. That options is just to prevent (not 100% secure) that.

never noticed the #ifdefs in the tutorials so I thought it was changed in an included header. Thus I thought I could help here just a little bit.
No :shock: I am no noob, just checking if your not one too :roll:

Thanks to Niko and all others that made Irrlicht possible.
Post Reply