gcc-3.0.3 + glut
Johannes Schmidt
johannes.f.schmidt@gmx.de
Mon Jan 14 12:58:00 GMT 2002
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
More information about the Gcc-help
mailing list