Why do I get the following error: QtMain.lib(qtmain_win.obj) : fatal error LNK1103: debugging information corrupt; recompile module?

This error can occur when downloading the wrong binary package, e.g when downloading qt-win-commercial-4.6.3-vs2008.exe and using it with Visual Studio 2005, so make sure you have downloaded the correct package.

This error can also occur when having 2 compilers installed and not using the same compiler that was used for building the package. In this case, you need to ensure that your environment is set up correctly for the compiler you want to use. If you have installed the binary package for VS 2008 for example, you need to use it with the VS 2008 compiler. In order to do so, then use the command prompt provided with the binary package or select the “Visual Studio with Qt SomeVersion” option in the Start menu.

You can check if the correct compiler is set up in your environment, by typing

  1. set

in the command prompt provided with the binary package. Then you need to make sure the compiler you want to use is listed first in your PATH environment variable.

Alternatively, you can use the command prompts provided with Visual Studio and call

  1. set qmakespec=theMkSpecYouUse
  2. PATH=%path%;yourQtVersion/bin;

to make sure you use the Qt version built with that compiler.

1 comment

December 3, 2011

Picture of chen.kline chen.kline

Lab Rat

it’s a bug.

you should rebuild qt for win32-msvc2005

at present, we need keep qt’s all files for win32-msvc2008, and we need copy all these files to another directory and rebuild it for msvc2005.
if we are working for a wince project at the same time, we need copy qt to a new directory like ‘qt-wince’ for rebuilding qt for wince platform.

then we need keep 3 copies of QT for these platforms.
:(

Write a comment

Sorry, you must be logged in to post a comment.