LNK4099 using a simple Qt SDK installation and Visual C ++ 2008

Was there a clean install on a new computer running Windows 7 with:

  • Visual Studio 2008 SP1
  • Qt SDK 1.1.4

Then I created a new project in Qt Creator. I selected the “Qt Gui application” in the “Qt Widget Design” section and had the target desktop computers with Visual C ++ 2008, both debugging and release (mostly the default settings).

Then I clicked "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 need to miss something obvious - for sure, because of the box with Qt, it is not supposed to include compiler / linker warnings?!?!

How do I resolve this linker warning? I prefer to treat warnings as errors, so ... I would like this to be fixed.

+5
source share
5 answers

Could not find a solution. I am sure that recompiling Qt will solve the problem, but for simplicity I want to stick to what is installed with the SDK.

0
source

The path to vc90.pdb , built into qtmain_win.obj , is not the path specified in the linker settings.

According to the instructions in this article :

In the linker settings, Properties->Linker->Debugging->Generate Program Database File has the value $(TargetDir)$(TargetName).pdb .

In C / C ++ settings, Properties->C/C++->Output Files->Program Database File should also set $(TargetDir)$(TargetName).pdb (its default value is $(IntDir)\vc90.pdb ) .

Otherwise, you can try to clean and rebuild the Debug assembly.

+3
source

A separate installation of the Qt library (4.8.2) and Qt Creator (2.5.2) was used here. I no longer receive warning LNK4099.

Be sure to delete the settings remaining after QtSDK: keys in KHCU\Software\Nokia and %APPDATA%\Nokia .

Manually upgrading the QT library in the QtSDK package manager can also work.

+1
source

Add

QMAKE_LFLAGS += /ignore:4099

into your .pro file.

if you do not want to create .pdb files for your executables or library, add

QMAKE_CXXFLAGS += /Z7

therefore, debugging information will be placed in .obj files.

You may need to remove all Makefile * to update the building rules. Tested in Qt Creator 2.4.1 with MSVC 2008 SP1

0
source

This happens when you move the Qt directories (i.e. those containing libs / pdbs) to another directory after compilation. The path to the PDB file is built into the libraries, so when you move them, the linker cannot find it.

It seems that the safest / cleanest problem is to rebuild Qt in a new location.

0
source

Source: https://habr.com/ru/post/924952/


All Articles