LNK4099 with static library

LNK4099 with static library

.There have been a few postings on LNK4099, for examples,


related to native libraries.  A recent (March, 2013) rebuild of a Fotran static library with

Intel(R) Visual Fortran Composer XE 2011 Integration for Microsoft Visual Studio* 2010, 12.0.3470.2010
/nologo /debug:full /Od /warn:interfaces /names:uppercase /iface:stdref /module:"Debug\\" /object:"Debug\\" /Fd"Debug\vc100.pdb" /traceback /libs:static /threads /dbglibs /c

used by a C++ dll has given LNK4099 errors for each of the Fortran routines

staticlib.lib(*.obj) : warning LNK4099: pdb 'vc100.pdb' was not found with 'staticlib.lib(*.obj)' or at z:\path\vc100.pdb'; linking object as if no debug info

used by the dll

extern "C" void __stdcall *(...)

where * = name of subroutine.

Excluding the staticlib.lib is not an option.  The Fortran settings (e.g.  STDCALL, REFERENCE (/iface:stdref)) have not changed.

Making the debug version of staticlib.lib without debug gets rid of the link warnings but this defeats the purpose of a debug build.

The LNK4099 diagnostics are just warnings but any advice on getting a successful debug build without LNK4099 would be welcome.

publicaciones de 6 / 0 nuevos
Último envío
Para obtener más información sobre las optimizaciones del compilador, consulte el aviso sobre la optimización.

This warning means is the .pdb file for staticlib.lib was not found.  Debugging information is in the .pdb file. If you are copying the staticlib.lib file, make sure to copy or link to the .pdb file as well.

You can still run your program without any issues without the .pdb file.

Valid point Annalee.  Thanks for the quick response.  But what I did not make clear in the original post is that the staticlib.lib and pdb have not moved since the recent rebuild.  Before the recent rebuild there were no LNK4099 messages but after, with the the files still in the same default locations from the build (unchanged signatures of the subroutines and interfaces in file.h and same directives to the C++ linker for the path to the staticlib.lib), now there are LNK4099 warnings.

One odd LNK4099 diagnostic refers to an obj for a *.f file that has subroutine in the static library that 0) is called within the library but 1) is not called from the C++ dll and 2) does not have an interface (extern "C" void __stdcall *(...)) defined in file.h.  Don't know how the linker came up with this one or if there is some tool like dumpbin for a static library that might explain this.  Or if some explicit attributes should be made for subroutines in the static library to correspond to the interfaces in file.h (like dllexport for a dll).

The .pdb files were most likely deleated in the clean step of the rebuild.

You are right.  For sure the files were deleted during the build because they reappear with the same new time stamp





 in the (default) folders but after the rebuild the LNK4099 diagnostics appear when the C++ dll is built although the original build did not have any link errors.  I don't think any IVF project settings were changed.  Are there some project settings that would be useful to check?



>>... Are there some project settings that would be useful to check?

You could compile the static library with /Z7 option and the pdb file won't be used.

Inicie sesión para dejar un comentario.