C++ builds - any way to build true debug versions?

Sorry, I appear to be asking difficult questions. :slight_smile:

I wasted time today because asserts in a third-party (but header only) library weren’t being fired because NDEBUG is defined under the “Debug Editor” build configuration.

In the end I just undefined it before including the library headers (and turned it back on later in the compile) but that’s a definite hack. Is there a good way to have a true debug build? I don’t mind the speed hit, I just want a way to actually get debug info. Plus I’d love to be able to log more information in a true debug build (so I’d definitely like to take advantage of _DEBUG or NDEBUG being defined)!

Good question! I’d like to know the answer to this too :slight_smile:

The engine libraries are compiled as fully optimized for Rocket, and “release” versions of third party libraries are linked in. Because your game code needs to statically link with the engine, we take care to compile the game code with similar definitions and settings that we use for the rest of the engine. This means that even though compiler optimizations are disabled when compiling your Rocket project in “debug”, some compiler definitions will be setup as they would for a “development” build, because we want to make sure that the engine header files are compiled in the same way that their static libraries were before we shipped them to you. I hope this makes sense. You are welcome to hack at the definitions in your own game’s header or in your game module’s Build.cs file, but we’d like to avoid changing the current behavior as we think it could introduce stability and compatibility problems. In the future it may be possible for us to provide versions of the engine libraries that are truly compiled in Debug mode. As you mentioned this would incur a significant performance hit, but it would allow you to use the NDEBUG definition properly and also could help with debugging gameplay code problems that cause crashes inside the engine’s code. Similarly, we may eventually provide access to the engine’s debug symbols (even in “development” builds), to help you diagnose problems more easily. We’re always interested in hearing your feedback about these workflows! Everything is still subject to change.

–Mike

I really think that would be incredibly useful and valuable to people like me who are going to be making heavy use of C++ (along with Blueprints!) to have both debug versions of the engine libraries along with the debug symbols.

Plus it will make your life easier if people like me have the debug symbols when we break something and cause weird crashes. :wink:

OK, I added a fresh feature request to our database about this, and we’ll discuss it more sometime soon. Thanks so much for the good feedback!