title: QT application crashes on startup (c++ windows)
body: <p>I have the source code f a qt application which was written by somebody else who is not with my company anymore.</p>
  
  <p>I managed to compile the code using qt 4.8.4. I found that original version used qt 4.7.3.</p>
  
  <p>When I run application it crashes just after start-up inside one of the qt DLL.</p>
  
  <p>I am developing on windows7 x64, but target is x86. I am using VS 2012 and compiled qt using VS 2012.</p>
  
  <p>Do I need to set anything environment variable for QT to work properly?</p>
  
  <p>Do I need to install any other software (such as opengl or any other library that qt relays on them)?</p>
  
  <p><strong>Edit 1</strong></p>
  
  <p>The stack after crashing is:</p>
  
  <pre><code>QtOpenGLd4.dll!QGLContextPrivate::extensionFuncs(const QGLContext * ctx) Line 467   C++
      QtOpenGLd4.dll!qt_resolve_glsl_extensions(QGLContext * ctx) Line 257    C++
      QtOpenGLd4.dll!QGLShaderPrivate::create() Line 227  C++
      QtOpenGLd4.dll!QGLShader::QGLShader(QFlags&lt;enum QGLShader::ShaderTypeBit&gt; type, const QGLContext * context, QObject * parent) Line 342  C++
      QtOpenGLd4.dll!QGLEngineSharedShaders::QGLEngineSharedShaders(const QGLContext * context) Line 191  C++
      QtOpenGLd4.dll!QGLContextGroupResource&lt;QGLEngineSharedShaders&gt;::value(const QGLContext * context) Line 777  C++
      QtOpenGLd4.dll!QGLShaderStorage::shadersForThread(const QGLContext * context) Line 63   C++
      QtOpenGLd4.dll!QGLEngineSharedShaders::shadersForContext(const QGLContext * context) Line 74    C++
      QtOpenGLd4.dll!QGLEngineShaderManager::QGLEngineShaderManager(QGLContext * context) Line 467    C++
      QtOpenGLd4.dll!QGL2PaintEngineEx::begin(QPaintDevice * pdev) Line 2150  C++
      QtGuid4.dll!QPainter::begin(QPaintDevice * pd) Line 1881    C++
      QtGuid4.dll!QPainter::QPainter(QPaintDevice * pd) Line 1508 C++
      myapp.exe!SViewer::paintEvent(QPaintEvent * __formal) Line 187  C++
      QtGuid4.dll!QWidget::event(QEvent * event) Line 8533    C++
      QtOpenGLd4.dll!QGLWidget::event(QEvent * e) Line 4408   C++
      QtGuid4.dll!QApplicationPrivate::notify_helper(QObject * receiver, QEvent * e) Line 4562    C++
      QtGuid4.dll!QApplication::notify(QObject * receiver, QEvent * e) Line 4527  C++
      QtCored4.dll!QCoreApplication::notifyInternal(QObject * receiver, QEvent * event) Line 946  C++
      QtCored4.dll!QCoreApplication::sendSpontaneousEvent(QObject * receiver, QEvent * event) Line 234    C++
      QtGuid4.dll!QWidgetPrivate::drawWidget(QPaintDevice * pdev, const QRegion &amp; rgn, const QPoint &amp; offset, int flags, QPainter * sharedPainter, QWidgetBackingStore * backingStore) Line 5598  C++
      QtGuid4.dll!QWidgetPrivate::repaint_sys(const QRegion &amp; rgn) Line 1659  C++
      QtGuid4.dll!QWidgetPrivate::syncBackingStore() Line 1894    C++
      QtGuid4.dll!QWidget::event(QEvent * event) Line 8680    C++
      QtOpenGLd4.dll!QGLWidget::event(QEvent * e) Line 4408   C++
      QtGuid4.dll!QApplicationPrivate::notify_helper(QObject * receiver, QEvent * e) Line 4562    C++
      QtGuid4.dll!QApplication::notify(QObject * receiver, QEvent * e) Line 4527  C++
      QtCored4.dll!QCoreApplication::notifyInternal(QObject * receiver, QEvent * event) Line 946  C++
      QtCored4.dll!QCoreApplication::sendEvent(QObject * receiver, QEvent * event) Line 231   C++
      QtCored4.dll!QCoreApplicationPrivate::sendPostedEvents(QObject * receiver, int event_type, QThreadData * data) Line 1570    C++
      QtCored4.dll!qt_internal_proc(HWND__ * hwnd, unsigned int message, unsigned int wp, long lp) Line 496   C++
      user32.dll!75ce62fa()   Unknown
      [Frames below may be incorrect and/or missing, no symbols loaded for user32.dll]    
      user32.dll!75ce6d3a()   Unknown
      user32.dll!75ce6ce9()   Unknown
      user32.dll!75ce77c4()   Unknown
      user32.dll!75ce788a()   Unknown
      QtCored4.dll!QEventDispatcherWin32::processEvents(QFlags&lt;enum QEventLoop::ProcessEventsFlag&gt; flags) Line 810    C++
      QtGuid4.dll!QGuiEventDispatcherWin32::processEvents(QFlags&lt;enum QEventLoop::ProcessEventsFlag&gt; flags) Line 1204 C++
      QtCored4.dll!QEventLoop::processEvents(QFlags&lt;enum QEventLoop::ProcessEventsFlag&gt; flags) Line 150   C++
      QtCored4.dll!QEventLoop::exec(QFlags&lt;enum QEventLoop::ProcessEventsFlag&gt; flags) Line 204    C++
      QtGuid4.dll!QDialog::exec() Line 555    C++
      myapp.exe!MainWindow::actionWelcomeDialog() Line 1078   C++
      myapp.exe!MainWindow::qt_static_metacall(QObject * _o, QMetaObject::Call _c, int _id, void * * _a) Line 92  C++
      QtCored4.dll!QMetaCallEvent::placeMetaCall(QObject * object) Line 524   C++
      QtCored4.dll!QObject::event(QEvent * e) Line 1194   C++
      QtGuid4.dll!QWidget::event(QEvent * event) Line 8845    C++
      QtGuid4.dll!QMainWindow::event(QEvent * event) Line 1479    C++
      QtGuid4.dll!QApplicationPrivate::notify_helper(QObject * receiver, QEvent * e) Line 4562    C++
      QtGuid4.dll!QApplication::notify(QObject * receiver, QEvent * e) Line 4527  C++
      QtCored4.dll!QCoreApplication::notifyInternal(QObject * receiver, QEvent * event) Line 946  C++
      QtCored4.dll!QCoreApplication::sendEvent(QObject * receiver, QEvent * event) Line 231   C++
      QtCored4.dll!QCoreApplicationPrivate::sendPostedEvents(QObject * receiver, int event_type, QThreadData * data) Line 1570    C++
      QtCored4.dll!qt_internal_proc(HWND__ * hwnd, unsigned int message, unsigned int wp, long lp) Line 496   C++
      user32.dll!75ce62fa()   Unknown
      user32.dll!75ce6d3a()   Unknown
      user32.dll!75ce6ce9()   Unknown
      user32.dll!75ce77c4()   Unknown
      user32.dll!75ce788a()   Unknown
      QtCored4.dll!QEventDispatcherWin32::processEvents(QFlags&lt;enum QEventLoop::ProcessEventsFlag&gt; flags) Line 810    C++
      QtGuid4.dll!QGuiEventDispatcherWin32::processEvents(QFlags&lt;enum QEventLoop::ProcessEventsFlag&gt; flags) Line 1204 C++
      QtCored4.dll!QEventLoop::processEvents(QFlags&lt;enum QEventLoop::ProcessEventsFlag&gt; flags) Line 150   C++
      QtCored4.dll!QEventLoop::exec(QFlags&lt;enum QEventLoop::ProcessEventsFlag&gt; flags) Line 204    C++
      QtCored4.dll!QCoreApplication::exec() Line 1218 C++
      QtGuid4.dll!QApplication::exec() Line 3824  C++
      myapp.exe!main(int argc, char * * argv) Line 26 C++
      myapp.exe!WinMain(HINSTANCE__ * instance, HINSTANCE__ * prevInstance, char * __formal, int cmdShow) Line 131    C++
      myapp.exe!__tmainCRTStartup() Line 528  C
      myapp.exe!WinMainCRTStartup() Line 377  C
      kernel32.dll!758333aa() Unknown
      ntdll.dll!77d59ef2()    Unknown
      ntdll.dll!77d59ec5()    Unknown
  </code></pre>