compiler frustration

Discussion about everything. New games, 3d math, development tips...
Post Reply
Thulsa Doom
Posts: 63
Joined: Thu Aug 05, 2004 9:40 am
Location: Germany

compiler frustration

Post by Thulsa Doom »

It's so :(

I tried to compile irrlicht with some 3rd party library.
If i include "irrMap.h" from the API include directory,
then my compiler throws
Error C2529
on compile time.
My compilers help states:
C2529: This error may be fixed by using pointer syntax and declaring a reference to a pointer.
In my opinion this may not be a bug, as irrlicht project
compiles fine with my MSVC8.0

Is there a compiler switch to workaround?
Thulsa Doom
Posts: 63
Joined: Thu Aug 05, 2004 9:40 am
Location: Germany

solved

Post by Thulsa Doom »

got it! :D

My class was inheriting from core::map<unsigned int, CTree&>!
Because i was embossing the template 2nd argument as a Reference <CTree&>
the compiler was throwing the error.

But when i stamp it to a pointer <CTree*> it will compile fine:

Code: Select all

class CTree
	: public irr::core::map<unsigned int, CTree*>
{
       ..
}
BTW: Does someone know what's the compiler switch /EHsc good for?
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

Actually /EHsc is the combination of two flags, /EHs and /EHc. The first flag tells the compiler to enable support for exceptions. The second flag tells the compiler to treat functions with C linkage as if they are not allowed to throw exceptions.

If you, or code you call, may throw an exception, then you should compile with /EHs. If you don't, objects on the stack will not have their destructors called when the exception is thrown.

The second flag is useful because it will cause the runtime system to invoke std::unexpected(). This will invoke a callback indicating that an unexpected exception occured [see documentation for std::set_unexpected()], and by default the result is immediate program termination. This is often better than a silent failure to release resources that could occur otherwise.

Travis
Post Reply