This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
How to get debug mode version of libstdc++ when compiling GCC
- From: "Pit Cuppens" <pcuppens at gmx dot net>
- To: libstdc++ at gcc dot gnu dot org
- Date: Thu, 22 Jul 2004 17:04:05 +0200 (MEST)
- Subject: How to get debug mode version of libstdc++ when compiling GCC
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!
So I tried this with my GCC compiler, 3.3.2,
which I downloaded and built myself according
to the instruction on http://gcc.gnu.org/install;
my command line was
./configure --enable-languages=c++
To my surprise, the above program resulted
in a segmentation fault, no error message,
no assertions. I guess that libstdc++ was
not configured to enable the debugging mode,
am I right?
So how can I do this? Do I have to pass
--enable-debug to the above configuration
line of GCC? Will the GCC-config-script
pass this along to libstdc++ and in this
way configure libstdc++ the way I want it?
Of course, I tried to read the manuals at
http://gcc.gnu.org/onlinedocs/libstdc++/install.html
However, after reading this, I am not really
sure what to do. So please excuse my ignorance;
any help is highly appreciated.
Many thanks and best regards,
Pit
--
+++ GMX DSL-Tarife 3 Monate gratis* +++ Nur bis 25.7.2004 +++
Bis 24.000 MB oder 300 Freistunden inkl. http://www.gmx.net/de/go/dsl