Did a clean install on a new Windows 7 computer with:
- Visual Studio 2008 SP1
- Qt SDK 1.1.4
Then I created a new project in Qt Creator. I picked "Qt Gui Application" under "Qt Widget Project" and had it target desktops with Visual C++ 2008, both debug & release (basically default settings).
Then I pressed Build, and got....
qtmaind.lib(qtmain_win.obj):-1: warning: LNK4099: PDB 'vc90.pdb' was not
found with 'c:\QtSDK\Desktop\Qt\4.7.4\msvc2008\lib\qtmaind.lib' or at
'C:\Users\JamesJ\Desktop\QtTest-build-desktop-Qt_4_7_4_for_Desktop_-
_MSVC2008__Qt_SDK__Debug\debug\vc90.pdb'; linking object as if no debug info
I must be missing something obvious - surely the out-of-box experience with Qt isn't supposed to involve compiler/linker warnings?!?!
How do I resolve this linker warning? I prefer to treat warnings as errors, so... I'd like to get this fixed.
Add
QMAKE_LFLAGS += /ignore:4099
to your .pro file.
if you want to not create .pdb files for your executables or library add
QMAKE_CXXFLAGS += /Z7
so debug information will put in .obj files.
You maybe need to delete all Makefiles* to update the building rules. Tested in Qt Creator 2.4.1 with MSVC 2008 SP1
The path to
vc90.pdb
embedded inqtmain_win.obj
is not the same path that is set in your linker settings.Per the instructions in this article:
In the linker settings,
Properties->Linker->Debugging->Generate Program Database File
has the value$(TargetDir)$(TargetName).pdb
.In the C/C++ settings,
Properties->C/C++->Output Files->Program Database File
should also be set to$(TargetDir)$(TargetName).pdb
(its default value is$(IntDir)\vc90.pdb
).Failing that, you can try cleaning and rebuilding the Debug build.
This happens when you move Qt directories (i.e. the ones containing libs/pdbs) to a different directory after compilation. The path to the PDB file is embedded in the libraries, so when you move them the linker cannot find it.
Seems for me that the safest/cleanest issue is to rebuild Qt in the new location.
Was unable to find a solution to this. I'm sure recompiling Qt would resolve the issue, but for simplicity I want to stick with what is installed with the SDK for now.
Separately installing Qt Library (4.8.2) and Qt Creator (2.5.2) worked here. I no longer get the LNK4099 warning.
Make sure to remove the settings QtSDK leaves behind: the keys in
KHCU\Software\Nokia
and the%APPDATA%\Nokia
folder.Upgrading QT Library manually within QtSDK package manager might also work.