26

I have downloaded the FreeImage source code and done a static build myself for X64 MT DLL.

Everything works fine, except when I use link in the freeimage.lib file I get a lot of annoying linker warnings which I don't quite understand the cause for?

2>freeimage.lib(zutil.obj) : warning LNK4099: PDB 'vc100.pdb' was not found with 'freeimage.lib(zutil.obj)' or at '\bin\Release\vc100.pdb'; linking object as if no debug info

... and it continous like that...

What is causing this and how do I get rid of it? I'm guessing it's some compiler option when I build FreeImage.

Here is the command line for the FreeImageLib project:

/I"..\" /I"..\ZLib" /I"..\DeprecationManager" /I"..\OpenEXR\Half" /I"..\OpenEXR\Iex" /I"..\OpenEXR\IlmImf" /I"..\OpenEXR\Imath" /I"..\OpenEXR\IlmThread" /nologo /W3 /WX- /Od /D "WIN32" /D "_DEBUG" /D "OPJ_STATIC" /D "FREEIMAGE_LIB" /D "_CRT_SECURE_NO_DEPRECATE" /D "LIBRAW_NODLL" /D "_VC80_UPGRADE=0x0710" /D "_MBCS" /GF- /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /openmp /Fp".\Debug/FreeImageLib.pch" /Fa".\Debug/" /Fo".\Debug/" /Fd".\Debug/" /Gd /errorReport:queue

EDIT:

I solved it by building it as a dynamic library instead. Though that is not the solution I had hoped for...

ronag
  • 49,529
  • 25
  • 126
  • 221
  • 3
    The right way to solve this issue has been described here: http://cldoten.wordpress.com/2009/07/01/vs2008-fixing-the-warning-pdb-vc90-pdb-not-found/ It worked for me in Visual Studio 2010 also. – Gautam Jain Mar 15 '12 at 15:03
  • The cldoten link didn't fix mine. Still can't find it; but I'm working with Qt, so it may be a different issue, I guess. – Almo May 14 '12 at 19:04

1 Answers1

35

When you compile a static library with debug symbols, you get this file, vc100.pdb, along with the library. The symbolic information in this file will be merged with that of other libraries during linking, to produce the final PDB for the EXE or DLL you are linking. The linker is complaining that it cannot find this file where it expects it to be found.

It's only a warning, and it will only happen in debug builds. If you compile FreeImage in release configuration, this warning should go away. Or, figure out why the linker isn't finding the vc100.pdb file.

The other answer that has been given to you is insane nonsense.

brewbuck
  • 887
  • 6
  • 9
  • What I had forgot to mention is the "Debug Mode". Apart from that I thought the incremental linking was quite obvious. What I sensed from the question is that the pdb file missing problem was related to the symbols not found by the linker during the debug process. I am not sure why that is utterly wrong. I understand that a pdb file is as important as code but I thought it was solely for debugging purpose.. Can you correct if that assumption is wrong? – Ajai Jan 09 '12 at 04:36
  • 2
    When I said insane, I was referring to two things (one of which was said by someone else, not you): the idea that the PDB could be downloaded from the site where the source code is located (as if it would magically match up with the binary you compile on your own machine -- that's crazy talk) ; and the claim that it's "illegal" to distribute a DLL without its PDB. I realize you were not the source of the second thing. – brewbuck Jan 11 '12 at 00:04
  • The reason I was sure that the pdb could be downloaded from website was because when I was working with webkit's source I downloaded the source from webkit's site and later I downloaded the symbols from apple's site and it did work for and after loading the symbols I was able to debug the same. I answered based on that assumption. Am I getting it wrong? – Ajai Jan 11 '12 at 13:21
  • 1
    Ok, maybe I was misunderstanding you. Let me know if I have this right. You downloaded webkit in binary form. You downloaded a PDB. And you downloaded the corresponding source. These three things allowed you to debug webkit at source level. Is that right? I assumed you took the source to webkit, compiled it, and debugged the resulting binary using someone else's PDB file. THAT is completely impossible :-) – brewbuck Jan 13 '12 at 20:44
  • Unfortunately I did the latter.. I downloaded the source code of webkit from webkit.org and downloaded symbol files (pdb) files of the same from apple's website and compiled it and debugged it in VS2005. I don't know how it was possible but I did this and everything worked fine... Hhhhmm may be I am misunderstanding it somewhere.. Hhhhmm let me try it once again for my satisfaction... – Ajai Jan 15 '12 at 18:28
  • How can I specify the location of the `vc100.pdb` file? I am using a third party library that places the `vc100.pdb` file in a different folder than the `.lib` file. I tried adding the folder to the Additional Library Directories, but that doesn't work. – bouvierr Jul 31 '18 at 14:53