views:

356

answers:

3

I am linking with a number of 3rd party .lib files, and I get a large number of LNK4099 warnings at link time. It appears that this warning message cannot be supressed, so I believe that if I remove all debug information from the .lib files, the warning will not be shown. Is there a way to remove the debug information? These are libraries that I do not have the source code for.

I am using VS2005 C++ (on Windows of course).

+1  A: 

I don't think it is possible, at least with not with conventional tools. I would recommend you contact the vendor and request that they rebuild the .lib file without debug information.

A: 

COFF format - as found on Unix, at any rate, is reasonably well organized. There are lots of sections in it. There was also a tool, mcs for 'manipulate comment section' which could be used to remove material. The tool is available on Solaris for ELF (which is an extension of COFF), and probably elsewhere.

What this might mean is that you can find the program and use it on the MS object files.

On the other hand, it seems unlikely that the complaints would be resolved by removing the debug information; the debug information should not affect the running (or linking) of the program. That said, the information found via Google 'microsoft lnk4009' is non-conclusive; two entries appear, but both end up showing 'LNK4099' rather than 'LNK4009' messages.

Jonathan Leffler
The error is LNK4099. I have fixed it in the question.
jmatthias
With the correct error number (it is safer to copy'n'paste), a Google search finds more - including the link that @Rope points you at.
Jonathan Leffler
+1  A: 

I guess you have already read this page from MSDN:

MSDN: Linker Tools Warning LNK4099

Link says that "... remove the /DEBUG linker option if you do not have .pdb files for the objects you are linking."

I guess this is not an option for you.

Rope