Debug vs. release version of a sample
Hello,
I'm exploring the ObjBRX\V16\samples\CMyManagedEntity\Projects\Bcad\CMyManagedEntity\CMyManagedEntity.vcxproj project/sample.
I cannot the significant difference between Debug and Release (BCad) versions which I'm used to find in similar AutoCAD projects.
I would except:
- [1] Debug version to have: _DEBUG preproc. definition, usage of MSVCRT???D.dll library, some "Generate debug info (for edit, not for continue) set up;
- [2] Release version to have : _NDEBUG preproc. definition, usage of MSVCRT???.dll (i.e. without "D") library, "Don't generate debug info" set up.
I see no significant difference between "Debug BCad" and "Release BCad" versions.
Why there are not (so) different settings, as described in [1] and [2]?
Are Debug settings [1] enough to be able to debug an application?
Thank you in advance.
Best regards,
LuP
Comments
-
Hello, Lucas,
there is a main misunderstanding :
the BricsCAD you use (any public BricsCAD) is a RELEASE build ...
if you use _DEBUG for yoru Debug build, then it still must link against Release CRT libraries, otherwise you would load true debug CRT modules into Release BricsCAD process, which would result in crashes, earlier or later.
Therefore, BRX sample uses the usual trick (also the ARX samples shipped by Autodesk) :
all includes of system (Windows, ARX/BRX etc.) must be done as RELEASE, meaning the _DEBUG preprocessor needs to be absent during includes processing -
but after system includes, the _DEBUG symbol (if it was present) is restored, and *THEN* your own includes and your own code is compiled with _DEBUG present.
This means, the linker setting to include debug information affects your code only, which perfectly allows debugging your own code.
Please have a close look at StdAfx.h in ARX or BRX samples ... you will quickly recognise this :-)
hope this helps & many greetings !0