I am trying to find out how to enable (& use) Borland’s WARN & TRACE macros.
My starting point was this link:
http://bcbjournal.org/articles/vol2/9809/Debugging_with_diagnostic_macros.htm?PHPSESSID=37bf58851bfeb5c199d1af31d7b2e7ff
However, that appears to be for BCB5, and not the 2006 Borland Developer Studio.
- I’ve set the two defines (__WARN & __TRACE)
- I’ve included the .h file ()
- I’ve added some macros, and everything compiles & links fine.
But when I run the application (in DEBUG mode), no debug output file is created.
What am I missing here?
I was investigating this debug TRACE feature too since I use Borland’s toolchain. A couple things I noted while I was figure this out.
__TRACEand__WARNare define before#include <checks.h>.You can also remove the #define __TRACE and __WARN from the translation unit and instead pass it to bcc32 using the -D macroname option during compilation.
If that’s really the case then redirecting the stderr stream to a file should give what you’re looking for. Compile your sample program, then run it with something like this:
All in all, you’ll probably want to find alternative tools to aid you in the debugging process. Unfortunately, the TRACE & WARN macros provided here are poorly documented and for later versions of borland/embarcadero’s toolchain it doesn’t even work properly because the rtl doesn’t have the needed functions/classes compiled into it. As such, the following is worth investigating: