Debug build success, release mode failure?

Started by
7 comments, last by Paulius Maruska 17 years, 7 months ago
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?
Advertisement
Do you have using namespace std; somewhere?
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;    }};
Are your project settings different for each build type? Does one have different include paths to the other?
I checked and didn't see any differences.
Do you have some #if #ifdef or #ifndef in your code?
Yeah, I've got #ifndef in my header files. How would that relate?
All right, found the problem. I was running it off my USB stick. Copying it to my hard drive fixed the problem.
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.

This topic is closed to new replies.

Advertisement