Using separate build libraries lead to the following message of the Visual Studio 2008 linker:
warning LNK4099: PDB 'vc90.pdb' was not found with ...
The problem is that the object files embeds the path to the PDB file. The following steps extracts the object file from the library and shows the embedded path.
C:\>lib /list al.lib Microsoft (R) Library Manager Version 9.00.30729.01 ... .\Debug\alIP_Winsock.obj ... C:\>lib /extract:.\Debug\alIP_Winsock.obj al.lib Microsoft (R) Library Manager Version 9.00.30729.01 C:\>dir *.obj ... 30.06.2009 13:53 48.195 alIP_Winsock.obj ... C:\>dumpbin /section:.debug$T /rawdata alIP_Winsock.obj Microsoft (R) COFF/PE Dumper Version 9.00.30729.01 ... Dump of file alIP_Winsock.obj ... RAW DATA #3E 00000000: 04 00 00 00 6E 00 15 15 D1 E3 36 F9 6E D3 E4 4E ....n...Ñã6ùnÓäN 00000010: 92 D2 08 70 C2 43 72 F6 01 00 00 00 63 3A 5C 5F .Ò.pÂCrö....c:\_ ... 00000030: 6F 61 5C 63 6F 64 65 5C 64 70 77 73 63 6F 72 65 oa\code\dpwscore 00000040: 2D 32 2E 31 2E 30 5C 70 6C 61 74 66 6F 72 6D 5C -2.1.0\platform\ 00000050: 76 73 32 30 30 38 5C 77 69 6E 33 32 5C 61 6C 5C vs2008\win32\al\ 00000060: 61 6C 5C 64 65 62 75 67 5C 76 63 39 30 2E 70 64 al\debug\vc90.pd 00000070: 62 00 F2 F1 b.òñ ...
Fixing this problem is done by setting the Program Database File for the object file and the library to the same setting.
Here are the location in the VS2008 Project Properties:
Project Configuration Properties -> C/C++ -> Output Files
Program Database File
This name, e.g. $(IntDir)\vc90.pdb, is embedded into the object file and it should be the same as the one in
Project Configuration Properties -> Linker -> Debugging
Generate Program Database File
This is, e.g. $(TargetDir)$(TargetName).pdb
Now the object file contain the path where the library is located, too.
...
RAW DATA #3E
00000000: 04 00 00 00 56 00 15 15 3E 7B 32 F1 12 86 51 48 ....V...>{2ñ..QH
00000010: 97 34 6B AC 14 85 20 C2 01 00 00 00 63 3A 5C 5F .4k¬.. Â....c:\_
...
00000030: 6F 61 5C 63 6F 64 65 5C 74 6F 6F 6C 73 5C 64 70 oa\code\tools\dp
00000040: 77 73 63 6F 72 65 62 75 69 6C 64 5C 64 65 62 75 wscorebuild\debu
00000050: 67 5C 61 6C 2E 70 64 62 00 F3 F2 F1 g\al.pdb.óòñ
...
Here are the Properties as used within a VS C++ Project file (.vcproj) or Property file (.vsprops):
<Tool
Name=”VCCLCompilerTool”
ProgramDataBaseFileName=”$(TargetDir)$(TargetName).pdb”
/>
<Tool
Name=”VCLinkerTool”
ProgramDatabaseFile=”$(TargetDir)$(TargetName).pdb”
/>
<br /> <Tool<br /> Name="VCCLCompilerTool"<br /> ProgramDataBaseFileName="$(TargetDir)$(TargetName).pdb"<br /> /><br /> <Tool<br /> Name="VCLinkerTool"<br /> ProgramDatabaseFile="$(TargetDir)$(TargetName).pdb"<br /> /><br />
Tags: vs2008
June 1, 2010 at 17:17 |
Should i change $(IntDir)\vc90.pdb into $(TargetDir)$(TargetName).pdb or the other way around?
June 8, 2010 at 17:34 |
The first way: change $(IntDir)\vc90.pdb into $(TargetDir)$(TargetName).pdb.
June 4, 2010 at 17:37 |
Hello,
I came across the same warning. I don’t really understand how you fix it.
“Fixing this problem is done by setting the Program Database File for the object file and the library to the same setting.” : Does it mean that I have to replace “$(IntDir)\vc90.pdb” by “$(TargetDir)$(TargetName).pdb” in “Project Configuration Properties -> C/C++ -> Output Files Program Database File” ?
Thanks for your post and for taking your time to post a fix to this issue.
June 8, 2010 at 17:30 |
Yes.
October 25, 2010 at 09:52 |
Hello,
Even though I change the “$(IntDir)\vc90.pdb” by “$(TargetDir)$(TargetName).pdb”, error isn’t solved. I tried on Release and Debug types of debuggers. So, is there other way?
Thanks in advance!
November 15, 2010 at 02:50 |
Hi
thanks for this post! It helped me fixing this problem :)))
Regards,
cal
February 12, 2011 at 06:15 |
Thanks. That solved my problem too.
July 14, 2011 at 18:48 |
First try this before anything else… delete the contents of debug directory (which includes all the objs and the pdb) and then build again. That solved my problem.
October 8, 2011 at 06:55 |
Thanks! It helped. After renaming it and including target pdb with debug version of the lib to my project I now resolved this annoying warning.
March 15, 2012 at 08:46 |
Iam using VS2005 and having this “”warning LNK4099: PDB ‘vc90.pdb’ was not found with ‘C:\Program Files\Lemur\Lemur 4.12\lib\lemur.lib” warning.
I did all what you said, but i stiil have the warning
May 24, 2012 at 16:27 |
Anybody knows how to solve this problem in VS2010?
May 28, 2012 at 15:42 |
I am using VS10 (2010) the same way as VS9 (2008). So I would think that there is no difference to VS9 in VS10. Are you observing a difference?
May 29, 2012 at 08:45
I do not know where to find the menu entries
Project Configuration Properties -> C/C++ -> Output Files
Program Database File
or
Project Configuration Properties -> Linker -> Debugging
Generate Program Database File
in the configuration properties.
Also manually editing the project files by adding something like the tags above does not bring the intended results as projects converted to vs10 (vcxproj files) seems to have another notation for such behaviour.