* gcc-3.0.3 + glut
@ 2002-01-14 12:58 Johannes Schmidt
0 siblings, 0 replies; only message in thread
From: Johannes Schmidt @ 2002-01-14 12:58 UTC (permalink / raw)
To: gcc-help
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2002-01-14 20:58 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-14 12:58 gcc-3.0.3 + glut Johannes Schmidt
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).