воскресенье, 24 февраля 2013 г.

“Already defined” linker error

This error is very common, when you try to compile in Visual Studio a huge cross-platform C++ project.

This is because of standart C++ templates, that are released in Visual Studio libs and in additional UNIX libs too. So, you have to exclude one of them to use another.

Just add one of them, go to Project Properties / Linker / Input / Ignore Specific Default Libraries and add the standard lib that produces conflict. For me it was enough to add LIBCMT.LIB.

LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt

LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt

It's a common error when you compile C++-projects with Visual Studio 2010. Ift happens when 2 version of Visual Studio are installed on same PC (like 2010 and 2012) and cause conflict between two versions of cvtres.exe.

To fix it, go to the bin directory of Visual Studio 2010 (c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\ or something like this) and rename cvtres.exe to cvtres0.exe.

Don't worry, it willn’t break linker of 2010,