How to get debug mode version of libstdc++ when compiling GCC

Jonathan Wakely cow@compsoc.man.ac.uk
Thu Jul 22 15:15:00 GMT 2004


On Thu, Jul 22, 2004 at 05:04:05PM +0200, Pit Cuppens wrote:

> Dear all,
> 
> I have recently heard that libstdc++ comes
> with assertion checks, and that one can
> enable them using the "-D_GLIBCXX_DEBUG"
> comiler flag. For instance, compiling
> 
> #include <vector>
> 
> int main(int,char **) {
>   std::vector<int> v;
>   v[3] = 2;
> }
> 
> with -D_GLIBCXX_DEBUG would result in a
> runtime error mesage. Wonderful!

All correct, except that the debug mode was added in GCC 3.4

I'll update the debug.html page to say so.

jon

-- 
"Sell your cleverness and buy bewilderment:
 Cleverness is mere opinion, bewilderment is intuition."
	- Jalal-uddin Rumi



More information about the Libstdc++ mailing list