Sign in to follow this  
marshdabeachy

Debug build success, release mode failure?

Recommended Posts

Using C++ and Visual Studio 2003. My game compiles fine in debug mode with 0 errors and 0 warnings. However, in release mode, I get a few errors which appear to stem from this one: Mode7.cpp(23) : error C2653: 'std' : is not a class or namespace name I presume this is just because Visual Studio can't find some library somewhere. Any idea what's up?

Share this post


Link to post
Share on other sites
No, but I'm calling std stuff explicitely. Like I said, it works fine in the debug build. Here's where it's dying...


template <>
struct std::greater<spriteInfo*> {
bool operator()(spriteInfo const* a, spriteInfo const* b) {
return b->distToCamera < a->distToCamera;
}
};

Share this post


Link to post
Share on other sites
Quote:
Original post by marshdabeachy
Yeah, I've got #ifndef in my header files. How would that relate?


Although you already found the problem, i'l explain how #if* could be related.
In debug builds _DEBUG symbol is automaticaly defined. So you can put something like

#ifdef _DEBUG
...
#else
...
#endif

Obviously, debug and release builds would then compile different code. That would explain why the code compiles in debug but not in release builds - your compiling different code!

So be careful with those macros.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this