I am having troubles using dynamic_cast with some of my custom qt widgets in linux, but not windows. Is there any issues that could cause it to fail:

For example, say I have a custom widget called MyCustomWidget. This fails in linux, but works in windows:

MyCustomWidget* widg(dynamic_cast<MyCustomWidget*>(w));

This, however, works in both:
QWdget* widg(dynamic_cast<QWidget*>(w));