From: Johannes Schmidt <johannes.f.schmidt@gmx.de>
To: gcc-help@gcc.gnu.org
Subject: gcc-3.0.3 + glut
Date: Mon, 14 Jan 2002 12:58:00 -0000 [thread overview]
Message-ID: <E16QEBo-0005NP-00@marvin.castle> (raw)
Hi,
if I link my application with glut (-lglut), my program seg faults (or sig
ills, it depends upon the optimization level) whenever I try to
dynamic_cast an object.
This does not happen with gcc-2.95.3.
minimal example:
#include <iostream>
class Base {
public:
virtual ~Base() {};
};
class A : public Base {
};
int main(int argc, char ** argv) {
A * a = new A();
Base * base = a;
std::cerr << "implicit cast Base * base = a; \n";
A * a2 = dynamic_cast<A*>(base);
std::cerr << "explicit cast A * a2 = dynamic_cast<A*>(base); \n";
}
compile instruction:
g++-3.0 test_cpp.cpp -o test_cpp -lglut
system:
Debian GNU/Linux
gcc version 3.0.3
Thanks,
Johannes
reply other threads:[~2002-01-14 20:58 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E16QEBo-0005NP-00@marvin.castle \
--to=johannes.f.schmidt@gmx.de \
--cc=gcc-help@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).