Wednesday 7 July 2010

LINK : fatal error LNK1000: Internal error during IncrBuildImage

Oh dear, what's all this?

After a fresh Windows7 install my vs2008 c++ project kept regularly throwing this at me at the link stage.

A microsoft hotfix seems to have sorted it though :

Although maybe the real reason is that I haven't installed the vs2008 SP1 update yet.

Either way the problem has gone so I'm a happy bunny.

Tuesday 6 July 2010

dxguid.lib(dxguid.obj) : fatal error LNK1103: debugging information corrupt; recompile module

dxguid.lib(dxguid.obj) : fatal error LNK1103: debugging information corrupt; recompile module

Argh, what's going on?! There's surely nothing wrong with the debugging info in dxguid.lib. So what's the real problem?

Well it's a known backward compatibility with the Windows SDK. Using the Windows 7 SDK with Visual Studio 2005 can cause problems if linking with libs created with Visual Studio 2008.

So.. either migrate to VS2008, or install the microsoft hotfix http://support.microsoft.com/kb/949009/

..and you are back in action!!


error LNK2005: __vsnprintf already defined in LIBCMT.lib

MSVCRT.lib(MSVCR80.dll) : error LNK2005: __vsnprintf already defined in LIBCMT.lib(vsnprint.obj)

How many times have I seen this type of error? ....and how many times have I had to look up the answer? Too many.

So, while it's fresh in my mind, here's the solution.

Decide if you want your application to use runtime DLLs or to include them internally.

If you include internally then:
- You won't have the benefit of future runtime DLL patches
- You don't have to worry about DLLs following the exe around
- You will have the added cost of greater filesize

So choose either
/MT - (no DLLs) LIBCMT.lib is included
or
/MD - MSVCRT.lib is included and DLLs are used at runtime

The option is found in Project properties / Config properties / C/C++ / Code Generation / Runtime Library

If you experience the above error then you are mixing the two, which is bad. Check each lib that you are linking in conforms to your choice. Rebuild any that do not and the error will disappear like magic!