Public Group

# Debug build success, release mode failure?

This topic is 4393 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## 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 on other sites
Do you have using namespace std; somewhere?

##### 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 on other sites
Are your project settings different for each build type? Does one have different include paths to the other?

##### Share on other sites
I checked and didn't see any differences.

##### Share on other sites
Do you have some #if #ifdef or #ifndef in your code?

##### Share on other sites
Yeah, I've got #ifndef in my header files. How would that relate?

##### Share on other sites
All right, found the problem. I was running it off my USB stick. Copying it to my hard drive fixed the problem.

##### Share on other sites
Quote:
 Original post by marshdabeachyYeah, 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.

1. 1
2. 2
3. 3
Rutin
22
4. 4
frob
16
5. 5

• 9
• 33
• 13
• 13
• 10
• ### Forum Statistics

• Total Topics
632579
• Total Posts
3007181

×