|NDEBUG it is defined by C/C++ standards to control what assert does.
assert - cppreference.com[^]
Visual Studio will redirect it in release build to try and do something useful but probably wrong and you are welcome to override it.
Visual Studio itself uses it's own two macros to control build/release modes
_DEBUG Defined as 1 when the /LDd, /MDd, or /MTd compiler option is set. Otherwise, undefined.
_DLL Defined as 1 when the /MD or /MDd (Multithreaded DLL) compiler option is set. Otherwise, undefined.
You seem to be getting confused between what is demanded by C/C++ standards and what VS does itself.
Assert functionality lies outside VS control as demanded by the C/C++ standard.
Now at a guess what you have a wrong DLL dependency like the console using msvcrd.lib rather than msvcr.lib. If you are dragging in other libraries you need to make sure those other libraries are also compiled in release mode. So what other libraries are you linking with and are they added in your project source list. AKA do you see them compile when you do a full build or are you just dragging in pre-compiled units.
There are a number of dependency walkers out there you can run on your exe to see what DLL's it calls hit your favourite search engine. You shouldn't need them and I don't use them (so can't recommend one) but they are out there.
In vino veritas
modified 7-Sep-17 1:46am.